SuriRaja commited on
Commit
49a6717
·
1 Parent(s): 9f587bb

Update services/metrics_service.py

Browse files
Files changed (1) hide show
  1. services/metrics_service.py +2 -9
services/metrics_service.py CHANGED
@@ -1,11 +1,4 @@
1
  def update_metrics(detected):
2
- """Update live metrics based on detected anomalies."""
3
  if not detected:
4
- return "No anomalies detected."
5
-
6
- counts = {}
7
- for _, label, _ in detected:
8
- counts[label] = counts.get(label, 0) + 1
9
-
10
- metrics_summary = ", ".join(f"{label}: {count}" for label, count in counts.items())
11
- return metrics_summary
 
1
  def update_metrics(detected):
 
2
  if not detected:
3
+ return {"Detections": 0}
4
+ return {"Detections": len(detected)}