Trying to help the LLM
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user