private static final class MetricReceiver.NullReceiver extends MetricReceiver
MetricReceiver.MockReceiver
nullImplementation
Constructor and Description |
---|
NullReceiver() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addMetricDefinition(String metricName,
MetricSettings definition)
Add how to build a histogram for a given metric.
|
Counter |
declareCounter(String name)
Declare a counter metric without setting any default position.
|
Counter |
declareCounter(String name,
Point boundDimensions)
Declare a counter metric, with default dimension values as given.
|
Gauge |
declareGauge(String name)
Declare a gauge metric with any default position.
|
Gauge |
declareGauge(String name,
Optional<Point> boundDimensions,
MetricSettings customSettings)
Declare a gauge metric, with default dimension values as given.
|
Gauge |
declareGauge(String name,
Point boundDimensions)
Declare a gauge metric, with default dimension values as given.
|
(package private) MetricSettings |
getMetricDefinition(String metricName)
Get how to build a histogram for a given metric, or null if no histogram
should be created.
|
Bucket |
getSnapshot()
Fetch the latest metric values, aggregated over all threads for the
configured sample history (by default five minutes).
|
PointBuilder |
pointBuilder()
Create a PointBuilder instance with no default settings.
|
void |
update(Sample s)
Update a metric.
|
public void update(Sample s)
MetricReceiver
MetricReceiver.declareCounter(String)
, MetricReceiver.declareCounter(String, Point)
,
MetricReceiver.declareGauge(String)
, or MetricReceiver.declareGauge(String, Point)
instead.update
in class MetricReceiver
s
- a single simple containing all meta data necessary to update a
metricpublic Counter declareCounter(String name)
MetricReceiver
declareCounter
in class MetricReceiver
name
- the name of the metricpublic Counter declareCounter(String name, Point boundDimensions)
MetricReceiver
MetricReceiver.pointBuilder()
.declareCounter
in class MetricReceiver
name
- the name of the metricboundDimensions
- dimensions which have a fixed value in the life cycle of the
metric object or nullpublic Gauge declareGauge(String name)
MetricReceiver
declareGauge
in class MetricReceiver
name
- the name of the metricpublic Gauge declareGauge(String name, Point boundDimensions)
MetricReceiver
MetricReceiver.pointBuilder()
.declareGauge
in class MetricReceiver
name
- the name of the metricboundDimensions
- dimensions which have a fixed value in the life cycle of the
metric object or nullpublic Gauge declareGauge(String name, Optional<Point> boundDimensions, MetricSettings customSettings)
MetricReceiver
MetricReceiver.pointBuilder()
.
MetricSettings instances are built using
MetricSettings.Builder
.declareGauge
in class MetricReceiver
name
- the name of the metricboundDimensions
- an optional of dimensions which have a fixed value in the life
cycle of the metric objectcustomSettings
- any optional settingspublic PointBuilder pointBuilder()
MetricReceiver
pointBuilder
in class MetricReceiver
public Bucket getSnapshot()
MetricReceiver
getSnapshot
in class MetricReceiver
void addMetricDefinition(String metricName, MetricSettings definition)
MetricReceiver
Do note, this is not part of the public API.
addMetricDefinition
in class MetricReceiver
metricName
- the metric where samples should be put in a histogramdefinition
- settings for a histogramMetricSettings getMetricDefinition(String metricName)
MetricReceiver
Do note, this is not part of the public API.
getMetricDefinition
in class MetricReceiver
metricName
- the name of an arbitrary metricCopyright © 2018. All rights reserved.