Added tracking of how many commands have been processed.

This commit is contained in:
Jeremy Fincher 2003-08-29 07:08:03 +00:00
parent 295c5d8411
commit 89a0d12cce
3 changed files with 5 additions and 2 deletions

View File

@ -453,13 +453,14 @@ class FunCommands(callbacks.Privmsg):
'children have taken %s seconds of user time and %s seconds'\ 'children have taken %s seconds of user time and %s seconds'\
' of system time for a total of %s seconds of CPU time. ' \ ' of system time for a total of %s seconds of CPU time. ' \
'I\'ve taken a total of %s%% of this computer\'s time. ' \ 'I\'ve taken a total of %s%% of this computer\'s time. ' \
'Out of %s spawned %s, I have %s active.' %\ 'Out of %s spawned %s, I have %s active. ' \
'I have processed %s commands.' %\
(user, system, user + system, (user, system, user + system,
childUser, childSystem, childUser + childSystem, childUser, childSystem, childUser + childSystem,
(user+system+childUser+childSystem)/timeRunning, (user+system+childUser+childSystem)/timeRunning,
world.threadsSpawned, world.threadsSpawned,
world.threadsSpawned == 1 and 'thread' or 'threads', world.threadsSpawned == 1 and 'thread' or 'threads',
threads) threads, world.commandsProcessed)
irc.reply(msg, response) irc.reply(msg, response)
def uptime(self, irc, msg, args): def uptime(self, irc, msg, args):

View File

@ -263,6 +263,7 @@ class IrcObjectProxy:
self.args = args self.args = args
self.counter = 0 self.counter = 0
self.finalEvaled = False self.finalEvaled = False
world.commandsProcessed += 1
self.evalArgs() self.evalArgs()
def findCallback(self, commandName): def findCallback(self, commandName):

View File

@ -50,6 +50,7 @@ import debug
startedAt = 0.0 startedAt = 0.0
threadsSpawned = 0 threadsSpawned = 0
commandsProcessed = 0
### ###
# End Global Values. # End Global Values.
### ###