mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-25 09:37:30 +00:00
🐛 Fix incorrect CPU percentage retrieval for the current process
This commit is contained in:
parent
fd34078f76
commit
11c447484c
@ -26,12 +26,13 @@ class Status(Plugin):
|
|||||||
logger.info("用户 %s[%s] status 命令请求", user.full_name, user.id)
|
logger.info("用户 %s[%s] status 命令请求", user.full_name, user.id)
|
||||||
message = update.effective_message
|
message = update.effective_message
|
||||||
current_process = psutil.Process(self.pid)
|
current_process = psutil.Process(self.pid)
|
||||||
psutil.cpu_percent()
|
|
||||||
await asyncio.sleep(0.1)
|
|
||||||
cpu_percent = psutil.cpu_percent()
|
|
||||||
memory = psutil.virtual_memory()
|
memory = psutil.virtual_memory()
|
||||||
total_memory = memory.total
|
total_memory = memory.total
|
||||||
used_memory = memory.used
|
used_memory = memory.used
|
||||||
|
psutil.cpu_percent()
|
||||||
|
current_process.cpu_percent()
|
||||||
|
await asyncio.sleep(1)
|
||||||
|
cpu_percent = psutil.cpu_percent()
|
||||||
process_cpu_use = current_process.cpu_percent()
|
process_cpu_use = current_process.cpu_percent()
|
||||||
process_use = current_process.memory_info()
|
process_use = current_process.memory_info()
|
||||||
start_time = current_process.create_time()
|
start_time = current_process.create_time()
|
||||||
|
Loading…
Reference in New Issue
Block a user