HBASE-14862 Add support for reporting p90 for histogram metrics

Signed-off-by: Andrew Purtell <apurtell@apache.org>
This commit is contained in:
Sanjeev Lakshmanan 2015-11-19 16:02:08 -08:00 committed by Andrew Purtell
parent b71e1bce86
commit 2ce27951b0
3 changed files with 4 additions and 0 deletions

View File

@ -31,6 +31,7 @@ public interface MetricHistogram {
String MEAN_METRIC_NAME = "_mean"; String MEAN_METRIC_NAME = "_mean";
String MEDIAN_METRIC_NAME = "_median"; String MEDIAN_METRIC_NAME = "_median";
String SEVENTY_FIFTH_PERCENTILE_METRIC_NAME = "_75th_percentile"; String SEVENTY_FIFTH_PERCENTILE_METRIC_NAME = "_75th_percentile";
String NINETIETH_PERCENTILE_METRIC_NAME = "_90th_percentile";
String NINETY_FIFTH_PERCENTILE_METRIC_NAME = "_95th_percentile"; String NINETY_FIFTH_PERCENTILE_METRIC_NAME = "_95th_percentile";
String NINETY_NINETH_PERCENTILE_METRIC_NAME = "_99th_percentile"; String NINETY_NINETH_PERCENTILE_METRIC_NAME = "_99th_percentile";

View File

@ -60,6 +60,7 @@ public class DynamicMetricsRegistry {
"_max", "_max",
"_median", "_median",
"_75th_percentile", "_75th_percentile",
"_90th_percentile",
"_95th_percentile", "_95th_percentile",
"_99th_percentile"}; "_99th_percentile"};

View File

@ -126,6 +126,8 @@ public class MutableHistogram extends MutableMetric implements MetricHistogram {
metricsRecordBuilder.addGauge(Interns.info(name + MEDIAN_METRIC_NAME, desc), s.getMedian()); metricsRecordBuilder.addGauge(Interns.info(name + MEDIAN_METRIC_NAME, desc), s.getMedian());
metricsRecordBuilder.addGauge(Interns.info(name + SEVENTY_FIFTH_PERCENTILE_METRIC_NAME, desc), metricsRecordBuilder.addGauge(Interns.info(name + SEVENTY_FIFTH_PERCENTILE_METRIC_NAME, desc),
s.get75thPercentile()); s.get75thPercentile());
metricsRecordBuilder.addGauge(Interns.info(name + NINETIETH_PERCENTILE_METRIC_NAME, desc),
s.getValue(0.90));
metricsRecordBuilder.addGauge(Interns.info(name + NINETY_FIFTH_PERCENTILE_METRIC_NAME, desc), metricsRecordBuilder.addGauge(Interns.info(name + NINETY_FIFTH_PERCENTILE_METRIC_NAME, desc),
s.get95thPercentile()); s.get95thPercentile());
metricsRecordBuilder.addGauge(Interns.info(name + NINETY_NINETH_PERCENTILE_METRIC_NAME, desc), metricsRecordBuilder.addGauge(Interns.info(name + NINETY_NINETH_PERCENTILE_METRIC_NAME, desc),