Class DropwizardTypes.DescribableTimer
- java.lang.Object
-
- com.codahale.metrics.Timer
-
- org.forgerock.monitoring.dropwizard.DropwizardTypes.DescribableTimer
-
- All Implemented Interfaces:
com.codahale.metrics.Counting
,com.codahale.metrics.Metered
,com.codahale.metrics.Metric
,com.codahale.metrics.Sampling
,Meter
,Timer
,DropwizardTypes.DescribableMetric
- Enclosing class:
- DropwizardTypes
public static final class DropwizardTypes.DescribableTimer extends com.codahale.metrics.Timer implements DropwizardTypes.DescribableMetric, Timer
A describable timer, implementing both the dropwizard's and the monitoring-api's relevant APIs.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.codahale.metrics.Timer
com.codahale.metrics.Timer.Context
-
Nested classes/interfaces inherited from interface org.forgerock.monitoring.api.instrument.Meter
Meter.Id, Meter.Type
-
Nested classes/interfaces inherited from interface org.forgerock.monitoring.api.instrument.Timer
Timer.Builder, Timer.Sample
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TimeUnit
baseTimeUnit()
long
count()
The number of times that stop has been called on this timer.Meter.Id
getId()
Returns A unique combination of name and tags identifying this metric.double
histogramCountAtValue(long valueNanos)
double
max(TimeUnit unit)
The maximum time of a single event.double
percentile(double percentile, TimeUnit unit)
The latency at a specific percentile.void
record(long amount, TimeUnit unit)
Updates the statistics kept by the counter with the specified amount.void
record(Runnable f)
Executes the runnable `f` and records the time taken.<T> T
record(Supplier<T> f)
Executes the Supplier `f` and records the time taken.<T> T
recordCallable(Callable<T> f)
Executes the callable `f` and records the time taken.HistogramSnapshot
takeSnapshot(boolean supportsAggregablePercentiles)
String
toString()
double
totalTime(TimeUnit unit)
The total time of recorded events.-
Methods inherited from class com.codahale.metrics.Timer
getCount, getFifteenMinuteRate, getFiveMinuteRate, getMeanRate, getOneMinuteRate, getSnapshot, time, time, time, update
-
-
-
-
Method Detail
-
getId
public Meter.Id getId()
Description copied from interface:DropwizardTypes.DescribableMetric
Returns A unique combination of name and tags identifying this metric.- Specified by:
getId
in interfaceDropwizardTypes.DescribableMetric
- Specified by:
getId
in interfaceMeter
- Returns:
- A unique combination of name and tags identifying this metric
-
record
public void record(long amount, TimeUnit unit)
Description copied from interface:Timer
Updates the statistics kept by the counter with the specified amount.
-
record
public <T> T record(Supplier<T> f)
Description copied from interface:Timer
Executes the Supplier `f` and records the time taken.
-
recordCallable
public <T> T recordCallable(Callable<T> f) throws Exception
Description copied from interface:Timer
Executes the callable `f` and records the time taken.- Specified by:
recordCallable
in interfaceTimer
- Parameters:
f
- Function to execute and measure the execution time.- Returns:
- The return value of `f`.
- Throws:
Exception
-
record
public void record(Runnable f)
Description copied from interface:Timer
Executes the runnable `f` and records the time taken.
-
count
public long count()
Description copied from interface:Timer
The number of times that stop has been called on this timer.
-
totalTime
public double totalTime(TimeUnit unit)
Description copied from interface:Timer
The total time of recorded events.
-
max
public double max(TimeUnit unit)
Description copied from interface:Timer
The maximum time of a single event.
-
percentile
public double percentile(double percentile, TimeUnit unit)
Description copied from interface:Timer
The latency at a specific percentile. This value is non-aggregable across dimensions.- Specified by:
percentile
in interfaceTimer
-
histogramCountAtValue
public double histogramCountAtValue(long valueNanos)
- Specified by:
histogramCountAtValue
in interfaceTimer
-
takeSnapshot
public HistogramSnapshot takeSnapshot(boolean supportsAggregablePercentiles)
- Specified by:
takeSnapshot
in interfaceTimer
-
baseTimeUnit
public TimeUnit baseTimeUnit()
- Specified by:
baseTimeUnit
in interfaceTimer
-
-