ZenMetrics class

Performance and usage metrics for Zenify.

All recording methods are no-ops unless ZenConfig.enablePerformanceMetrics is true. Read metrics via getReport or individual counter accessors.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

activeControllers int
Controller lifecycle counters
getter/setter pair
controllerCreationCount Map<String, int>
getter/setter pair
totalControllersCreated int
getter/setter pair
totalControllersDisposed int
getter/setter pair

Static Methods

getAverageDuration(String operation) Duration?
Get the average duration recorded for operation, or null if no samples.
getReport() Map<String, dynamic>
Return a full snapshot of all recorded metrics.
incrementCounter(String name) → void
Increment a named event counter.
recordControllerCreation(Type controllerType) → void
Record controller creation.
recordControllerDisposal(Type controllerType) → void
Record controller disposal.
recordCounterValue(String name, int value) → void
Set a named counter to a specific value.
reset() → void
Reset all metrics to zero.
startPeriodicLogging(Duration interval) → void
Log a getReport snapshot on interval until stopPeriodicLogging is called.
startTiming(String operation) → void
Begin timing an operation. Call stopTiming to record the sample.
stopPeriodicLogging() → void
Stop periodic metric logging started by startPeriodicLogging.
stopTiming(String operation) → void
Stop timing an operation and record the elapsed duration.