From fec977f8c753ac24ec7142f4b484e8402d5fdba4 Mon Sep 17 00:00:00 2001 From: tpjanssen <25168870+tpjanssen@users.noreply.github.com> Date: Fri, 13 Oct 2023 17:43:25 +0200 Subject: [PATCH] Change camera stats to be more structured --- frigate/stats.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frigate/stats.py b/frigate/stats.py index 8f8d03ed4..cb32f638e 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), @@ -271,6 +272,7 @@ def stats_snapshot( "audio_rms": round(camera_stats["audio_rms"].value, 4), "audio_dBFS": round(camera_stats["audio_dBFS"].value, 4), } + stats[name] = stats["cameras"][name] # deprecate in the future? stats["detectors"] = {} for name, detector in stats_tracking["detectors"].items():