Class Timer.DefaultSample

java.lang.Object
de.iip_ecosphere.platform.support.metrics.Timer.DefaultSample
All Implemented Interfaces:
Timer.Sample
Enclosing interface:
Timer

public static class Timer.DefaultSample extends Object implements Timer.Sample
Default implementation of Timer.Sample based on micrometer.
Author:
Holger Eichelberger, SSE
  • Field Details

    • startTime

      private final long startTime
    • clock

      private final Clock clock
  • Constructor Details

    • DefaultSample

      DefaultSample(Clock clock)
      Creates an instance.
      Parameters:
      clock - the clock when the sample starts
  • Method Details

    • stop

      public long stop(Timer timer)
      Description copied from interface: Timer.Sample
      Records the duration of the operation.
      Specified by:
      stop in interface Timer.Sample
      Parameters:
      timer - The timer to record the sample to.
      Returns:
      The total duration of the sample in nanoseconds