public void testScalingEquivalence()
 {
     Assert.assertEquals("averages should be equivalent",
                         histogram.getMean() * 512,
                         scaledHistogram.getMean(), scaledHistogram.getMean() * 0.000001);
     Assert.assertEquals("total count should be the same",
                         histogram.getTotalCount(),
                         scaledHistogram.getTotalCount());
     Assert.assertEquals("99%'iles should be equivalent",
                         histogram.lowestEquivalentValue(histogram.getValueAtPercentile(99.0)) * 512,
                         scaledHistogram.lowestEquivalentValue(scaledHistogram.getValueAtPercentile(99.0)));
     Assert.assertEquals("Max should be equivalent",
                         histogram.getMaxValue() * 512,
                         scaledHistogram.getMaxValue());
     // Same for post-corrected:
     Assert.assertEquals("averages should be equivalent",
                         histogram.getMean() * 512,
                         scaledHistogram.getMean(), scaledHistogram.getMean() * 0.000001);
     Assert.assertEquals("total count should be the same",
                         postCorrectedHistogram.getTotalCount(),
                         postCorrectedScaledHistogram.getTotalCount());
     Assert.assertEquals("99%'iles should be equivalent",
                         postCorrectedHistogram.lowestEquivalentValue(postCorrectedHistogram.getValueAtPercentile(99.0)) * 512,
                         postCorrectedScaledHistogram.lowestEquivalentValue(postCorrectedScaledHistogram.getValueAtPercentile(99.0)));
     Assert.assertEquals("Max should be equivalent",
                         postCorrectedHistogram.getMaxValue() * 512,
                         postCorrectedScaledHistogram.getMaxValue());
 }
Example #2
0
 /// <inheritdoc cref="ISnapshot"/>
 public double GetValue(double quantile)
 {
     return(_histogram.getValueAtPercentile(quantile * 100));
 }