@InterfaceAudience.Public @InterfaceStability.Evolving public class MutableQuantiles extends MutableMetric
Modifier and Type | Field and Description |
---|---|
protected Map<org.apache.hadoop.metrics2.util.Quantile,Long> |
previousSnapshot |
static org.apache.hadoop.metrics2.util.Quantile[] |
quantiles |
Constructor and Description |
---|
MutableQuantiles() |
MutableQuantiles(String name,
String description,
String sampleName,
String valueName,
int interval)
Instantiates a new
MutableQuantiles for a metric that rolls itself
over on the specified time interval. |
Modifier and Type | Method and Description |
---|---|
void |
add(long value) |
void |
addQuantileInfo(int i,
MetricsInfo info)
Add entry to quantileInfos array.
|
org.apache.hadoop.metrics2.util.QuantileEstimator |
getEstimator()
Get the quantile estimator.
|
int |
getInterval()
Get the rollover interval (in seconds) of the estimator.
|
void |
setEstimator(org.apache.hadoop.metrics2.util.QuantileEstimator quantileEstimator) |
void |
setInterval(int pIntervalSecs)
Set the rollover interval (in seconds) of the estimator.
|
void |
setNumInfo(MetricsInfo pNumInfo)
Set info about the metrics.
|
void |
setQuantileInfos(int length)
Initialize quantileInfos array.
|
void |
snapshot(MetricsRecordBuilder builder,
boolean all)
Get a snapshot of the metric
|
void |
stop() |
changed, clearChanged, setChanged, snapshot
@VisibleForTesting public static final org.apache.hadoop.metrics2.util.Quantile[] quantiles
public MutableQuantiles(String name, String description, String sampleName, String valueName, int interval)
MutableQuantiles
for a metric that rolls itself
over on the specified time interval.name
- of the metricdescription
- long-form textual description of the metricsampleName
- type of items in the stream (e.g., "Ops")valueName
- type of the valuesinterval
- rollover interval (in seconds) of the estimatorpublic MutableQuantiles()
public void snapshot(MetricsRecordBuilder builder, boolean all)
MutableMetric
snapshot
in class MutableMetric
builder
- the metrics record builderall
- if true, snapshot unchanged metrics as wellpublic void add(long value)
public void setNumInfo(MetricsInfo pNumInfo)
pNumInfo
- info about the metrics.public void setQuantileInfos(int length)
length
- of the quantileInfos array.public void addQuantileInfo(int i, MetricsInfo info)
i
- array index.info
- info to be added to quantileInfos array.public void setInterval(int pIntervalSecs)
pIntervalSecs
- of the estimator.public int getInterval()
public void stop()
@VisibleForTesting public org.apache.hadoop.metrics2.util.QuantileEstimator getEstimator()
public void setEstimator(org.apache.hadoop.metrics2.util.QuantileEstimator quantileEstimator)
Copyright © 2023 Apache Software Foundation. All rights reserved.