mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Fixed problems with cpustats on Windows; at least now an error is reported.
This commit is contained in:
parent
c40f5e6c59
commit
b6185c4b33
@ -164,7 +164,13 @@ class Status(callbacks.Privmsg):
|
||||
Returns some interesting CPU-related statistics on the bot.
|
||||
"""
|
||||
(user, system, childUser, childSystem, elapsed) = os.times()
|
||||
timeRunning = time.time() - world.startedAt
|
||||
now = time.time()
|
||||
timeRunning = now - world.startedAt
|
||||
if user+system > timeRunning:
|
||||
irc.error(msg, 'I seem to be running on a platform without an '
|
||||
'accurate way of determining how long I\'ve been '
|
||||
'running.')
|
||||
return
|
||||
activeThreads = threading.activeCount()
|
||||
response = 'I have taken %s seconds of user time and %s seconds of '\
|
||||
'system time, for a total of %s seconds of CPU time. My '\
|
||||
|
@ -45,7 +45,6 @@ class StatusTestCase(PluginTestCase, PluginDocumentation):
|
||||
self.assertNotError('netstats')
|
||||
|
||||
def testCpustats(self):
|
||||
self.assertNotError('cpustats')
|
||||
try:
|
||||
original = world.startedAt
|
||||
world.startedAt = time.time()
|
||||
|
Loading…
Reference in New Issue
Block a user