snapshot method
Implementation
GlobalMetrics snapshot() {
final snaps = <String, ChannelSnapshot>{};
_map.forEach((id, m) {
snaps[id] = ChannelSnapshot(
sent: m.sent,
recv: m.recv,
dropped: m.dropped,
closed: m.closed,
trySendOk: m.trySendOk,
trySendFail: m.trySendFail,
tryRecvOk: m.tryRecvOk,
tryRecvEmpty: m.tryRecvEmpty,
sendP50: m.sendLatency.p50,
sendP95: m.sendLatency.p95,
sendP99: m.sendLatency.p99,
recvP50: m.recvLatency.p50,
recvP95: m.recvLatency.p95,
recvP99: m.recvLatency.p99,
recvFirstNs: m.recvFirstNs,
recvLastNs: m.recvLastNs,
sendFirstNs: m.sendFirstNs,
sendLastNs: m.sendLastNs,
);
});
return GlobalMetrics(DateTime.now(), snaps);
}