From 50e9f56ca394288eda3b55e4819c37b28daf4df3 Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 14 Jun 2019 16:12:03 +0100 Subject: [PATCH] Show when a server connected instead of "bytes read/written per second" in stats endpoint --- modules/stats.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/stats.py b/modules/stats.py index 5b497d39..2fe9815c 100644 --- a/modules/stats.py +++ b/modules/stats.py @@ -53,7 +53,6 @@ class Module(ModuleManager.BaseModule): return {"networks": networks, "channels": channels, "users": users} def _server_stats(self, server): - connected_seconds = time.time()-server.socket.connect_time return { "hostname": server.connection_params.hostname, "port": server.connection_params.port, @@ -63,10 +62,8 @@ class Module(ModuleManager.BaseModule): server.nickname, server.username, server.hostname), "users": len(server.users), "bytes-written": server.socket.bytes_written, - "bytes-written-per-second": - server.socket.bytes_written/connected_seconds, "bytes-read": server.socket.bytes_read, - "bytes-read-per-second": server.socket.bytes_read/connected_seconds, + "connected-since": server.socket.connect_time, "channels": { c.name: self._channel_stats(c) for c in server.channels },