Class TimeUtils
java.lang.Object
org.eclipse.microprofile.fault.tolerance.tck.metrics.common.util.TimeUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.hamcrest.Matcher<Long>
approxMillis
(long originalMillis) Check that a nanosecond time is within 20% of an expected time in millisecondsstatic org.hamcrest.Matcher<Long>
lessThanMillis
(long originalMillis) Check that a nanosecond time is less than an expected time in milliseconds
-
Method Details
-
approxMillis
Check that a nanosecond time is within 20% of an expected time in millisecondsNote that this method applies any timeout scaling configured in TCKConfig, does the millseconds to nanoseconds conversion and creates a
Matcher
to do the check.Useful for checking the results from Histograms.
- Parameters:
originalMillis
- the expected time in milliseconds- Returns:
- a
Matcher
which matches against a time in nanoseconds
-
lessThanMillis
Check that a nanosecond time is less than an expected time in millisecondsThis method applies any timeout scaling configured in TCKConfig, does the millseconds to nanoseconds conversion and creates a
Matcher
to do the check.Useful for checking the results from Histograms.
- Parameters:
originalMillis
- the expected time in milliseconds- Returns:
- a
Matcher
which matches against a time in nanoseconds
-