File indexing completed on 2024-12-29 05:28:03

0001 <?php
0002 /**
0003  * Zend Framework
0004  *
0005  * LICENSE
0006  *
0007  * This source file is subject to the new BSD license that is bundled
0008  * with this package in the file LICENSE.txt.
0009  * It is also available through the world-wide-web at this URL:
0010  * http://framework.zend.com/license/new-bsd
0011  * If you did not receive a copy of the license and are unable to
0012  * obtain it through the world-wide-web, please send an email
0013  * to license@zend.com so we can send you a copy immediately.
0014  *
0015  * @category   Zend
0016  * @package    Zend_Service_WindowsAzure
0017  * @subpackage Diagnostics
0018  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0019  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0020  * @version    $Id$
0021  */
0022 
0023 /**
0024  * @see Zend_Service_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
0025  */
0026 // require_once 'Zend/Service/WindowsAzure/Diagnostics/ConfigurationObjectBaseAbstract.php';
0027 
0028 /**
0029  * @see Zend_Service_WindowsAzure_Diagnostics_PerformanceCounterSubscription
0030  */
0031 // require_once 'Zend/Service/WindowsAzure/Diagnostics/PerformanceCounterSubscription.php';
0032 
0033 /**
0034  * @category   Zend
0035  * @package    Zend_Service_WindowsAzure
0036  * @subpackage Diagnostics
0037  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0038  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0039  *
0040  * @property  int   BufferQuotaInMB           Buffer quota in MB
0041  * @property  int   ScheduledTransferPeriodInMinutes  Scheduled transfer period in minutes
0042  * @property  array Subscriptions           Subscriptions
0043  */
0044 class Zend_Service_WindowsAzure_Diagnostics_ConfigurationPerformanceCounters
0045   extends Zend_Service_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
0046 {
0047     /**
0048      * Constructor
0049      * 
0050    * @param int   $bufferQuotaInMB          Buffer quota in MB
0051    * @param int   $scheduledTransferPeriodInMinutes Scheduled transfer period in minutes
0052    */
0053     public function __construct($bufferQuotaInMB = 0, $scheduledTransferPeriodInMinutes = 0) 
0054     {         
0055         $this->_data = array(
0056             'bufferquotainmb'             => $bufferQuotaInMB,
0057             'scheduledtransferperiodinminutes'  => $scheduledTransferPeriodInMinutes,
0058           'subscriptions'           => array()
0059         );
0060     }
0061     
0062   /**
0063    * Add subscription
0064    * 
0065    * @param string  $counterSpecifier         Counter specifier
0066    * @param int   $sampleRateInSeconds        Sample rate in seconds
0067    */
0068     public function addSubscription($counterSpecifier, $sampleRateInSeconds = 1)
0069     {
0070     
0071       $this->_data['subscriptions'][$counterSpecifier] = new Zend_Service_WindowsAzure_Diagnostics_PerformanceCounterSubscription($counterSpecifier, $sampleRateInSeconds);
0072     }
0073     
0074   /**
0075    * Remove subscription
0076    * 
0077    * @param string  $counterSpecifier         Counter specifier
0078    */
0079     public function removeSubscription($counterSpecifier)
0080     {
0081       if (isset($this->_data['subscriptions'][$counterSpecifier])) {
0082         unset($this->_data['subscriptions'][$counterSpecifier]);
0083       }
0084     }
0085 }