From 87d4dd7e46f8ccbaeab0b5d7e588f1a933163f54 Mon Sep 17 00:00:00 2001 From: Abraham Date: Wed, 18 Dec 2024 14:38:13 -0500 Subject: [PATCH] plot memory data point --- backend/app/api/v1/endpoints/telco/telcoGraphs.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/app/api/v1/endpoints/telco/telcoGraphs.py b/backend/app/api/v1/endpoints/telco/telcoGraphs.py index 41b90cc1..a41d2260 100644 --- a/backend/app/api/v1/endpoints/telco/telcoGraphs.py +++ b/backend/app/api/v1/endpoints/telco/telcoGraphs.py @@ -131,6 +131,7 @@ def process_cpu_util(json_data: str, is_row: bool): total_avg_cpu = 0.0 minus_max_cpu = 0.0 minus_avg_cpu = 0.0 + total_avg_mem = 0.0 defined_threshold = 3.0 for each_scenario in json_data["scenarios"]: if each_scenario["scenario_name"] == "steadyworkload": @@ -139,12 +140,14 @@ def process_cpu_util(json_data: str, is_row: bool): total_max_cpu = each_type.get("max_cpu", 0) break total_avg_cpu = each_scenario.get("avg_cpu_total", 0) + total_avg_mem = each_scenario.get("avg_mem_total", 0) break if total_max_cpu > defined_threshold: minus_max_cpu = total_max_cpu - defined_threshold if total_avg_cpu > defined_threshold: minus_avg_cpu = total_avg_cpu - defined_threshold + if is_row: return 1 if (minus_avg_cpu != 0 or minus_max_cpu != 0) else 0 else: @@ -152,8 +155,8 @@ def process_cpu_util(json_data: str, is_row: bool): "cpu_util": [ { "name": "Data Points", - "x": ["total_max_cpu", "total_avg_cpu"], - "y": [total_max_cpu, total_avg_cpu], + "x": ["total_max_cpu", "total_avg_cpu", "total_avg_mem"], + "y": [total_max_cpu, total_avg_cpu, total_avg_mem], "mode": "markers", "marker": { "size": 10,