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

@@ -10,7 +10,7 @@ class List:
for i in pool.keys():
poolMap.append("Server: %s" % i)
for x in pool[i].keys():
poolMap.append("%s: %s" % (x, pool[i][x]))
poolMap.append(" %s: %s" % (x, pool[i][x]))
poolMap.append("\n")
info("\n".join(poolMap))
return

View File

@@ -13,7 +13,7 @@ class Mod:
return
optionMap = ["Viewing options for %s" % spl[1]]
for i in pool[spl[1]].keys():
optionMap.append("%s: %s" % (i, pool[spl[1]][i]))
optionMap.append(" %s: %s" % (i, pool[spl[1]][i]))
info("\n".join(optionMap))
return

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: