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
This commit is contained in:
tpjanssen 2023-10-20 00:15:47 +02:00 committed by GitHub
parent 12487b3b60
commit facd557f8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -248,6 +248,7 @@ def stats_snapshot(
total_detection_fps = 0 total_detection_fps = 0
stats["cameras"] = {}
for name, camera_stats in camera_metrics.items(): for name, camera_stats in camera_metrics.items():
total_detection_fps += camera_stats["detection_fps"].value total_detection_fps += camera_stats["detection_fps"].value
pid = camera_stats["process"].pid if camera_stats["process"] else None pid = camera_stats["process"].pid if camera_stats["process"] else None
@ -259,7 +260,7 @@ def stats_snapshot(
if camera_stats["capture_process"] if camera_stats["capture_process"]
else None else None
) )
stats[name] = { stats["cameras"][name] = {
"camera_fps": round(camera_stats["camera_fps"].value, 2), "camera_fps": round(camera_stats["camera_fps"].value, 2),
"process_fps": round(camera_stats["process_fps"].value, 2), "process_fps": round(camera_stats["process_fps"].value, 2),
"skipped_fps": round(camera_stats["skipped_fps"].value, 2), "skipped_fps": round(camera_stats["skipped_fps"].value, 2),

View File

@ -32,7 +32,7 @@ export default function System() {
service = {}, service = {},
detection_fps: _, detection_fps: _,
processes, processes,
...cameras cameras,
} = stats || initialStats || emptyObject; } = stats || initialStats || emptyObject;
const detectorNames = Object.keys(detectors || emptyObject); const detectorNames = Object.keys(detectors || emptyObject);