Beispiel #1
0
        public int GetCount(T identity)
        {
            long currentBucketStartTimeInMilliseconds = base.GetCurrentBucketStartTimeInMilliseconds();
            int  num2 = 0;

            for (int i = 0; i < base.Buckets.Length; i++)
            {
                CounterBucket <T> bucket = base.Buckets[i];
                if ((currentBucketStartTimeInMilliseconds - bucket.TimeInMilliseconds) < base.TimeWindowInMilliseconds)
                {
                    num2 += bucket[identity];
                }
            }
            return(num2);
        }
Beispiel #2
0
        public int GetCount(T identity)
        {
            long currentBufferStartTime = GetCurrentBucketStartTimeInMilliseconds();
            int  count = 0;

            for (int i = 0; i < Buckets.Length; i++)
            {
                CounterBucket <T> bucket = Buckets[i];
                if (currentBufferStartTime - bucket.TimeInMilliseconds < TimeWindowInMilliseconds)
                {
                    count += bucket[identity];
                }
            }
            return(count);
        }