diff --git a/web/src/views/system/CameraMetrics.tsx b/web/src/views/system/CameraMetrics.tsx index e10a437b2..b6c5be4fa 100644 --- a/web/src/views/system/CameraMetrics.tsx +++ b/web/src/views/system/CameraMetrics.tsx @@ -3,7 +3,6 @@ import { CameraLineGraph } from "@/components/graph/LineGraph"; import CameraInfoDialog from "@/components/overlay/CameraInfoDialog"; import { ConnectionQualityIndicator } from "@/components/camera/ConnectionQualityIndicator"; import { Skeleton } from "@/components/ui/skeleton"; -import { cn } from "@/lib/utils"; import { FrigateConfig } from "@/types/frigateConfig"; import { FrigateStats } from "@/types/stats"; import { useCallback, useEffect, useMemo, useState } from "react"; @@ -44,7 +43,7 @@ export default function CameraMetrics({ [ "stats/history", { - keys: "cpu_usages,gpu_usages,cameras,camera_fps,detection_fps,skipped_fps,service", + keys: "cpu_usages,cameras,camera_fps,detection_fps,skipped_fps,service", }, ], { @@ -184,64 +183,6 @@ export default function CameraMetrics({ return series; }, [config, getCameraName, statsHistory, t]); - const cameraGpuSeries = useMemo(() => { - if (!statsHistory || statsHistory.length == 0) { - return {}; - } - - // Find GPU entry with per-client data - const firstGpu = statsHistory.find((s) => s?.gpu_usages); - if (!firstGpu?.gpu_usages) { - return {}; - } - - const gpuWithClients = Object.values(firstGpu.gpu_usages).find( - (g) => g.clients, - ); - if (!gpuWithClients) { - return {}; - } - - const series: { - [cam: string]: { - [key: string]: { name: string; data: { x: number; y: string }[] }; - }; - } = {}; - - statsHistory.forEach((stats, statsIdx) => { - if (!stats) { - return; - } - - const gpuClients = Object.values(stats.gpu_usages || {}).find( - (g) => g.clients, - )?.clients; - - Object.entries(stats.cameras).forEach(([key, camStats]) => { - if (!config?.cameras[key].enabled) { - return; - } - - if (!(key in series)) { - const camName = getCameraName(key); - series[key] = {}; - series[key]["gpu"] = { - name: t("cameras.label.cameraGpu", { camName: camName }), - data: [], - }; - } - - const pid = camStats.ffmpeg_pid?.toString(); - series[key]["gpu"].data.push({ - x: statsIdx, - y: (gpuClients && pid ? gpuClients[pid] : undefined) - ?.slice(0, -1) ?? "0", - }); - }); - }); - return series; - }, [config, getCameraName, statsHistory, t]); - const cameraFpsSeries = useMemo(() => { if (!statsHistory) { return {}; @@ -391,11 +332,7 @@ export default function CameraMetrics({