getStatistics method

Map<String, dynamic> getStatistics()

Get peer statistics

Implementation

Map<String, dynamic> getStatistics() {
  return {
    'address': '$address:$port',
    'network': _network.toString(),
    'state': _state.toString(),
    'connected': connected,
    'handshakeComplete': _handshakeComplete,
    'isHealthy': isHealthy,
    'unhealthyScore': _unhealthyScore,
    'connectedAt': _connectedAt?.toIso8601String(),
    'messagesSent': _messagesSent,
    'messagesReceived': _messagesReceived,
    'pingsSent': _pingsSent,
    'pongsReceived': _pongsReceived,
    'handshakeAttempts': _handshakeAttempts,
    'pendingPings': _pendingPings.length,
    'remoteVersion': _remoteVersion?.protocolVersion,
    'remoteUserAgent': _remoteVersion?.userAgent,
  };
}