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
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micrometer.core.instrument.LongTaskTimer
LongTaskTimer.Builder, LongTaskTimer.Sample
Nested classes/interfaces inherited from interface io.micrometer.core.instrument.Meter
Meter.Builder, Meter.Id, Meter.MeterProvider<T extends Meter>, Meter.Type
-
Constructor Summary
ConstructorDescriptionDefaultLongTaskTimer
(Meter.Id id, Clock clock) Deprecated.DefaultLongTaskTimer
(Meter.Id id, Clock clock, TimeUnit baseTimeUnit, DistributionStatisticConfig distributionStatisticConfig, boolean supportsAggregablePercentiles) Create aDefaultLongTaskTimer
instance. -
Method Summary
Modifier and TypeMethodDescriptionint
double
protected void
forEachActive
(Consumer<LongTaskTimer.Sample> sample) double
The amount of time the longest running task has been runningstart()
Start keeping time for a task.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.Methods inherited from class io.micrometer.core.instrument.AbstractMeter
equals, getId, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micrometer.core.instrument.distribution.HistogramSupport
takeSnapshot
-
Constructor Details
-
DefaultLongTaskTimer
Deprecated.Create aDefaultLongTaskTimer
instance.- Parameters:
id
- IDclock
- clock
-
DefaultLongTaskTimer
public DefaultLongTaskTimer(Meter.Id id, Clock clock, TimeUnit baseTimeUnit, DistributionStatisticConfig distributionStatisticConfig, boolean supportsAggregablePercentiles) Create aDefaultLongTaskTimer
instance.- Parameters:
id
- IDclock
- clockbaseTimeUnit
- base time unitdistributionStatisticConfig
- distribution statistic configurationsupportsAggregablePercentiles
- whether it supports aggregable percentiles- Since:
- 1.5.0
-
-
Method Details
-
start
Description copied from interface:LongTaskTimer
Start keeping time for a task.- Specified by:
start
in interfaceLongTaskTimer
- Returns:
- A task id that can be used to look up how long the task has been running.
-
duration
- Specified by:
duration
in interfaceLongTaskTimer
- Parameters:
unit
- The time unit to scale the duration to.- Returns:
- The cumulative duration of all current tasks.
-
max
Description copied from interface:LongTaskTimer
The amount of time the longest running task has been running- Specified by:
max
in interfaceLongTaskTimer
- Parameters:
unit
- The time unit to scale the max to.- Returns:
- The maximum active task duration.
-
activeTasks
public int activeTasks()- Specified by:
activeTasks
in interfaceLongTaskTimer
- Returns:
- The current number of tasks being executed.
-
forEachActive
-
baseTimeUnit
- Specified by:
baseTimeUnit
in interfaceLongTaskTimer
- Returns:
- The base time unit of the long task timer to which all published metrics will be scaled
-
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 interfaceHistogramSupport
- Returns:
- A snapshot of all distribution statistics at a point in time.
-
DefaultLongTaskTimer(Meter.Id, Clock, TimeUnit, DistributionStatisticConfig, boolean)
instead.