Exemplo 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());
        }
Exemplo n.º 2
0
        public void TestOverflow()
        {
            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());
            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("");
        }
Exemplo n.º 3
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());
 }
Exemplo n.º 4
0
 public void TestOverflow()
 {
     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());
     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("");
 }