psutil
This commit is contained in:
parent
f058d240bd
commit
807fe1d479
@ -3,7 +3,6 @@
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import psutil
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@ -140,6 +139,12 @@ def to_bar(x):
|
|||||||
|
|
||||||
|
|
||||||
def monitor_stats():
|
def monitor_stats():
|
||||||
|
try:
|
||||||
|
import psutil
|
||||||
|
except:
|
||||||
|
print('Stats requires psutil (run `pip install psutil`)', file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Monitors CPU and MEM usage and prints info in file.
|
Monitors CPU and MEM usage and prints info in file.
|
||||||
"""
|
"""
|
||||||
@ -200,7 +205,8 @@ def main():
|
|||||||
monitor_stats()
|
monitor_stats()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print(f'Command not found: {sys.argv[1]}')
|
print(f'Command not found: {sys.argv[1]}', file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user