java.lang.Object
org.eclipse.microprofile.fault.tolerance.tck.metrics.common.util.TimeUtils

public class TimeUtils extends Object
  • Method Details

    • 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