merge method

Implementation

ChannelSnapshot merge(ChannelSnapshot other) {
  return ChannelSnapshot(
    sent: sent + other.sent,
    recv: recv + other.recv,
    dropped: dropped + other.dropped,
    closed: closed + other.closed,
    trySendOk: trySendOk + other.trySendOk,
    trySendFail: trySendFail + other.trySendFail,
    tryRecvOk: tryRecvOk + other.tryRecvOk,
    tryRecvEmpty: tryRecvEmpty + other.tryRecvEmpty,
    sendP50: _pick(sendP50, other.sendP50),
    sendP95: _pick(sendP95, other.sendP95),
    sendP99: _pick(sendP99, other.sendP99),
    recvP50: _pick(recvP50, other.recvP50),
    recvP95: _pick(recvP95, other.recvP95),
    recvP99: _pick(recvP99, other.recvP99),
    recvFirstNs: _min(recvFirstNs, other.recvFirstNs),
    recvLastNs: _max(recvLastNs, other.recvLastNs),
    sendFirstNs: _min(sendFirstNs, other.sendFirstNs),
    sendLastNs: _max(sendLastNs, other.sendLastNs),
  );
}