예제 #1
0
        public void testReestablishTotalCount()
        {
            ShortHistogram histogram = new ShortHistogram(highestTrackableValue, 2);

            histogram.recordValue(testValueLevel);
            histogram.recordValue(testValueLevel * 10);
            Assert.assertFalse(histogram.hasOverflowed());
            // This should overflow a ShortHistogram:
            histogram.recordValueWithExpectedInterval(histogram.getHighestTrackableValue() - 1, 500);
            Assert.assertTrue(histogram.hasOverflowed());
            histogram.reestablishTotalCount();
            Assert.assertFalse(histogram.hasOverflowed());
        }
예제 #2
0
 public void testReestablishTotalCount()  
 {
     ShortHistogram histogram = new ShortHistogram(highestTrackableValue, 2);
     histogram.recordValue(testValueLevel);
     histogram.recordValue(testValueLevel * 10);
     Assert.assertFalse(histogram.hasOverflowed());
     // This should overflow a ShortHistogram:
     histogram.recordValueWithExpectedInterval(histogram.getHighestTrackableValue() - 1, 500);
     Assert.assertTrue(histogram.hasOverflowed());
     histogram.reestablishTotalCount();
     Assert.assertFalse(histogram.hasOverflowed());
 }