Class TestInMemoryMetricsRegistry
java.lang.Object
org.opensearch.test.telemetry.TestInMemoryMetricsRegistry
- All Implemented Interfaces:
Closeable,AutoCloseable,org.opensearch.telemetry.metrics.MetricsRegistry
public class TestInMemoryMetricsRegistry
extends Object
implements org.opensearch.telemetry.metrics.MetricsRegistry
This is a simple implementation of MetricsRegistry which can be utilized by Unit Tests.
It just initializes and stores counters/histograms within a map, once created.
The maps can then be used to get the counters/histograms by their names.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()org.opensearch.telemetry.metrics.CountercreateCounter(String name, String description, String unit) createGauge(String name, String description, String unit, Supplier<Double> valueProvider, org.opensearch.telemetry.metrics.tags.Tags tags) createGauge(String name, String description, String unit, Supplier<org.opensearch.telemetry.metrics.TaggedMeasurement> value) org.opensearch.telemetry.metrics.HistogramcreateHistogram(String name, String description, String unit) org.opensearch.telemetry.metrics.CountercreateUpDownCounter(String name, String description, String unit) Returns counterStoreReturns the histogramStore.
-
Constructor Details
-
TestInMemoryMetricsRegistry
public TestInMemoryMetricsRegistry()Constructor.
-
-
Method Details
-
getCounterStore
Returns counterStore- Returns:
-
getHistogramStore
Returns the histogramStore.- Returns:
-
createCounter
-
createUpDownCounter
-
createHistogram
-
createGauge
-
createGauge
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-