diff options
| author | 2019-05-24 17:32:59 +0100 | |
|---|---|---|
| committer | 2019-05-24 17:32:59 +0100 | |
| commit | a3a2c1e5a471b425d971dfb776ba324266b2881b (patch) | |
| tree | 024160815549a2decbbe5edb0d96bffa58258ced /modules/stats.py | |
| parent | Bump version to v1.7.1 (diff) | |
| signature | ||
Store IRCSocket connect_time, show bytes read/write per second in stats.py
Diffstat (limited to 'modules/stats.py')
| -rw-r--r-- | modules/stats.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/stats.py b/modules/stats.py index d25f6914..e8f1ea5b 100644 --- a/modules/stats.py +++ b/modules/stats.py @@ -49,6 +49,7 @@ class Module(ModuleManager.BaseModule): return {"networks": networks, "channels": channels, "users": users} def _server_stats(self, server): + connected_seconds = time.time()-server.connect_time return { "hostname": server.connection_params.hostname, "port": server.connection_params.port, @@ -58,7 +59,10 @@ 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, "channels": { c.name: self._channel_stats(c) for c in server.channels }, |
