diff --git a/app/route/route.py b/app/route/route.py index 9076584..f798c87 100644 --- a/app/route/route.py +++ b/app/route/route.py @@ -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,