Package org.apache.hadoop.metrics2.lib
Class MutableHistogram
java.lang.Object
org.apache.hadoop.metrics2.lib.MutableMetric
org.apache.hadoop.metrics2.lib.MutableHistogram
- All Implemented Interfaces:
MetricHistogram
- Direct Known Subclasses:
MutableRangeHistogram
@Private
public class MutableHistogram
extends org.apache.hadoop.metrics2.lib.MutableMetric
implements MetricHistogram
A histogram implementation that runs in constant space, and exports to hadoop2's metrics2 system.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final String
protected HistogramImpl
protected final String
Fields inherited from interface org.apache.hadoop.metrics2.MetricHistogram
MAX_METRIC_NAME, MEAN_METRIC_NAME, MEDIAN_METRIC_NAME, MIN_METRIC_NAME, NINETIETH_PERCENTILE_METRIC_NAME, NINETY_EIGHTH_PERCENTILE_METRIC_NAME, NINETY_FIFTH_PERCENTILE_METRIC_NAME, NINETY_NINE_POINT_NINETH_PERCENTILE_METRIC_NAME, NINETY_NINETH_PERCENTILE_METRIC_NAME, NUM_OPS_METRIC_NAME, SEVENTY_FIFTH_PERCENTILE_METRIC_NAME, TWENTY_FIFTH_PERCENTILE_METRIC_NAME
-
Constructor Summary
ConstructorDescriptionMutableHistogram
(String name, String description) MutableHistogram
(org.apache.hadoop.metrics2.MetricsInfo info) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(long val) Add a single value to a histogram's stream of values.long
getCount()
Return the total number of values added to the histogram.long
getMax()
static void
snapshot
(String name, String desc, Histogram histogram, org.apache.hadoop.metrics2.MetricsRecordBuilder metricsRecordBuilder, boolean all) void
snapshot
(org.apache.hadoop.metrics2.MetricsRecordBuilder metricsRecordBuilder, boolean all) protected static void
updateSnapshotMetrics
(String name, String desc, Histogram histogram, Snapshot snapshot, org.apache.hadoop.metrics2.MetricsRecordBuilder metricsRecordBuilder) Methods inherited from class org.apache.hadoop.metrics2.lib.MutableMetric
changed, clearChanged, setChanged, snapshot
-
Field Details
-
histogram
-
name
-
desc
-
-
Constructor Details
-
MutableHistogram
-
MutableHistogram
-
-
Method Details
-
add
Description copied from interface:MetricHistogram
Add a single value to a histogram's stream of values.- Specified by:
add
in interfaceMetricHistogram
- Parameters:
val
- the value to add
-
getCount
Description copied from interface:MetricHistogram
Return the total number of values added to the histogram.- Specified by:
getCount
in interfaceMetricHistogram
- Returns:
- the total number of values.
-
getMax
-
snapshot
public void snapshot(org.apache.hadoop.metrics2.MetricsRecordBuilder metricsRecordBuilder, boolean all) - Specified by:
snapshot
in classorg.apache.hadoop.metrics2.lib.MutableMetric
-
snapshot
-
updateSnapshotMetrics
protected static void updateSnapshotMetrics(String name, String desc, Histogram histogram, Snapshot snapshot, org.apache.hadoop.metrics2.MetricsRecordBuilder metricsRecordBuilder)
-