snapshot method

An immutable view of the counters and the recent buffer.

Implementation

EventBusErrorSnapshot snapshot() => EventBusErrorSnapshot(
      total: _total,
      suppressed: _suppressed,
      byKind: Map<EventBusErrorKind, int>.unmodifiable(_counts),
      byTopic: Map<String, int>.unmodifiable(_byTopic),
      recent: List<EventBusError>.unmodifiable(_recent),
    );