exportChannel method

  1. @override
void exportChannel(
  1. String id,
  2. ChannelSnapshot s
)
override

Implementation

@override
void exportChannel(String id, ChannelSnapshot s) {
  final idW = (width >= 140) ? 40 : (width >= 120 ? 30 : 20);
  final numW = 11, pairW = 18, latW = 10, rateW = 12;

  final cells = <String>[
    _cyan(_padR(_truncMid(id, idW), idW), useColor),
    _padL(_fmtInt(s.sent), numW),
    _padL(_fmtInt(s.recv), numW),
    if (_showTry) _padL(_fmtPair(s.trySendOk, s.trySendFail), pairW),
    if (_showTry) _padL(_fmtPair(s.tryRecvOk, s.tryRecvEmpty), pairW),
    _yellow(_padL(_fmtLatency(s.sendP50), latW), useColor),
    if (!compact) ...[
      _padL(_fmtLatency(s.sendP95), latW),
      _padL(_fmtLatency(s.sendP99), latW),
    ],
    _yellow(_padL(_fmtLatency(s.recvP50), latW), useColor),
    if (!compact) ...[
      _padL(_fmtLatency(s.recvP95), latW),
      _padL(_fmtLatency(s.recvP99), latW),
    ],
    _padL(
        s.recvOpsPerSec == 0
            ? '–'
            : '${_fmtFixed(s.recvOpsPerSec / 1e6, 2)} M',
        rateW),
    _padL(s.nsByOp == 0 ? '–' : _fmtFixed(s.nsByOp, 1), rateW),
  ];

  print(cells.join('  '));
}