Class NoopMetricsRegistry
java.lang.Object
org.opensearch.telemetry.metrics.noop.NoopMetricsRegistry
- All Implemented Interfaces:
Closeable,AutoCloseable,MetricsRegistry
No-op
MetricsRegistry
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()createCounter(String name, String description, String unit) Creates the counter.createGauge(String name, String description, String unit, Supplier<Double> valueProvider, Tags tags) Creates the Observable Gauge type of Metric.createGauge(String name, String description, String unit, Supplier<TaggedMeasurement> value) Creates the Observable Gauge type of Metric.createHistogram(String name, String description, String unit) Creates the histogram type of Metric.createUpDownCounter(String name, String description, String unit) Creates the upDown counter.
-
Field Details
-
INSTANCE
No-op Meter instance
-
-
Method Details
-
createCounter
Description copied from interface:MetricsRegistryCreates the counter.- Specified by:
createCounterin interfaceMetricsRegistry- Parameters:
name- name of the counter.description- any description about the metric.unit- unit of the metric.- Returns:
- counter.
-
createUpDownCounter
Description copied from interface:MetricsRegistryCreates the upDown counter.- Specified by:
createUpDownCounterin interfaceMetricsRegistry- Parameters:
name- name of the upDown counter.description- any description about the metric.unit- unit of the metric.- Returns:
- counter.
-
createHistogram
Description copied from interface:MetricsRegistryCreates the histogram type of Metric. Implementation framework will take care of the bucketing strategy.- Specified by:
createHistogramin interfaceMetricsRegistry- Parameters:
name- name of the histogram.description- any description about the metric.unit- unit of the metric.- Returns:
- histogram.
-
createGauge
public Closeable createGauge(String name, String description, String unit, Supplier<Double> valueProvider, Tags tags) Description copied from interface:MetricsRegistryCreates the Observable Gauge type of Metric. Where the value provider will be called at a certain frequency to capture the value.- Specified by:
createGaugein interfaceMetricsRegistry- Parameters:
name- name of the observable gauge.description- any description about the metric.unit- unit of the metric.valueProvider- value provider.tags- attributes/dimensions of the metric.- Returns:
- closeable to dispose/close the Gauge metric.
-
createGauge
public Closeable createGauge(String name, String description, String unit, Supplier<TaggedMeasurement> value) Description copied from interface:MetricsRegistryCreates the Observable Gauge type of Metric. Where the value provider will be called at a certain frequency to capture the value.- Specified by:
createGaugein interfaceMetricsRegistry- Parameters:
name- name of the observable gauge.description- any description about the metric.unit- unit of the metric.value- value provider.- Returns:
- closeable to dispose/close the Gauge metric.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-