Skip to content

Commit c723164

Browse files
authored
Add an icon and tooltip to explain detector CPU usage metric (#19825)
1 parent 92555eb commit c723164

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

web/public/locales/en/views/system.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"inferenceSpeed": "Detector Inference Speed",
4343
"temperature": "Detector Temperature",
4444
"cpuUsage": "Detector CPU Usage",
45+
"cpuUsageInformation": "CPU used in preparing input and output data to/from detection models. This value does not measure inference usage, even if using a GPU or accelerator.",
4546
"memoryUsage": "Detector Memory Usage"
4647
},
4748
"hardwareInfo": {

web/src/views/system/GeneralMetrics.tsx

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@ import {
1111
InferenceThreshold,
1212
} from "@/types/graph";
1313
import { Button } from "@/components/ui/button";
14+
import {
15+
Popover,
16+
PopoverContent,
17+
PopoverTrigger,
18+
} from "@/components/ui/popover";
1419
import GPUInfoDialog from "@/components/overlay/GPUInfoDialog";
1520
import { Skeleton } from "@/components/ui/skeleton";
1621
import { ThresholdBarGraph } from "@/components/graph/SystemGraph";
1722
import { cn } from "@/lib/utils";
1823
import { useTranslation } from "react-i18next";
24+
import { CiCircleAlert } from "react-icons/ci";
1925

2026
type GeneralMetricsProps = {
2127
lastUpdated: number;
@@ -548,7 +554,27 @@ export default function GeneralMetrics({
548554
)}
549555
{statsHistory.length != 0 ? (
550556
<div className="rounded-lg bg-background_alt p-2.5 md:rounded-2xl">
551-
<div className="mb-5">{t("general.detector.cpuUsage")}</div>
557+
<div className="mb-5 flex flex-row items-center justify-between">
558+
{t("general.detector.cpuUsage")}
559+
<Popover>
560+
<PopoverTrigger asChild>
561+
<button
562+
className="focus:outline-none"
563+
aria-label={t("general.detector.cpuUsage")}
564+
>
565+
<CiCircleAlert
566+
className="size-5"
567+
aria-label={t("general.detector.cpuUsage")}
568+
/>
569+
</button>
570+
</PopoverTrigger>
571+
<PopoverContent className="w-80">
572+
<div className="space-y-2">
573+
{t("general.detector.cpuUsageInformation")}
574+
</div>
575+
</PopoverContent>
576+
</Popover>
577+
</div>
552578
{detCpuSeries.map((series) => (
553579
<ThresholdBarGraph
554580
key={series.name}

0 commit comments

Comments
 (0)