Class TestInMemoryCounter
java.lang.Object
org.opensearch.test.telemetry.TestInMemoryCounter
- All Implemented Interfaces:
org.opensearch.telemetry.metrics.Counter
This is a simple implementation of Counter which is utilized by TestInMemoryMetricsRegistry for
Unit Tests. It initializes an atomic integer to add the values of counter which doesn't have any tags
along with a map to store the values recorded against the tags.
The map and atomic integer can then be used to get the added values.
-
Constructor Details
-
TestInMemoryCounter
public TestInMemoryCounter()Constructor.
-
-
Method Details
-
getCounterValue
-
getCounterValueForTags
returns the counter value tags- Returns:
-
add
public void add(double value) - Specified by:
addin interfaceorg.opensearch.telemetry.metrics.Counter
-
add
public void add(double value, org.opensearch.telemetry.metrics.tags.Tags tags) - Specified by:
addin interfaceorg.opensearch.telemetry.metrics.Counter
-