public void TestScaledLowestEquivalentValue() { var longHistogram = new LongHistogram(1024, HighestTrackableValue, NumberOfSignificantValueDigits); Assert.AreEqual(10000 * 1024, longHistogram.LowestEquivalentValue(10007 * 1024), "The lowest equivalent value to 10007 * 1024 is 10000 * 1024"); Assert.AreEqual(10008 * 1024, longHistogram.LowestEquivalentValue(10009 * 1024), "The lowest equivalent value to 10009 * 1024 is 10008 * 1024"); }
public void TestLowestEquivalentValue() { var longHistogram = new LongHistogram(HighestTrackableValue, NumberOfSignificantValueDigits); Assert.AreEqual(10000, longHistogram.LowestEquivalentValue(10007), "The lowest equivalent value to 10007 is 10000"); Assert.AreEqual(10008, longHistogram.LowestEquivalentValue(10009), "The lowest equivalent value to 10009 is 10008"); }
public void TestScalingEquivalence() { Assert.AreEqual( LongHistogram.GetMean() * 512, ScaledHistogram.GetMean(), ScaledHistogram.GetMean() * 0.000001, "averages should be equivalent"); Assert.AreEqual( LongHistogram.TotalCount, ScaledHistogram.TotalCount, "total count should be the same"); Assert.AreEqual( LongHistogram.LowestEquivalentValue(LongHistogram.GetValueAtPercentile(99.0)) * 512, ScaledHistogram.LowestEquivalentValue(ScaledHistogram.GetValueAtPercentile(99.0)), "99%'iles should be equivalent"); Assert.AreEqual( ScaledHistogram.HighestEquivalentValue(LongHistogram.GetMaxValue() * 512), ScaledHistogram.GetMaxValue(), "Max should be equivalent for scaled data"); // Same for post-corrected: Assert.AreEqual( LongHistogram.GetMean() * 512, ScaledHistogram.GetMean(), ScaledHistogram.GetMean() * 0.000001, "averages should be equivalent"); Assert.AreEqual( PostCorrectedHistogram.TotalCount, PostCorrectedScaledHistogram.TotalCount, "total count should be the same"); Assert.AreEqual( PostCorrectedHistogram.LowestEquivalentValue(PostCorrectedHistogram.GetValueAtPercentile(99.0)) * 512, PostCorrectedScaledHistogram.LowestEquivalentValue(PostCorrectedScaledHistogram.GetValueAtPercentile(99.0)), "99%'iles should be equivalent"); Assert.AreEqual( PostCorrectedScaledHistogram.HighestEquivalentValue(PostCorrectedHistogram.GetMaxValue() * 512), PostCorrectedScaledHistogram.GetMaxValue(), "Max should be equivalent for post-corrected data"); }