CachedCounters class abstract
Abstract implementation of performance counters that measures and stores counters in memory. Child classes implement saving of the counters into various destinations.
Configuration parameters
options
:interval
: interval in milliseconds to save current counters measurements (default: 5 mins)reset_timeout
: timeout in milliseconds to reset the counters. 0 disables the reset (default: 0)
- Implemented types
- Implementers
Constructors
- CachedCounters()
- Creates a new CachedCounters object.
Properties
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
Methods
-
beginTiming(
String name) → CounterTiming -
Begins measurement of execution time interval.
It returns CounterTiming object which has to be called at
CounterTiming.endTiming to end the measurement and update the counter.
override
-
clear(
String name) → void - Clears (resets) a counter specified by its name.
-
clearAll(
) → void - Clears (resets) all counters.
-
configure(
ConfigParams config) → void - Configures component by passing configuration parameters.
-
dump(
) → void - Dumps (saves) the current values of counters.
-
endTiming(
String? name, int elapsed) → void -
Ends measurement of execution elapsed time and updates specified counter.
override
-
get(
String? name, CounterType type) → Counter - Gets a counter specified by its name. It counter does not exist or its type doesn't match the specified type it creates a new one.
-
getAll(
) → List< Counter> - Gets all captured counters.
-
getInterval(
) → int - Gets the counters dump/save interval.
-
increment(
String name, int value) → void -
Increments counter by given value.
override
-
incrementOne(
String name) → void -
Increments counter by 1.
override
-
last(
String name, int value) → void -
Records the last calculated measurement value.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
save(
List< Counter> counters) → void - Saves the current counters measurements.
-
setInterval(
int value) → void - Sets the counters dump/save interval.
-
stats(
String name, int value) → void -
Calculates min/average/max statistics based on the current and previous values.
override
-
timestamp(
String name, DateTime value) → void -
Records the given timestamp.
override
-
timestampNow(
String name) → void -
Records the current time as a timestamp.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited