|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.metrics2.lib.MetricsRegistry
@InterfaceAudience.Public @InterfaceStability.Evolving public class MetricsRegistry
An optional metrics registry class for creating and maintaining a collection of MetricsMutables, making writing metrics source easier.
| Constructor Summary | |
|---|---|
MetricsRegistry(MetricsInfo info)
Construct the registry with a metadata object |
|
MetricsRegistry(String name)
Construct the registry with a record name |
|
| Method Summary | |
|---|---|
void |
add(String name,
long value)
Add sample to a stat metric by name. |
MutableMetric |
get(String name)
Get a metric by name |
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 |
MutableQuantiles |
newQuantiles(String name,
String desc,
String sampleName,
String valueName,
int interval)
Create a mutable metric that estimates quantiles of a stream of values |
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) |
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 |
MetricsRegistry |
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 |
MetricsRegistry |
tag(MetricsInfo info,
String value)
|
MetricsRegistry |
tag(MetricsInfo info,
String value,
boolean override)
Add a tag to the metrics |
MetricsRegistry |
tag(String name,
String description,
String value)
Add a tag to the metrics |
MetricsRegistry |
tag(String name,
String description,
String value,
boolean override)
Add a tag to the metrics |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MetricsRegistry(String name)
name - of the record of the metricspublic MetricsRegistry(MetricsInfo info)
info - the info object for the metrics record/group| Method Detail |
|---|
public MetricsInfo info()
public MutableMetric get(String name)
name - of the metric
public MetricsTag getTag(String name)
name - of the tag
public MutableCounterInt newCounter(String name,
String desc,
int iVal)
name - of the metricdesc - metric descriptioniVal - initial value
public MutableCounterInt newCounter(MetricsInfo info,
int iVal)
info - metadata of the metriciVal - initial value
public MutableCounterLong newCounter(String name,
String desc,
long iVal)
name - of the metricdesc - metric descriptioniVal - initial value
public MutableCounterLong newCounter(MetricsInfo info,
long iVal)
info - metadata of the metriciVal - initial value
public MutableGaugeInt newGauge(String name,
String desc,
int iVal)
name - of the metricdesc - metric descriptioniVal - initial value
public MutableGaugeInt newGauge(MetricsInfo info,
int iVal)
info - metadata of the metriciVal - initial value
public MutableGaugeLong newGauge(String name,
String desc,
long iVal)
name - of the metricdesc - metric descriptioniVal - initial value
public MutableGaugeLong newGauge(MetricsInfo info,
long iVal)
info - metadata of the metriciVal - initial value
public MutableQuantiles newQuantiles(String name,
String desc,
String sampleName,
String valueName,
int interval)
name - of the metricdesc - metric descriptionsampleName - of the metric (e.g., "Ops")valueName - of the metric (e.g., "Time" or "Latency")interval - rollover interval of estimator in seconds
public 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 metric
public MutableRate newRate(String name,
String description)
name - of the metricdescription - of the metric
public MutableRate newRate(String name,
String desc,
boolean extended)
name - of the metricdesc - descriptionextended - produce extended stat (stdev/min/max etc.) if true
public void add(String name,
long value)
name - of the metricvalue - of the snapshot to addpublic MetricsRegistry setContext(String name)
name - of the context
public MetricsRegistry tag(String name,
String description,
String value)
name - of the tagdescription - of the tagvalue - of the tag
public MetricsRegistry tag(String name,
String description,
String value,
boolean override)
name - of the tagdescription - of the tagvalue - of the tagoverride - existing tag if true
public MetricsRegistry tag(MetricsInfo info,
String value,
boolean override)
info - metadata of the tagvalue - of the tagoverride - existing tag if true
public MetricsRegistry 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 String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||