library/Odesk/Phystrix/MetricsCounter.php
public function reset()
    {
        // For each type of metric, we attempt to set the counter to 0
        foreach (array(self::SUCCESS, self::FAILURE, self::TIMEOUT, self::FALLBACK_SUCCESS,
                       self::FALLBACK_FAILURE, self::EXCEPTION_THROWN,
                       self::RESPONSE_FROM_CACHE) as $type) {
            $now = $this->getTimeInMilliseconds();
            for ($i = 0; $i < $this->rollingStatisticalWindowBuckets; $i++) {
                $bucketIndex = $this->getBucketIndex($i, $now);
                $this->stateStorage->resetBucket($this->commandKey, $type, $bucketIndex);
            }
        }
    }
public function reset()
    {
        // For each type of metric, we attempt to set the counter to 0
        foreach (array(self::SUCCESS, self::FAILURE, self::TIMEOUT, self::FALLBACK_SUCCESS,
                       self::FALLBACK_FAILURE, self::EXCEPTION_THROWN,
                       self::RESPONSE_FROM_CACHE) as $type) {
            $now = $this->getTimeInMilliseconds();
            for ($i = 0; $i < $this->rollingStatisticalWindowBuckets; $i++) {
                $bucketIndex = $this->getBucketIndex($i, $now);
                $this->stateStorage->resetBucket($this->commandKey, $type, $bucketIndex);
            }
        }
    }
public function reset ( ) { // For each type of metric, we attempt to set the counter to 0 foreach ( array ( self :: SUCCESS , self :: FAILURE , self :: TIMEOUT , self :: FALLBACK_SUCCESS , self :: FALLBACK_FAILURE , self :: EXCEPTION_THROWN , self :: RESPONSE_FROM_CACHE ) as $ type ) { $ now = $ this -> getTimeInMilliseconds ( ) ; for ( $ i = 0 ; $ i < $ this -> rollingStatisticalWindowBuckets ; $ i ++ ) { $ bucketIndex = $ this -> getBucketIndex ( $ i , $ now ) ; $ this -> stateStorage -> resetBucket ( $ this -> commandKey , $ type , $ bucketIndex ) ; } } }
Resets buckets for all metrics, within the statistical window.

This is needed for when the statistical window is larger than the sleep window (for allowSingleTest).
In such case, if we did not reset the buckets, we could possibly have bad statistics effective for the
following request, causing the circuit to open right after it was just closed.

May cause short-circuited stats to be removed from reporting, see http://goo.gl/dtHN34
Resets buckets for all metrics within the statistical window .