Show connection cpu time on stats page

This commit is contained in:
shortcutme 2016-11-07 23:00:17 +01:00
parent 55417a1103
commit 51c3ae15e8

View file

@ -92,7 +92,7 @@ class UiRequestPlugin(object):
len(main.file_server.connections), main.file_server.last_connection_id
)
yield "<table><tr> <th>id</th> <th>proto</th> <th>type</th> <th>ip</th> <th>open</th> <th>crypt</th> <th>ping</th>"
yield "<th>buff</th> <th>bad</th> <th>idle</th> <th>open</th> <th>delay</th> <th>out</th> <th>in</th> <th>last sent</th>"
yield "<th>buff</th> <th>bad</th> <th>idle</th> <th>open</th> <th>delay</th> <th>cpu</th> <th>out</th> <th>in</th> <th>last sent</th>"
yield "<th>waiting</th> <th>version</th> <th>sites</th> </tr>"
for connection in main.file_server.connections:
if "cipher" in dir(connection.sock):
@ -112,6 +112,7 @@ class UiRequestPlugin(object):
("since", max(connection.last_send_time, connection.last_recv_time)),
("since", connection.start_time),
("%.3f", connection.last_sent_time - connection.last_send_time),
("%.3fs", connection.cpu_time),
("%.0fkB", connection.bytes_sent / 1024),
("%.0fkB", connection.bytes_recv / 1024),
("%s", connection.last_cmd),