Class TelemetryHistogramMetric
java.lang.Object
org.eclipse.microprofile.fault.tolerance.tck.telemetryMetrics.util.TelemetryHistogramMetric
Allows tests to get the value of a Histogram, it does not support comparing with a baseline
Most tests should use TelemetryMetricGetter to create instances of this class.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidassertBucketCounts(long... expectedResultsMillis) Assert that the bucket counts of the histogram are consistent with the expected set of recorded results.static intfindBucket(List<Double> boundaries, double value) Given a list of bucket boundaries, find the bucket that the given value falls intoOptional<io.opentelemetry.sdk.metrics.data.HistogramPointData>boolean
-
Field Details
-
EXPECTED_BOUNDARIES
-
-
Constructor Details
-
TelemetryHistogramMetric
-
-
Method Details
-
getHistogramPoint
-
getHistogramCount
-
isPresent
public boolean isPresent() -
assertBoundaries
public void assertBoundaries() -
assertBucketCounts
public void assertBucketCounts(long... expectedResultsMillis) Assert that the bucket counts of the histogram are consistent with the expected set of recorded results.The results are adjusted using
TCKConfig.getTimeoutInMillis(long).A 20% deviation from the expected time is permitted and the upper limit is extended to 200ms. E.g.:
- An expected time of 1000ms will allow a time recorded between 800ms and 1200ms
- An expected time of 0ms will allow a time recorded between 0ms and 200ms
- Parameters:
expectedResultsMillis- the list of values which the histogram is expected to have recorded
-
findBucket
Given a list of bucket boundaries, find the bucket that the given value falls into- Parameters:
boundaries- the list of boundariesvalue- the value to test- Returns:
- the bucket index that should contain
value
-