예제 #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 testOverflow()
        {
            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());
            Console.WriteLine("Histogram percentile output should show overflow:");
            histogram.outputPercentileDistribution(Console.Out, 5, 100.0);
            Console.WriteLine("\nHistogram percentile output should be in CSV format and show overflow:");
            histogram.outputPercentileDistribution(Console.Out, 5, 100.0, true);
            Console.WriteLine("");
        }
예제 #3
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());
 }
예제 #4
0
 public void testOverflow()  
 {
     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());
     Console.WriteLine("Histogram percentile output should show overflow:");
     histogram.outputPercentileDistribution(Console.Out, 5, 100.0);
     Console.WriteLine("\nHistogram percentile output should be in CSV format and show overflow:");
     histogram.outputPercentileDistribution(Console.Out, 5, 100.0, true);
     Console.WriteLine("");
 }