Timer class

A timer metric which aggregates timing durations and provides duration statistics, plus throughput statistics via Meter.

Implemented types

Constructors

Timer([Reservoir? reservoir, Clock _clock = const Clock()])
Creates a new Timer that uses the given reservoir and clock.

Properties

count int
Returns the number of events which have been marked.
no setteroverride
fifteenMinuteRate double
Returns the fifteen-minute exponentially-weighted moving average rate at which events have occurred since the meter was created.
no setteroverride
fiveMinuteRate double
Returns the five-minute exponentially-weighted moving average rate at which events have occurred since the meter was created.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
meanRate double
Returns the mean rate at which events have occurred since the meter was created.
no setteroverride
oneMinuteRate double
Returns the one-minute exponentially-weighted moving average rate at which events have occurred since the meter was created.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
snapshot Snapshot
A snapshot of the values.
no setteroverride
time TimerContext
Returns a new TimerContext.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
timed<T>(T event()) → T
Times and records the duration of event.
toString() String
A string representation of this object.
inherited
update(Duration duration) → void
Adds a recorded duration.

Operators

operator ==(Object other) bool
The equality operator.
inherited