/** * Returns the value at the 75th percentile in the distribution. * * @return the value at the 75th percentile */ public double get75thPercentile() { return getValue(0.75); }
/** * Returns the value at the 99th percentile in the distribution. * * @return the value at the 99th percentile */ public double get99thPercentile() { return getValue(0.99); }
/** * Returns the value at the 99.9th percentile in the distribution. * * @return the value at the 99.9th percentile */ public double get999thPercentile() { return getValue(0.999); }
/** * Returns the median value in the distribution. * * @return the median value */ public double getMedian() { return getValue(0.5); }
/** * Returns the value at the 95th percentile in the distribution. * * @return the value at the 95th percentile */ public double get95thPercentile() { return getValue(0.95); }
/** * Returns the value at the 98th percentile in the distribution. * * @return the value at the 98th percentile */ public double get98thPercentile() { return getValue(0.98); }
@Test public void testMetricRegistry() throws Exception { String histogramIntName = "org.eclipse.microprofile.metrics.tck.HistogramTest.histogramInt"; String histogramLongName = "test.longData.histogram"; SortedMap<String, Histogram> histograms = metrics.getHistograms(); Assert.assertTrue(histograms.size() == 2); Assert.assertTrue(histograms.containsKey(histogramIntName)); Assert.assertTrue(histograms.containsKey(histogramLongName)); TestUtils.assertEqualsWithTolerance(48, histograms.get(histogramIntName).getSnapshot().getValue(0.5)); TestUtils.assertEqualsWithTolerance(480, histograms.get(histogramLongName).getSnapshot().getValue(0.5)); }
@Test @InSequence(3) public void testTimerRegistry() throws Exception { String timerLongName = "test.longData.timer"; String timerTimeName = "testTime"; SortedMap<String, Timer> timers = registry.getTimers(); Assert.assertTrue(timers.size() > 0); Assert.assertTrue(timers.containsKey(timerLongName)); Assert.assertTrue(timers.containsKey(timerTimeName)); TestUtils.assertEqualsWithTolerance(480, timers.get(timerLongName).getSnapshot().getValue(0.5)); }