mbps instead of mbs, remove time from connection status

This commit is contained in:
Jack Robison 2019-06-04 19:35:34 -04:00
parent 347415dceb
commit a90919a9ba
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
2 changed files with 8 additions and 10 deletions

View file

@ -52,9 +52,8 @@ class ConnectionManager:
self._status = { self._status = {
'incoming_bps': {}, 'incoming_bps': {},
'outgoing_bps': {}, 'outgoing_bps': {},
'total_incoming_mbs': 0.0, 'total_incoming_mbps': 0.0,
'total_outgoing_mbs': 0.0, 'total_outgoing_mbps': 0.0,
'time': self.loop.time()
} }
while True: while True:
@ -69,10 +68,10 @@ class ConnectionManager:
k, v = self.incoming.popitem() k, v = self.incoming.popitem()
self._status['incoming_bps'][k] = v self._status['incoming_bps'][k] = v
now = self.loop.time() now = self.loop.time()
self._status['total_outgoing_mbs'] = int(sum(list(self._status['outgoing_bps'].values()) self._status['total_outgoing_mbps'] = int(sum(list(self._status['outgoing_bps'].values()))
) / (now - last)) / 1000000.0 / (now - last)) / 1000000.0
self._status['total_incoming_mbs'] = int(sum(list(self._status['incoming_bps'].values()) self._status['total_incoming_mbps'] = int(sum(list(self._status['incoming_bps'].values()))
) / (now - last)) / 1000000.0 / (now - last)) / 1000000.0
self._status['time'] = now self._status['time'] = now
def stop(self): def stop(self):

View file

@ -747,9 +747,8 @@ class Daemon(metaclass=JSONRPCServerType):
'outgoing_bps': { 'outgoing_bps': {
<destination ip and tcp port>: (int) bytes per second sent, <destination ip and tcp port>: (int) bytes per second sent,
}, },
'total_outgoing_mps': (float) megabytes per second sent, 'total_outgoing_mbps': (float) megabytes per second sent,
'total_incoming_mps': (float) megabytes per second received, 'total_incoming_mbps': (float) megabytes per second received
'time': (float) timestamp
} }
}, },
'hash_announcer': { 'hash_announcer': {