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()); }
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()); }