Spaces:
Sleeping
Sleeping
Update metrics.py
Browse files- metrics.py +4 -4
metrics.py
CHANGED
|
@@ -19,10 +19,10 @@ class InteractionMetric:
|
|
| 19 |
error_occurred: bool
|
| 20 |
error_message: Optional[str] = None
|
| 21 |
|
| 22 |
-
class
|
| 23 |
-
"""Metrics collection and analysis for
|
| 24 |
|
| 25 |
-
def __init__(self, save_file: str = "
|
| 26 |
self.metrics: List[InteractionMetric] = []
|
| 27 |
self.save_file = save_file
|
| 28 |
self.lock = threading.Lock() # Thread-safe for concurrent requests
|
|
@@ -167,7 +167,7 @@ class EduBotMetrics:
|
|
| 167 |
def export_csv(self, filename: str = None):
|
| 168 |
"""Export metrics to CSV format"""
|
| 169 |
if filename is None:
|
| 170 |
-
filename = f"
|
| 171 |
|
| 172 |
try:
|
| 173 |
import csv
|
|
|
|
| 19 |
error_occurred: bool
|
| 20 |
error_message: Optional[str] = None
|
| 21 |
|
| 22 |
+
class MimirMetrics:
|
| 23 |
+
"""Metrics collection and analysis for Mimir"""
|
| 24 |
|
| 25 |
+
def __init__(self, save_file: str = "Mimir_metrics.json"):
|
| 26 |
self.metrics: List[InteractionMetric] = []
|
| 27 |
self.save_file = save_file
|
| 28 |
self.lock = threading.Lock() # Thread-safe for concurrent requests
|
|
|
|
| 167 |
def export_csv(self, filename: str = None):
|
| 168 |
"""Export metrics to CSV format"""
|
| 169 |
if filename is None:
|
| 170 |
+
filename = f"Mimir_metrics_{datetime.now().strftime('%Y%m%d_%H%M%S')}.csv"
|
| 171 |
|
| 172 |
try:
|
| 173 |
import csv
|