Implement counting of various IRC events

This commit is contained in:
2018-02-24 12:42:27 +00:00
parent 378c4d9bba
commit 8dec0b6828
8 changed files with 71 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
from core.main import *
import modules.counters as count
class Stats:
def __init__(self, register):
@@ -17,6 +18,13 @@ class Stats:
stats.append("Servers: %s" % len(IRCPool.keys()))
stats.append("Channels: %s" % numChannels)
stats.append("User records: %s" % numWhoEntries)
counterEvents = count.getEvents()
if counterEvents == None:
stats.append("No counters records")
else:
stats.append("Counters:")
for i in counterEvents.keys():
stats.append(" %s: %s" % (i, counterEvents[i]))
info("\n".join(stats))
return
@@ -41,6 +49,13 @@ class Stats:
return
stats.append("Channels: %s" % numChannels)
stats.append("User records: %s" % numWhoEntries)
counterEvents = count.getEvents(spl[1])
if counterEvents == None:
stats.append("No counters records")
else:
stats.append("Counters:")
for i in counterEvents.keys():
stats.append(" %s: %s" % (i, counterEvents[i]))
info("\n".join(stats))
return
else: