mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-29 21:54:22 +01:00
Added world.threadsSpawned, logging of the number of threads spawned, and added the information to cpustats.
This commit is contained in:
parent
cc61041491
commit
80e4dfbe63
@ -330,11 +330,13 @@ class FunCommands(callbacks.Privmsg):
|
||||
'children have taken %s seconds of user time and %s seconds'\
|
||||
' 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 currently have %s active %s.' %\
|
||||
'Out of %s spawned %s, I have %s active.' %\
|
||||
(user, system, user + system,
|
||||
childUser, childSystem, childUser + childSystem,
|
||||
(user+system+childUser+childSystem)/timeRunning,
|
||||
threads, threads == 1 and 'thread' or 'threads')
|
||||
world.threadsSpawned,
|
||||
world.threadsSpawned == 1 and 'thread' or 'threads',
|
||||
threads)
|
||||
irc.reply(msg, response)
|
||||
|
||||
def uptime(self, irc, msg, args):
|
||||
|
@ -300,6 +300,7 @@ class IrcObjectProxy:
|
||||
class CommandThread(threading.Thread):
|
||||
def __init__(self, command, irc, msg, args):
|
||||
self.command = command
|
||||
world.threadsSpawned += 1
|
||||
self.commandName = command.im_func.func_name
|
||||
self.className = command.im_class.__name__
|
||||
name = '%s.%s with args %r' % (self.className, self.commandName, args)
|
||||
|
@ -52,6 +52,7 @@ version = '0.70.0'
|
||||
|
||||
startedAt = 0.0
|
||||
|
||||
threadsSpawned = 0
|
||||
###
|
||||
# End Global Values.
|
||||
###
|
||||
|
Loading…
Reference in New Issue
Block a user