Spaces:
Running
Running
Update observability.py
Browse files- observability.py +8 -6
observability.py
CHANGED
@@ -121,6 +121,13 @@ class LLMObservabilityManager:
|
|
121 |
Returns:
|
122 |
Dict containing dashboard statistics and time series data
|
123 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
with sqlite3.connect(self.db_path) as conn:
|
125 |
cursor = conn.cursor()
|
126 |
|
@@ -261,9 +268,4 @@ class LLMObservabilityManager:
|
|
261 |
"time_series": time_series,
|
262 |
"trends": trends
|
263 |
}
|
264 |
-
|
265 |
-
def calculate_percentage_change(old_value: float, new_value: float) -> float:
|
266 |
-
"""Calculate percentage change between two values."""
|
267 |
-
if old_value == 0:
|
268 |
-
return 100 if new_value > 0 else 0
|
269 |
-
return round(((new_value - old_value) / old_value) * 100, 2)
|
|
|
121 |
Returns:
|
122 |
Dict containing dashboard statistics and time series data
|
123 |
"""
|
124 |
+
|
125 |
+
def calculate_percentage_change(old_value: float, new_value: float) -> float:
|
126 |
+
"""Calculate percentage change between two values."""
|
127 |
+
if old_value == 0:
|
128 |
+
return 100 if new_value > 0 else 0
|
129 |
+
return round(((new_value - old_value) / old_value) * 100, 2)
|
130 |
+
|
131 |
with sqlite3.connect(self.db_path) as conn:
|
132 |
cursor = conn.cursor()
|
133 |
|
|
|
268 |
"time_series": time_series,
|
269 |
"trends": trends
|
270 |
}
|
271 |
+
|
|
|
|
|
|
|
|
|
|