Skip to content
This repository was archived by the owner on Feb 21, 2018. It is now read-only.

Commit 4311885

Browse files
committed
bot/memusage: show channel client count
1 parent 2b95129 commit 4311885

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

modules/bot/memusage.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ def rehash():
2020
def cmdMEM(cod, line, splitline, source, destination):
2121
"Shows memory usage statistics for curious opers"
2222

23-
return mem() + ", %d clients, %d channels, %s modules" %\
24-
(len(cod.clients), len(cod.channels), len(cod.modules))
23+
chanclientcount = 0
24+
25+
for channel in cod.channels.itervalues():
26+
chanclientcount += len(channel.clients)
27+
28+
return mem() + ", %d clients, %d channels, %s modules, %s channel clients" %\
29+
(len(cod.clients), len(cod.channels), len(cod.modules), chanclientcount)
2530

2631
def mem():
2732
status_file = open("/proc/%d/status" % os.getpid()).read()

0 commit comments

Comments
 (0)