From facd557f8cf912dc97abc1241e4178e79d6ff1d9 Mon Sep 17 00:00:00 2001 From: tpjanssen <25168870+tpjanssen@users.noreply.github.com> Date: Fri, 20 Oct 2023 00:15:47 +0200 Subject: [PATCH] Change camera stats to be more structured (#8151) * Change camera stats to be more structured * Update stats.py * Update stats.py * Update System.jsx Front end also breaks due to moved camera stats --- frigate/stats.py | 3 ++- web/src/routes/System.jsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frigate/stats.py b/frigate/stats.py index 8f8d03ed4..083926996 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 0074763fa..5ad3fd215 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);