1
0
Fork 0
mirror of synced 2024-05-06 21:52:30 +12:00

Fix cpu count (Python has GIL, cannot use more than one CPU)

This commit is contained in:
Dan Hess 2020-07-14 14:14:53 -05:00
parent 4e56078361
commit fe41c1a651

View file

@ -38,7 +38,7 @@ def _command_signature(cmd):
return ' '.join(result)
class Miscallaneous(commands.Cog):
class Miscellaneous(commands.Cog):
"""Core commands, these are the miscallaneous commands that don't fit into other categories'"""
process = psutil.Process()
process.cpu_percent()
@ -236,7 +236,7 @@ class Miscallaneous(commands.Cog):
value = ""
memory_usage = self.process.memory_full_info().uss / 1024 ** 2
cpu_usage = self.process.cpu_percent() / psutil.cpu_count()
cpu_usage = self.process.cpu_percent()
value += 'Memory: {:.2f} MiB'.format(memory_usage)
value += '\nCPU: {}%'.format(cpu_usage)
if hasattr(ctx.bot, 'uptime'):