Source/NFX/Throttling/SlidingWindowThrottle.cs
/// <summary>
/// Reset the internal state of the throttling strategy
/// </summary>
Reset the internal state of the throttling strategy
Reset the internal state of the throttling strategy
public override void Reset()
            {
                int maxSeconds = (int)IntMath.UpperPow(m_BucketsPerSec * m_Interval, 2);
                m_LogBucketsSec = IntMath.Log(m_BucketsPerSec, 2);
                m_BucketCount = maxSeconds * m_BucketsPerSec;
                m_BucketMask = m_BucketCount - 1;
                m_BucketsInterval = m_Interval << m_LogBucketsSec;
                Debug.Assert((m_BucketCount & (m_BucketCount - 1)) == 0);
                m_Buckets = new double[m_BucketCount];
                Array.Clear(m_Buckets, 0, m_Buckets.Length);
                m_LastTimeBucket = 0;
                m_Sum = 0;
            }
public override void Reset ( ) { int maxSeconds = ( int ) IntMath . UpperPow ( m_BucketsPerSec * m_Interval , 2 ) ; m_LogBucketsSec = IntMath . Log ( m_BucketsPerSec , 2 ) ; m_BucketCount = maxSeconds * m_BucketsPerSec ; m_BucketMask = m_BucketCount - 1 ; m_BucketsInterval = m_Interval << m_LogBucketsSec ; Debug . Assert ( ( m_BucketCount & ( m_BucketCount - 1 ) ) == 0 ) ; m_Buckets = new double [ m_BucketCount ] ; Array . Clear ( m_Buckets , 0 , m_Buckets . Length ) ; m_LastTimeBucket = 0 ; m_Sum = 0 ; }
Reset the internal state of the throttling strategy
Reset the internal state of the throttling strategy
// must be power of two