public final class BatchMetrics
extends java.lang.Object
Metrics.globalRegistry
with common metrics such as Timer and LongTaskTimer.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
STATUS_FAILURE |
static java.lang.String |
STATUS_SUCCESS |
| Modifier and Type | Method and Description |
|---|---|
static java.time.Duration |
calculateDuration(java.util.Date startTime,
java.util.Date endTime)
Calculate the duration between two dates.
|
static io.micrometer.core.instrument.LongTaskTimer |
createLongTaskTimer(java.lang.String name,
java.lang.String description,
io.micrometer.core.instrument.Tag... tags)
Create a new
LongTaskTimer. |
static io.micrometer.core.instrument.Timer |
createTimer(java.lang.String name,
java.lang.String description,
io.micrometer.core.instrument.Tag... tags)
Create a
Timer. |
static io.micrometer.core.instrument.Timer.Sample |
createTimerSample()
Create a new
Timer.Sample. |
static java.lang.String |
formatDuration(java.time.Duration duration)
Format a duration in a human readable format like: 2h32m15s10ms.
|
public static final java.lang.String STATUS_SUCCESS
public static final java.lang.String STATUS_FAILURE
public static io.micrometer.core.instrument.Timer createTimer(java.lang.String name,
java.lang.String description,
io.micrometer.core.instrument.Tag... tags)
Timer.name - of the timer. Will be prefixed with METRICS_PREFIX.description - of the timertags - of the timerpublic static io.micrometer.core.instrument.Timer.Sample createTimerSample()
Timer.Sample.public static io.micrometer.core.instrument.LongTaskTimer createLongTaskTimer(java.lang.String name,
java.lang.String description,
io.micrometer.core.instrument.Tag... tags)
LongTaskTimer.name - of the long task timer. Will be prefixed with METRICS_PREFIX.description - of the long task timer.tags - of the timer@Nullable
public static java.time.Duration calculateDuration(@Nullable
java.util.Date startTime,
@Nullable
java.util.Date endTime)
startTime - the start timeendTime - the end timepublic static java.lang.String formatDuration(@Nullable
java.time.Duration duration)
duration - to format