From 9484a278017049d8e6085c67dd07c6b828b77ef6 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Fri, 13 Oct 2017 01:17:27 +0200 Subject: [PATCH] Sent and Received command statistics --- plugins/Stats/StatsPlugin.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugins/Stats/StatsPlugin.py b/plugins/Stats/StatsPlugin.py index 2908f464..0dfdfd10 100644 --- a/plugins/Stats/StatsPlugin.py +++ b/plugins/Stats/StatsPlugin.py @@ -196,6 +196,24 @@ class UiRequestPlugin(object): yield "" yield "" + # Cmd stats + yield "
" + yield "

Sent commands:
" + yield "" + for stat_key, stat in sorted(main.file_server.stat_sent.items(), lambda a, b: cmp(a[1]["bytes"], b[1]["bytes"]), reverse=True): + yield "" % (stat_key, stat["num"], stat["bytes"] / 1024) + yield "
%sx %s =%.0fkB
" + yield "
" + + yield "
" + yield "

Received commands:
" + yield "" + for stat_key, stat in sorted(main.file_server.stat_recv.items(), lambda a, b: cmp(a[1]["bytes"], b[1]["bytes"]), reverse=True): + yield "" % (stat_key, stat["num"], stat["bytes"] / 1024) + yield "
%sx %s =%.0fkB
" + yield "
" + yield "
" + # No more if not in debug mode if not config.debug: raise StopIteration