A Timer is used to measure how long (in seconds) some event is taking. Timer measurements are typically short, less than 1 minute.
A selection of specialized timers include:
LongTaskTimer- Periodically reports the time taken for a long running task (> 1 minute). See the Long Task Timer pattern for details.
PercentileTimer- Useful if percentile approximations are needed in addition to basic stats. See the Percentile Timer pattern for details.
Timers report summarized statistics about the measurements for a time window
totalOfSquares. If you were to simply query for
the name of your timer via
you would get a nonsense value that is the sum of the reported statistics.
When querying the results of a timer, use one of the operators below to generate a useful response.
Average Measurement (:dist-avg)¶
To compute the average latency across an arbitrary group, use the :dist-avg function:
Maximum Measurement (:dist-max)¶
To compute the maximum latency across a group, use :dist-max:
Standard Deviation of Measurement (:dist-stddev)¶
To compute the standard deviation of measurements across all instances for a time interval:
nnf.cluster,foo,:eq, name,http.req.latency,:eq, :and, :dist-stddev
Note that it is possible to plot the individual statics by filtering on the
If you choose to do so, note that the
totalOfSquares are counters
thus reported as rates per second, while the
max is reported as a gauge.