@InterfaceAudience.Public @InterfaceStability.Evolving public class MetricsJsonBuilder extends MetricsRecordBuilder
toString()
operator dumps out all values collected.Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
MetricsJsonBuilder(MetricsCollector parent)
Build an instance.
|
Modifier and Type | Method and Description |
---|---|
MetricsRecordBuilder |
add(AbstractMetric metric)
Add a pre-made immutable metric object
|
MetricsRecordBuilder |
add(MetricsTag tag)
Add an immutable metrics tag object
|
MetricsRecordBuilder |
addCounter(MetricsInfo info,
int value)
Add an integer metric
|
MetricsRecordBuilder |
addCounter(MetricsInfo info,
long value)
Add an long metric
|
MetricsRecordBuilder |
addGauge(MetricsInfo info,
double value)
Add a double gauge metric
|
MetricsRecordBuilder |
addGauge(MetricsInfo info,
float value)
Add a float gauge metric
|
MetricsRecordBuilder |
addGauge(MetricsInfo info,
int value)
Add a integer gauge metric
|
MetricsRecordBuilder |
addGauge(MetricsInfo info,
long value)
Add a long gauge metric
|
MetricsCollector |
parent() |
MetricsRecordBuilder |
setContext(String value)
Set the context tag
|
MetricsRecordBuilder |
tag(MetricsInfo info,
String value)
Add a metrics value with metrics information
|
String |
toString() |
endRecord
public MetricsJsonBuilder(MetricsCollector parent)
parent
- parent collector. Unused in this instance; only used for
the parent()
methodpublic MetricsRecordBuilder tag(MetricsInfo info, String value)
MetricsRecordBuilder
tag
in class MetricsRecordBuilder
info
- metadata of the tagvalue
- of the tagpublic MetricsRecordBuilder add(MetricsTag tag)
MetricsRecordBuilder
add
in class MetricsRecordBuilder
tag
- a pre-made tag object (potentially save an object construction)public MetricsRecordBuilder add(AbstractMetric metric)
MetricsRecordBuilder
add
in class MetricsRecordBuilder
metric
- the pre-made metric to save an object constructionpublic MetricsRecordBuilder setContext(String value)
MetricsRecordBuilder
setContext
in class MetricsRecordBuilder
value
- of the contextpublic MetricsRecordBuilder addCounter(MetricsInfo info, int value)
MetricsRecordBuilder
addCounter
in class MetricsRecordBuilder
info
- metadata of the metricvalue
- of the metricpublic MetricsRecordBuilder addCounter(MetricsInfo info, long value)
MetricsRecordBuilder
addCounter
in class MetricsRecordBuilder
info
- metadata of the metricvalue
- of the metricpublic MetricsRecordBuilder addGauge(MetricsInfo info, int value)
MetricsRecordBuilder
addGauge
in class MetricsRecordBuilder
info
- metadata of the metricvalue
- of the metricpublic MetricsRecordBuilder addGauge(MetricsInfo info, long value)
MetricsRecordBuilder
addGauge
in class MetricsRecordBuilder
info
- metadata of the metricvalue
- of the metricpublic MetricsRecordBuilder addGauge(MetricsInfo info, float value)
MetricsRecordBuilder
addGauge
in class MetricsRecordBuilder
info
- metadata of the metricvalue
- of the metricpublic MetricsRecordBuilder addGauge(MetricsInfo info, double value)
MetricsRecordBuilder
addGauge
in class MetricsRecordBuilder
info
- metadata of the metricvalue
- of the metricpublic MetricsCollector parent()
parent
in class MetricsRecordBuilder
Copyright © 2022 Apache Software Foundation. All rights reserved.