fix(control): 系统控制

test
jshixiong 1 year ago
parent 1af530f9e4
commit 76d9e3beec

@ -18,8 +18,12 @@ def get_resource():
cpu_percent = cpu_usage.get_cpu_percent()
io_percent = io_usage.get_io_percent()
memory_percent = memory_usage.get_memory_percent()
status = 0
if cpu_percent >= 30 | memory_percent >= 60:
status = 1
return jsonify({
'status': 0,
'status': status,
'online': random.randint(150, 200),
'cpu_percent': cpu_percent,
'io_percent': io_percent,

Loading…
Cancel
Save