Exemplo n.º 1
0
 def connectionStats(self) -> ConnectionStats:
     """
     Get statistics about the connection.
     """
     assert self.isReady(), 'Not connected'
     return ConnectionStats(self._startTime,
                            time.time() - self._startTime,
                            self._numBytesRecv, self.conn.numBytesSent,
                            self._numMsgRecv, self.conn.numMsgSent)
Exemplo n.º 2
0
 def connectionStats(self) -> ConnectionStats:
     """
     Get statistics about the connection.
     """
     if not self.isReady():
         raise ConnectionError('Not connected')
     return ConnectionStats(self._startTime,
                            time.time() - self._startTime,
                            self._numBytesRecv, self.conn.numBytesSent,
                            self._numMsgRecv, self.conn.numMsgSent)