@InterfaceAudience.Public @InterfaceStability.Evolving public class MutableStat extends MutableMetric
Constructor and Description |
---|
MutableStat(String name,
String description,
String sampleName,
String valueName)
Construct a snapshot stat metric with extended stat off by default
|
MutableStat(String name,
String description,
String sampleName,
String valueName,
boolean extended)
Construct a sample statistics metric
|
Modifier and Type | Method and Description |
---|---|
void |
add(long value)
Add a snapshot to the metric
|
void |
add(long numSamples,
long sum)
Add a number of samples and their sum to the running stat
|
void |
resetMinMax()
Reset the all time min max of the metric
|
void |
snapshot(MetricsRecordBuilder builder,
boolean all)
Get a snapshot of the metric
|
changed, clearChanged, setChanged, snapshot
public MutableStat(String name, String description, String sampleName, String valueName, boolean extended)
name
- of the metricdescription
- of the metricsampleName
- of the metric (e.g. "Ops")valueName
- of the metric (e.g. "Time", "Latency")extended
- create extended stats (stdev, min/max etc.) by default.public MutableStat(String name, String description, String sampleName, String valueName)
name
- of the metricdescription
- of the metricsampleName
- of the metric (e.g. "Ops")valueName
- of the metric (e.g. "Time", "Latency")public void add(long numSamples, long sum)
numSamples
- number of samplessum
- of the samplespublic void add(long value)
value
- of the metricpublic void snapshot(MetricsRecordBuilder builder, boolean all)
MutableMetric
snapshot
in class MutableMetric
builder
- the metrics record builderall
- if true, snapshot unchanged metrics as wellpublic void resetMinMax()
Copyright © 2014 Apache Software Foundation. All Rights Reserved.