diff --git a/plugins/Stats/StatsPlugin.py b/plugins/Stats/StatsPlugin.py index 6957e76b..27719417 100644 --- a/plugins/Stats/StatsPlugin.py +++ b/plugins/Stats/StatsPlugin.py @@ -97,12 +97,16 @@ class UiRequestPlugin(object): ) yield "" yield "" - yield "" + yield "" for connection in main.file_server.connections: if "cipher" in dir(connection.sock): cipher = connection.sock.cipher()[0] else: cipher = connection.crypt + if "time" in connection.handshake and connection.last_ping_delay: + time_correction = connection.handshake["time"] - connection.handshake_time - connection.last_ping_delay + else: + time_correction = 0.0 yield self.formatTableRow([ ("%3d", connection.id), ("%s", connection.type), @@ -114,13 +118,14 @@ class UiRequestPlugin(object): ("%s", connection.bad_actions), ("since", max(connection.last_send_time, connection.last_recv_time)), ("since", connection.start_time), - ("%.3f", connection.last_sent_time - connection.last_send_time), + ("%.3f", max(-1, connection.last_sent_time - connection.last_send_time)), ("%.3f", connection.cpu_time), ("%.0fkB", connection.bytes_sent / 1024), ("%.0fkB", connection.bytes_recv / 1024), ("%s", (connection.last_cmd_recv, connection.last_cmd_sent)), ("%s", connection.waiting_requests.keys()), ("%s r%s", (connection.handshake.get("version"), connection.handshake.get("rev", "?"))), + ("%.2fs", time_correction), ("%s", connection.sites) ]) yield "
id type ip open crypt pingbuff bad idle open delay cpu out in last sentwait version sites
wait version time sites
"