@InterfaceAudience.Private public class DynamicMetricsRegistry extends Object
Constructor and Description |
---|
DynamicMetricsRegistry(MetricsInfo info)
Construct the registry with a metadata object
|
DynamicMetricsRegistry(String name)
Construct the registry with a record name
|
Modifier and Type | Method and Description |
---|---|
void |
clearMetrics() |
MutableMetric |
get(String name)
Get a metric by name
|
MutableHistogram |
getHistogram(String histoName) |
MutableCounterLong |
getLongCounter(String counterName,
long potentialStartingValue)
Get a MetricMutableCounterLong from the storage.
|
MutableGaugeLong |
getLongGauge(String gaugeName,
long potentialStartingValue)
Get a MetricMutableGaugeLong from the storage.
|
MetricMutableQuantiles |
getQuantile(String histoName) |
MetricsTag |
getTag(String name)
Get a tag by name
|
MetricsInfo |
info() |
MutableCounterInt |
newCounter(MetricsInfo info,
int iVal)
Create a mutable integer counter
|
MutableCounterLong |
newCounter(MetricsInfo info,
long iVal)
Create a mutable long integer counter
|
MutableCounterInt |
newCounter(String name,
String desc,
int iVal)
Create a mutable integer counter
|
MutableCounterLong |
newCounter(String name,
String desc,
long iVal)
Create a mutable long integer counter
|
MutableGaugeInt |
newGauge(MetricsInfo info,
int iVal)
Create a mutable integer gauge
|
MutableGaugeLong |
newGauge(MetricsInfo info,
long iVal)
Create a mutable long integer gauge
|
MutableGaugeInt |
newGauge(String name,
String desc,
int iVal)
Create a mutable integer gauge
|
MutableGaugeLong |
newGauge(String name,
String desc,
long iVal)
Create a mutable long integer gauge
|
MutableHistogram |
newHistogram(String name)
Create a new histogram.
|
MutableHistogram |
newHistogram(String name,
String desc)
Create a new histogram.
|
MetricMutableQuantiles |
newQuantile(String name)
Create a new MutableQuantile(A more accurate histogram).
|
MetricMutableQuantiles |
newQuantile(String name,
String desc) |
MutableRate |
newRate(String name)
Create a mutable rate metric
|
MutableRate |
newRate(String name,
String description)
Create a mutable rate metric
|
MutableRate |
newRate(String name,
String desc,
boolean extended)
Create a mutable rate metric (for throughput measurement)
|
MutableRate |
newRate(String name,
String desc,
boolean extended,
boolean returnExisting) |
MutableStat |
newStat(String name,
String desc,
String sampleName,
String valueName)
Create a mutable metric with stats
|
MutableStat |
newStat(String name,
String desc,
String sampleName,
String valueName,
boolean extended)
Create a mutable metric with stats
|
void |
removeMetric(String name)
Removes metric by name
|
DynamicMetricsRegistry |
setContext(String name)
Set the metrics context tag
|
void |
snapshot(MetricsRecordBuilder builder,
boolean all)
Sample all the mutable metrics and put the snapshot in the builder
|
DynamicMetricsRegistry |
tag(MetricsInfo info,
String value) |
DynamicMetricsRegistry |
tag(MetricsInfo info,
String value,
boolean override)
Add a tag to the metrics
|
DynamicMetricsRegistry |
tag(String name,
String description,
String value)
Add a tag to the metrics
|
DynamicMetricsRegistry |
tag(String name,
String description,
String value,
boolean override)
Add a tag to the metrics
|
String |
toString() |
public DynamicMetricsRegistry(String name)
name
- of the record of the metricspublic DynamicMetricsRegistry(MetricsInfo info)
info
- the info object for the metrics record/grouppublic MetricsInfo info()
public MutableMetric get(String name)
name
- of the metricpublic MetricsTag getTag(String name)
name
- of the tagpublic MutableCounterInt newCounter(String name, String desc, int iVal)
name
- of the metricdesc
- metric descriptioniVal
- initial valuepublic MutableCounterInt newCounter(MetricsInfo info, int iVal)
info
- metadata of the metriciVal
- initial valuepublic MutableCounterLong newCounter(String name, String desc, long iVal)
name
- of the metricdesc
- metric descriptioniVal
- initial valuepublic MutableCounterLong newCounter(MetricsInfo info, long iVal)
info
- metadata of the metriciVal
- initial valuepublic MutableGaugeInt newGauge(String name, String desc, int iVal)
name
- of the metricdesc
- metric descriptioniVal
- initial valuepublic MutableGaugeInt newGauge(MetricsInfo info, int iVal)
info
- metadata of the metriciVal
- initial valuepublic MutableGaugeLong newGauge(String name, String desc, long iVal)
name
- of the metricdesc
- metric descriptioniVal
- initial valuepublic MutableGaugeLong newGauge(MetricsInfo info, long iVal)
info
- metadata of the metriciVal
- initial valuepublic MutableStat newStat(String name, String desc, String sampleName, String valueName, boolean extended)
name
- of the metricdesc
- metric descriptionsampleName
- of the metric (e.g., "Ops")valueName
- of the metric (e.g., "Time" or "Latency")extended
- produce extended stat (stdev, min/max etc.) if true.public MutableStat newStat(String name, String desc, String sampleName, String valueName)
name
- of the metricdesc
- metric descriptionsampleName
- of the metric (e.g., "Ops")valueName
- of the metric (e.g., "Time" or "Latency")public MutableRate newRate(String name)
name
- of the metricpublic MutableRate newRate(String name, String description)
name
- of the metricdescription
- of the metricpublic MutableRate newRate(String name, String desc, boolean extended)
name
- of the metricdesc
- descriptionextended
- produce extended stat (stdev/min/max etc.) if true@InterfaceAudience.Private public MutableRate newRate(String name, String desc, boolean extended, boolean returnExisting)
public MutableHistogram newHistogram(String name)
name
- Name of the histogram.public MutableHistogram newHistogram(String name, String desc)
name
- The name of the histogramdesc
- The description of the data in the histogram.public MetricMutableQuantiles newQuantile(String name)
name
- The name of the histogrampublic MetricMutableQuantiles newQuantile(String name, String desc)
public DynamicMetricsRegistry setContext(String name)
name
- of the contextpublic DynamicMetricsRegistry tag(String name, String description, String value)
name
- of the tagdescription
- of the tagvalue
- of the tagpublic DynamicMetricsRegistry tag(String name, String description, String value, boolean override)
name
- of the tagdescription
- of the tagvalue
- of the tagoverride
- existing tag if truepublic DynamicMetricsRegistry tag(MetricsInfo info, String value, boolean override)
info
- metadata of the tagvalue
- of the tagoverride
- existing tag if truepublic DynamicMetricsRegistry tag(MetricsInfo info, String value)
public void snapshot(MetricsRecordBuilder builder, boolean all)
builder
- to contain the metrics snapshotall
- get all the metrics even if the values are not changed.public void removeMetric(String name)
name
- name of the metric to removepublic MutableGaugeLong getLongGauge(String gaugeName, long potentialStartingValue)
gaugeName
- name of the gauge to create or get.potentialStartingValue
- value of the new gauge if we have to create it.public MutableCounterLong getLongCounter(String counterName, long potentialStartingValue)
counterName
- Name of the counter to getpotentialStartingValue
- starting value if we have to create a new counterpublic MutableHistogram getHistogram(String histoName)
public MetricMutableQuantiles getQuantile(String histoName)
public void clearMetrics()