InMemoryMetricExporter class

Metric exporter that buffers exported metric snapshots in memory.

Use with OnDemandMetricReader so tests drive collection explicitly — tests rarely want a timer fighting their expect assertions.

Implemented types

Constructors

InMemoryMetricExporter()
Creates an exporter.

Properties

hashCode int
The hash code for this object.
no setterinherited
metrics List<Metric>
All metrics exported since the last clear.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
Clears the recorded metrics. Call between tests.
export(MetricData data) Future<bool>
Export a batch of metrics to the backend.
override
findMetricByName(String name) Metric?
Returns the most-recently exported metric named name, or null if none match.
forceFlush() Future<bool>
Force flush any pending metrics.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shutdown() Future<bool>
Shutdown the exporter.
override
toString() String
A string representation of this object.
inherited

Operators

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