org.eclipse.microprofile.fault.tolerance.tck.metrics.util

## Class MetricComparator

- java.lang.Object
- - org.eclipse.microprofile.fault.tolerance.tck.metrics.util.MetricComparator

    public class MetricComparator
    extends Object

### Method Summary

All Methods Static Methods Concrete Methods
`static org.hamcrest.Matcher<Long>` `approxMillis(long originalMillis)` Check that a nanosecond time is within 20% of an expected time in milliseconds
`static org.hamcrest.Matcher<Long>` `lessThanMillis(long originalMillis)` Check that a nanosecond time is less than an expected time in milliseconds

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### approxMillis

    public static org.hamcrest.Matcher<Long> approxMillis(long originalMillis)

Check that a nanosecond time is within 20% of an expected time in milliseconds

Note 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

    public static org.hamcrest.Matcher<Long> lessThanMillis(long originalMillis)

Check that a nanosecond time is less than an expected time in milliseconds

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