Skip to content

NVR with realtime local object detection for IP cameras

Change camera stats to be more structured (#8151)

tpjanssenfacd557f8cf9
diff --git a/frigate/stats.py b/frigate/stats.py
index 8f8d03ed4a..0839269963 100644
--- a/frigate/stats.py
+++ b/frigate/stats.py
@@ -248,6 +248,7 @@ def stats_snapshot(
total_detection_fps = 0
+ stats["cameras"] = {}
for name, camera_stats in camera_metrics.items():
total_detection_fps += camera_stats["detection_fps"].value
pid = camera_stats["process"].pid if camera_stats["process"] else None
@@ -259,7 +260,7 @@ def stats_snapshot(
if camera_stats["capture_process"]
else None
)
- stats[name] = {
+ stats["cameras"][name] = {
"camera_fps": round(camera_stats["camera_fps"].value, 2),
"process_fps": round(camera_stats["process_fps"].value, 2),
"skipped_fps": round(camera_stats["skipped_fps"].value, 2),
diff --git a/web/src/routes/System.jsx b/web/src/routes/System.jsx
index 0074763fa3..5ad3fd2154 100644
--- a/web/src/routes/System.jsx
+++ b/web/src/routes/System.jsx
@@ -32,7 +32,7 @@ export default function System() {
service = {},
detection_fps: _,
processes,
- ...cameras
+ cameras,
} = stats || initialStats || emptyObject;
const detectorNames = Object.keys(detectors || emptyObject);