Trying to help the LLM

This commit is contained in:
2025-08-23 16:04:49 -05:00
parent ff7bbb98d0
commit bebedb1e15
8 changed files with 353 additions and 24 deletions

View File

@@ -1,6 +1,7 @@
import json
import os
from datetime import datetime, timedelta, timezone
import math
DATA_FILE = 'monitoring_data.json'
@@ -19,7 +20,7 @@ def store_data(new_data):
def _calculate_average(data, key1, key2):
"""Helper function to calculate the average of a nested key in a list of dicts."""
values = [d[key1][key2] for d in data if key1 in d and key2 in d[key1] and d[key1][key2] != "N/A"]
return int(sum(values) / len(values)) if values else 0
return math.ceil(sum(values) / len(values)) if values else 0
def calculate_baselines():
data = load_data()