Class DefaultLongTaskTimer

java.lang.Object
io.micrometer.core.instrument.AbstractMeter
io.micrometer.core.instrument.internal.DefaultLongTaskTimer
All Implemented Interfaces:
HistogramSupport, LongTaskTimer, Meter
Direct Known Subclasses:
CumulativeHistogramLongTaskTimer

public class DefaultLongTaskTimer
extends AbstractMeter
implements LongTaskTimer
  • Constructor Details

  • Method Details

    • start

      public LongTaskTimer.Sample start()
      Description copied from interface: LongTaskTimer
      Start keeping time for a task.
      Specified by:
      start in interface LongTaskTimer
      Returns:
      A task id that can be used to look up how long the task has been running.
    • duration

      public double duration​(java.util.concurrent.TimeUnit unit)
      Specified by:
      duration in interface LongTaskTimer
      Parameters:
      unit - The time unit to scale the duration to.
      Returns:
      The cumulative duration of all current tasks.
    • max

      public double max​(java.util.concurrent.TimeUnit unit)
      Description copied from interface: LongTaskTimer
      The amount of time the longest running task has been running
      Specified by:
      max in interface LongTaskTimer
      Parameters:
      unit - The time unit to scale the max to.
      Returns:
      The maximum active task duration.
    • activeTasks

      public int activeTasks()
      Specified by:
      activeTasks in interface LongTaskTimer
      Returns:
      The current number of tasks being executed.
    • forEachActive

      protected void forEachActive​(java.util.function.Consumer<LongTaskTimer.Sample> sample)
    • baseTimeUnit

      public java.util.concurrent.TimeUnit baseTimeUnit()
      Specified by:
      baseTimeUnit in interface LongTaskTimer
      Returns:
      The base time unit of the long task timer to which all published metrics will be scaled
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • takeSnapshot

      public HistogramSnapshot takeSnapshot()
      Description copied from interface: HistogramSupport
      Summary statistics should be published off of a single snapshot instance so that, for example, there isn't disagreement between the distribution's bucket counts because more events continue to stream in.
      Specified by:
      takeSnapshot in interface HistogramSupport
      Returns:
      A snapshot of all distribution statistics at a point in time.