Source/NFX/Throttling/SlidingWindowThrottle.cs
/// <summary>
/// Dump the internal state to string
/// </summary>
/// <param name="time">Time for which to dump internal state to string</param>
Dump the internal state to string
Dump the internal state to string
public string ToString(DateTime time)
            {
                long now = (long)(((double)time.Ticks / 10000) * m_BucketsPerSec);
                long bucket = now & m_BucketMask;
                StringBuilder buf = new StringBuilder(256);
                buf.AppendFormat("last_time={0}, last_bucket={1}, sum={2} (interval={3})\n",
                        m_LastTimeBucket, bucket, m_Sum, m_BucketsInterval);
                long n = (bucket - m_BucketsInterval) & m_BucketMask;
                for (long j = 0; j < m_BucketCount; j++)
                {
                    buf.AppendFormat("{0:00000}{1}", j, (j == bucket || j == n) ? '|' : ' ');
                    buf.Append((j < m_BucketCount - 1) ? "" : "\n");
                }
                for (long j = 0; j < m_BucketCount; j++)
                {
                    buf.AppendFormat("{0:000.0}{1}", m_Buckets[j], (j == bucket || j == n) ? '|' : ' ');
                    buf.Append((j < m_BucketCount - 1) ? "" : "\n");
                }
                return buf.ToString();
            }
public string ToString ( DateTime time ) { long now = ( long ) ( ( ( double ) time . Ticks / 10000 ) * m_BucketsPerSec ) ; long bucket = now & m_BucketMask ; StringBuilder buf = new StringBuilder ( 256 ) ; buf . AppendFormat ( " \n " , m_LastTimeBucket , bucket , m_Sum , m_BucketsInterval ) ; long n = ( bucket - m_BucketsInterval ) & m_BucketMask ; for ( long j = 0 ; j < m_BucketCount ; j ++ ) { buf . AppendFormat ( " " , j , ( j == bucket || j == n ) ? ' ' : ' ' ) ; buf . Append ( ( j < m_BucketCount - 1 ) ? " " : " \n " ) ; } for ( long j = 0 ; j < m_BucketCount ; j ++ ) { buf . AppendFormat ( " " , m_Buckets [ j ] , ( j == bucket || j == n ) ? ' ' : ' ' ) ; buf . Append ( ( j < m_BucketCount - 1 ) ? " " : " \n " ) ; } return buf . ToString ( ) ; }
Dump the internal state to string
Dump the internal state to string
time
DateTime
Time for which to dump internal state to string
Time for which to dump internal state to string