Esempio n. 1
0
        public void TestReestablishTotalCount()
        {
            var histogram = new ShortHistogram(HighestTrackableValue, 2);

            histogram.RecordValue(TestValueLevel);
            histogram.RecordValue(TestValueLevel * 10);
            Assert.False(histogram.HasOverflowed());
            // This should overflow a ShortHistogram:
            histogram.RecordValueWithExpectedInterval(histogram.HighestTrackableValue - 1, 500);
            Assert.True(histogram.HasOverflowed());
            histogram.ReestablishTotalCount();
            Assert.False(histogram.HasOverflowed());
        }
Esempio n. 2
0
 public void TestReestablishTotalCount()
 {
     var histogram = new ShortHistogram(HighestTrackableValue, 2);
     histogram.RecordValue(TestValueLevel);
     histogram.RecordValue(TestValueLevel * 10);
     Assert.False(histogram.HasOverflowed());
     // This should overflow a ShortHistogram:
     histogram.RecordValueWithExpectedInterval(histogram.HighestTrackableValue - 1, 500);
     Assert.True(histogram.HasOverflowed());
     histogram.ReestablishTotalCount();
     Assert.False(histogram.HasOverflowed());
 }