OnDemandMetricReader class

Metric reader for tests. Never fires on a timer; tests drive collect() explicitly via TestHarness.collectMetrics so assertions don't race against a periodic export.

Inheritance

Constructors

OnDemandMetricReader(MetricExporter exporter)
Creates a reader that forwards collected metrics to exporter.

Properties

exporter MetricExporter
The exporter that receives collected metrics.
final
hashCode int
The hash code for this object.
no setterinherited
meterProvider MeterProvider?
Get the MeterProvider this reader is associated with.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

collect() Future<MetricData>
Collect metrics from the MeterProvider.
override
forceFlush() Future<bool>
Force flush metrics through the associated exporter.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerMeterProvider(MeterProvider provider) → void
Register a MeterProvider with this reader.
inherited
shutdown() Future<bool>
Shutdown the metric reader.
override
toString() String
A string representation of this object.
inherited

Operators

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