mirror of
https://github.com/LBRYFoundation/lbry-sdk.git
synced 2025-10-02 16:20:33 +00:00
mbps instead of mbs, remove time from connection status
This commit is contained in:
parent
347415dceb
commit
a90919a9ba
2 changed files with 8 additions and 10 deletions
|
@ -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):
|
||||||
|
|
|
@ -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': {
|
||||||
|
|
Loading…
Add table
Reference in a new issue