From 84aa7149a664fe5a6a059d09c5618416d56c842d Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Wed, 9 Nov 2022 14:47:13 -0700 Subject: [PATCH] Add fps to camera metrics --- frigate/stats.py | 4 +- web/src/routes/Debug.jsx | 137 ++++++++++++++++++++------------------- 2 files changed, 73 insertions(+), 68 deletions(-) diff --git a/frigate/stats.py b/frigate/stats.py index 99f37aea2..d4899bb6d 100644 --- a/frigate/stats.py +++ b/frigate/stats.py @@ -91,7 +91,9 @@ def stats_snapshot(stats_tracking: StatsTrackingTypes) -> dict[str, Any]: 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 - ffmpeg_pid = camera_stats["ffmpeg_pid"].value if camera_stats["ffmpeg_pid"] else None + ffmpeg_pid = ( + camera_stats["ffmpeg_pid"].value if camera_stats["ffmpeg_pid"] else None + ) cpid = ( camera_stats["capture_process"].pid if camera_stats["capture_process"] diff --git a/web/src/routes/Debug.jsx b/web/src/routes/Debug.jsx index c20f63fbe..8d95b0cd4 100644 --- a/web/src/routes/Debug.jsx +++ b/web/src/routes/Debug.jsx @@ -57,78 +57,81 @@ export default function Debug() { ) : ( + Detectors
- - - - - {detectorDataKeys.map((name) => ( - - ))} - - - - {detectorNames.map((detector, i) => ( - - - {detectorDataKeys.map((name) => ( - + {detectorNames.map((name) => ( +
+
{name}
+
detector{name.replace('_', ' ')}
{detector}{detectors[detector][name]}
+ + + {detectorDataKeys.map((name) => ( + + ))} + + + + {detectorNames.map((detector, i) => ( + + {detectorDataKeys.map((name) => ( + + ))} + ))} - - ))} - -
{name.replace('_', ' ')}
{detectors[detector][name]}
+ + +
+ ))} - - Cameras - -
- - {cameraNames.map((camera, i) => ( -
-
- {camera.replaceAll('_', ' ')} - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProcessesProcess IDCpu %Memory %
Capture{cameras[camera]['capture_pid']}{cpu_usages[cameras[camera]['capture_pid']]['cpu']}%{cpu_usages[cameras[camera]['capture_pid']]['mem']}%
Detect{cameras[camera]['pid']}{cpu_usages[cameras[camera]['pid']]['cpu']}%{cpu_usages[cameras[camera]['pid']]['cpu']}%
ffmpeg{cameras[camera]['ffmpeg_pid']}{cpu_usages[cameras[camera]['ffmpeg_pid']]['cpu']}%{cpu_usages[cameras[camera]['ffmpeg_pid']]['cpu']}%
- -
+ Cameras +
+ {cameraNames.map((camera, i) => ( +
+
+ {camera.replaceAll('_', ' ')} +
- ))} - +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ProcessesProcess IDfpsCpu %Memory %
Capture{cameras[camera]['capture_pid']}{cameras[camera]['process_fps']}{cpu_usages[cameras[camera]['capture_pid']]['cpu']}%{cpu_usages[cameras[camera]['capture_pid']]['mem']}%
Detect{cameras[camera]['pid']} + {cameras[camera]['detection_fps']} ({cameras[camera]['skipped_fps']} skipped) + {cpu_usages[cameras[camera]['pid']]['cpu']}%{cpu_usages[cameras[camera]['pid']]['cpu']}%
ffmpeg{cameras[camera]['ffmpeg_pid']}{cameras[camera]['camera_fps']}{cpu_usages[cameras[camera]['ffmpeg_pid']]['cpu']}%{cpu_usages[cameras[camera]['ffmpeg_pid']]['cpu']}%
+
+
+ ))}

Debug stats update automatically every {config.mqtt.stats_interval} seconds.