mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-16 18:43:02 +03:00
expose thresholds in ms for detectors to warn or error
This commit is contained in:
@@ -50,8 +50,14 @@ export default function useStats(stats: FrigateStats | undefined) {
|
||||
}
|
||||
|
||||
// check detectors for high inference speeds
|
||||
const inferenceThreshold = {
|
||||
warning:
|
||||
config?.ui?.inference_threshold?.warning ?? InferenceThreshold.warning,
|
||||
error:
|
||||
config?.ui?.inference_threshold?.error ?? InferenceThreshold.error,
|
||||
};
|
||||
Object.entries(memoizedStats["detectors"]).forEach(([key, det]) => {
|
||||
if (det["inference_speed"] > InferenceThreshold.error) {
|
||||
if (det["inference_speed"] > inferenceThreshold.error) {
|
||||
problems.push({
|
||||
text: t("stats.detectIsVerySlow", {
|
||||
detect: capitalizeFirstLetter(key),
|
||||
@@ -60,7 +66,7 @@ export default function useStats(stats: FrigateStats | undefined) {
|
||||
color: "text-danger",
|
||||
relevantLink: "/system#general",
|
||||
});
|
||||
} else if (det["inference_speed"] > InferenceThreshold.warning) {
|
||||
} else if (det["inference_speed"] > inferenceThreshold.warning) {
|
||||
problems.push({
|
||||
text: t("stats.detectIsSlow", {
|
||||
detect: capitalizeFirstLetter(key),
|
||||
|
||||
@@ -9,6 +9,10 @@ export interface UiConfig {
|
||||
dashboard: boolean;
|
||||
order: number;
|
||||
unit_system?: "metric" | "imperial";
|
||||
inference_threshold?: {
|
||||
warning: number;
|
||||
error: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface BirdseyeConfig {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import useSWR from "swr";
|
||||
import { FrigateConfig } from "@/types/frigateConfig";
|
||||
import { FrigateStats, GpuInfo } from "@/types/stats";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { useFrigateStats } from "@/api/ws";
|
||||
@@ -34,6 +35,12 @@ export default function GeneralMetrics({
|
||||
// extra info
|
||||
const { t } = useTranslation(["views/system"]);
|
||||
const [showVainfo, setShowVainfo] = useState(false);
|
||||
const { data: config } = useSWR<FrigateConfig>("config");
|
||||
const inferenceThreshold = {
|
||||
warning:
|
||||
config?.ui?.inference_threshold?.warning ?? InferenceThreshold.warning,
|
||||
error: config?.ui?.inference_threshold?.error ?? InferenceThreshold.error,
|
||||
};
|
||||
|
||||
// stats
|
||||
|
||||
@@ -626,7 +633,7 @@ export default function GeneralMetrics({
|
||||
graphId={`${series.name}-inference`}
|
||||
name={series.name}
|
||||
unit="ms"
|
||||
threshold={InferenceThreshold}
|
||||
threshold={inferenceThreshold}
|
||||
updateTimes={updateTimes}
|
||||
data={[series]}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user