Implement enchrichments events per second graph (#17436)

* Cleanup existing naming

* Add face recognitions per second

* Add lpr fps

* Add all eps

* Clean up line graph

* Translations

* Change wording

* Fix incorrect access

* Don't require plates

* Add comment

* Fix
This commit is contained in:
Nicolas Mowen
2025-03-28 18:13:35 -05:00
committed by GitHub
parent b14abffea3
commit 9e8b85a957
11 changed files with 233 additions and 53 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
import { useFrigateStats } from "@/api/ws";
import { CameraLineGraph } from "@/components/graph/CameraGraph";
import { CameraLineGraph } from "@/components/graph/LineGraph";
import CameraInfoDialog from "@/components/overlay/CameraInfoDialog";
import { Skeleton } from "@/components/ui/skeleton";
import { FrigateConfig } from "@/types/frigateConfig";
@@ -7,15 +7,16 @@ import { Skeleton } from "@/components/ui/skeleton";
import { ThresholdBarGraph } from "@/components/graph/SystemGraph";
import { cn } from "@/lib/utils";
import { useTranslation } from "react-i18next";
import { EventsPerSecondsLineGraph } from "@/components/graph/LineGraph";
type FeatureMetricsProps = {
type EnrichmentMetricsProps = {
lastUpdated: number;
setLastUpdated: (last: number) => void;
};
export default function FeatureMetrics({
export default function EnrichmentMetrics({
lastUpdated,
setLastUpdated,
}: FeatureMetricsProps) {
}: EnrichmentMetricsProps) {
// stats
const { t } = useTranslation(["views/system"]);
@@ -102,15 +103,26 @@ export default function FeatureMetrics({
{embeddingInferenceTimeSeries.map((series) => (
<div className="rounded-lg bg-background_alt p-2.5 md:rounded-2xl">
<div className="mb-5 capitalize">{series.name}</div>
<ThresholdBarGraph
key={series.name}
graphId={`${series.name}-inference`}
name={series.name}
unit="ms"
threshold={EmbeddingThreshold}
updateTimes={updateTimes}
data={[series]}
/>
{series.name.endsWith("Speed") ? (
<ThresholdBarGraph
key={series.name}
graphId={`${series.name}-inference`}
name={series.name}
unit="ms"
threshold={EmbeddingThreshold}
updateTimes={updateTimes}
data={[series]}
/>
) : (
<EventsPerSecondsLineGraph
key={series.name}
graphId={`${series.name}-fps`}
unit=""
name={t("enrichments.infPerSecond")}
updateTimes={updateTimes}
data={[series]}
/>
)}
</div>
))}
</>