def debug_status(self, event):
table = MessageTable()
table.set_header('Metric', 'Value')
table.add('Guilds', len(self.state.guilds))
table.add('Channels', len(self.state.channels))
table.add('Users', len(self.state.users))
try:
import psutil
memory = psutil.Process().memory_info()
table.add('Memory RSS', sizeof_fmt(memory.rss))
table.add('Memory VMS', sizeof_fmt(memory.vms))
except ImportError:
pass
table.add('Greenlets', gevent.get_hub().loop.activecnt)
event.msg.reply(table.compile())
评论列表
文章目录