LatencyMonitor class
Turns a raw latency sample into a NetworkQuality using configurable NetworkQualityThresholds, and keeps a short rolling history for callers that want a smoothed/average view instead of a single noisy sample.
Constructors
- LatencyMonitor({NetworkQualityThresholds thresholds = const NetworkQualityThresholds(), int historySize = 5})
- Creates a LatencyMonitor.
Properties
- averageLatency → Duration?
-
The average of the retained samples, or
nullif none exist yet.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- historySize → int
-
How many recent samples to retain for averageLatency.
final
- 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
-
record(
Duration? latency) → NetworkQuality - Records a new latency sample and returns its NetworkQuality.
-
reset(
) → void - Clears recorded history.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited