Implement counting of various IRC events
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user