public void RollingNumber_Rolling() { MockedTime time = new MockedTime(); HystrixRollingNumberEvent type = HystrixRollingNumberEvent.ThreadMaxActive; HystrixRollingNumber counter = new HystrixRollingNumber(time, 20, 2); // iterate over 20 buckets on a queue sized for 2 for (int i = 0; i < 20; i++) { // first bucket counter.GetCurrentBucket(); try { time.Increment(counter.BucketSizeInMilliseconds); } catch (Exception) { // ignore } Assert.AreEqual(2, counter.GetValues(type).Length); counter.GetValueOfLatestBucket(type); // System.out.println("Head: " + counter.Buckets.state.Get().head); // System.out.println("Tail: " + counter.Buckets.state.Get().tail); } }