Class TelemetryCounterMetric
java.lang.Object
org.eclipse.microprofile.fault.tolerance.tck.telemetryMetrics.util.TelemetryCounterMetric
Allows tests to get the value of a counter and compare it with a baseline.
Most methods on this class will treat a non-existent counter as having a value of zero to allow implementations to lazily create metrics.
Most tests should use TelemetryMetricGetter
to create instances of this class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
baseline()
Capture the current counter value for later comparison withdelta()
long
delta()
Return the difference between the current value of the metric and the value whenbaseline
was called.long
value()
Get the counter value, or zero if the metric doesn't exist
-
Constructor Details
-
TelemetryCounterMetric
-
-
Method Details
-
value
public long value()Get the counter value, or zero if the metric doesn't existThis method will not create the metric if it does not exist.
- Parameters:
startTime
- a start time as a unix epoch, all metrics from before this time will be ignoredendTime
- a end time as a unix epoch, all metrics from after this time will be ignored- Returns:
- the counter value, or zero if the metric doesn't exist
-
baseline
public void baseline()Capture the current counter value for later comparison withdelta()
This method will not create the metric if it does not exist.
-
delta
public long delta()Return the difference between the current value of the metric and the value whenbaseline
was called.- Returns:
- the difference between the metric value and the baseline
-