EventBusErrorMonitor class
An aggregator over the error streams of several buses.
It is not a static global: tests and applications keep their own monitor,
so several applications in one process do not share state. filter runs
before counting; the per-second maxErrorsPerSecond limit protects a
dashboard from a storm coming from many buses at once, while each bus keeps
its own per-(kind, address) limit.
Constructors
- EventBusErrorMonitor({EventBusErrorFilter? filter, int recentLimit = 100, int? maxErrorsPerSecond = 200})
Properties
-
counts
→ Map<
EventBusErrorKind, int> -
Counts by kind since resetCounters or construction.
no setter
-
errors
→ Stream<
EventBusError> -
Merged errors of every registered bus.
no setter
- filter → EventBusErrorFilter?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxErrorsPerSecond → int?
-
The monitor-wide limit; null means unlimited.
final
-
recentErrors
→ List<
EventBusError> -
The most recent errors, up to recentLimit.
no setter
- recentLimit → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- suppressed → int
-
Errors dropped by the monitor-wide rate limit.
no setter
Methods
-
add(
EventBus bus) → bool -
Starts observing
bus. Returns false when it is already observed. -
dispose(
) → Future< void> - Stops observing every bus and closes the merged stream.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
EventBus bus) → bool -
Stops observing
bus. Returns false when it was not observed. -
resetCounters(
) → void - Clears the counters (including suppressed); recentErrors is kept.
-
snapshot(
) → EventBusErrorSnapshot - An immutable view of the counters and the recent buffer.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited