library/Odesk/Phystrix/CommandMetricsFactory.php
public function get($commandKey, Config $commandConfig)
    {
        if (!isset($this->commandMetricsByCommand[$commandKey])) {
            $metricsConfig = $commandConfig->get('metrics');
            $statisticalWindow = $metricsConfig->get('rollingStatisticalWindowInMilliseconds');
            $windowBuckets = $metricsConfig->get('rollingStatisticalWindowBuckets');
            $snapshotInterval = $metricsConfig->get('healthSnapshotIntervalInMilliseconds');

            $counter = new MetricsCounter($commandKey, $this->stateStorage, $statisticalWindow, $windowBuckets);
            $this->commandMetricsByCommand[$commandKey] = new CommandMetrics($counter, $snapshotInterval);
        }

        return $this->commandMetricsByCommand[$commandKey];
    }
public function get($commandKey, Config $commandConfig)
    {
        if (!isset($this->commandMetricsByCommand[$commandKey])) {
            $metricsConfig = $commandConfig->get('metrics');
            $statisticalWindow = $metricsConfig->get('rollingStatisticalWindowInMilliseconds');
            $windowBuckets = $metricsConfig->get('rollingStatisticalWindowBuckets');
            $snapshotInterval = $metricsConfig->get('healthSnapshotIntervalInMilliseconds');

            $counter = new MetricsCounter($commandKey, $this->stateStorage, $statisticalWindow, $windowBuckets);
            $this->commandMetricsByCommand[$commandKey] = new CommandMetrics($counter, $snapshotInterval);
        }

        return $this->commandMetricsByCommand[$commandKey];
    }
public function get ( $ commandKey , Config $ commandConfig ) { if ( ! isset ( $ this -> commandMetricsByCommand [ $ commandKey ] ) ) { $ metricsConfig = $ commandConfig -> get ( 'metrics' ) ; $ statisticalWindow = $ metricsConfig -> get ( 'rollingStatisticalWindowInMilliseconds' ) ; $ windowBuckets = $ metricsConfig -> get ( 'rollingStatisticalWindowBuckets' ) ; $ snapshotInterval = $ metricsConfig -> get ( 'healthSnapshotIntervalInMilliseconds' ) ; $ counter = new MetricsCounter ( $ commandKey , $ this -> stateStorage , $ statisticalWindow , $ windowBuckets ) ; $ this -> commandMetricsByCommand [ $ commandKey ] = new CommandMetrics ( $ counter , $ snapshotInterval ) ; } return $ this -> commandMetricsByCommand [ $ commandKey ] ; }
Get command metrics instance by command key for given command config

@param string $commandKey
@param Config $commandConfig
@return CommandMetrics
Get command metrics instance by command key for given command config