Fix intel memory stats

This commit is contained in:
Nicolas Mowen 2024-04-09 14:25:28 -06:00
parent fe3335f4d6
commit a3f68cc761

View File

@ -193,6 +193,14 @@ export default function GeneralMetrics({
return []; return [];
} }
if (
Object.keys(statsHistory?.at(0)?.gpu_usages ?? {}).length == 1 &&
Object.keys(statsHistory?.at(0)?.gpu_usages ?? {})[0].includes("intel")
) {
// intel gpu stats do not support memory
return undefined;
}
const series: { const series: {
[key: string]: { name: string; data: { x: number; y: string }[] }; [key: string]: { name: string; data: { x: number; y: string }[] };
} = {}; } = {};
@ -285,7 +293,7 @@ export default function GeneralMetrics({
</div> </div>
<div className="w-full mt-4 grid grid-cols-1 sm:grid-cols-3 gap-2"> <div className="w-full mt-4 grid grid-cols-1 sm:grid-cols-3 gap-2">
{statsHistory.length != 0 ? ( {statsHistory.length != 0 ? (
<div className="p-2.5 bg-background_alt rounded-2xl flex-col"> <div className="p-2.5 bg-background_alt rounded-2xl">
<div className="mb-5">Detector Inference Speed</div> <div className="mb-5">Detector Inference Speed</div>
{detInferenceTimeSeries.map((series) => ( {detInferenceTimeSeries.map((series) => (
<ThresholdBarGraph <ThresholdBarGraph
@ -303,7 +311,7 @@ export default function GeneralMetrics({
<Skeleton className="w-full aspect-video" /> <Skeleton className="w-full aspect-video" />
)} )}
{statsHistory.length != 0 ? ( {statsHistory.length != 0 ? (
<div className="p-2.5 bg-background_alt rounded-2xl flex-col"> <div className="p-2.5 bg-background_alt rounded-2xl">
<div className="mb-5">Detector CPU Usage</div> <div className="mb-5">Detector CPU Usage</div>
{detCpuSeries.map((series) => ( {detCpuSeries.map((series) => (
<ThresholdBarGraph <ThresholdBarGraph
@ -321,7 +329,7 @@ export default function GeneralMetrics({
<Skeleton className="w-full aspect-video" /> <Skeleton className="w-full aspect-video" />
)} )}
{statsHistory.length != 0 ? ( {statsHistory.length != 0 ? (
<div className="p-2.5 bg-background_alt rounded-2xl flex-col"> <div className="p-2.5 bg-background_alt rounded-2xl">
<div className="mb-5">Detector Memory Usage</div> <div className="mb-5">Detector Memory Usage</div>
{detMemSeries.map((series) => ( {detMemSeries.map((series) => (
<ThresholdBarGraph <ThresholdBarGraph
@ -358,7 +366,7 @@ export default function GeneralMetrics({
</div> </div>
<div className=" mt-4 grid grid-cols-1 sm:grid-cols-2 gap-2"> <div className=" mt-4 grid grid-cols-1 sm:grid-cols-2 gap-2">
{statsHistory.length != 0 ? ( {statsHistory.length != 0 ? (
<div className="p-2.5 bg-background_alt rounded-2xl flex-col"> <div className="p-2.5 bg-background_alt rounded-2xl">
<div className="mb-5">GPU Usage</div> <div className="mb-5">GPU Usage</div>
{gpuSeries.map((series) => ( {gpuSeries.map((series) => (
<ThresholdBarGraph <ThresholdBarGraph
@ -376,20 +384,24 @@ export default function GeneralMetrics({
<Skeleton className="w-full aspect-video" /> <Skeleton className="w-full aspect-video" />
)} )}
{statsHistory.length != 0 ? ( {statsHistory.length != 0 ? (
<div className="p-2.5 bg-background_alt rounded-2xl flex-col"> <>
<div className="mb-5">GPU Memory</div> {gpuMemSeries && (
{gpuMemSeries.map((series) => ( <div className="p-2.5 bg-background_alt rounded-2xl">
<ThresholdBarGraph <div className="mb-5">GPU Memory</div>
key={series.name} {gpuMemSeries.map((series) => (
graphId={`${series.name}-mem`} <ThresholdBarGraph
unit="" key={series.name}
name={series.name} graphId={`${series.name}-mem`}
threshold={GPUMemThreshold} unit=""
updateTimes={updateTimes} name={series.name}
data={[series]} threshold={GPUMemThreshold}
/> updateTimes={updateTimes}
))} data={[series]}
</div> />
))}
</div>
)}
</>
) : ( ) : (
<Skeleton className="w-full aspect-video" /> <Skeleton className="w-full aspect-video" />
)} )}
@ -402,7 +414,7 @@ export default function GeneralMetrics({
</div> </div>
<div className="mt-4 grid grid-cols-1 sm:grid-cols-2 gap-2"> <div className="mt-4 grid grid-cols-1 sm:grid-cols-2 gap-2">
{statsHistory.length != 0 ? ( {statsHistory.length != 0 ? (
<div className="p-2.5 bg-background_alt rounded-2xl flex-col"> <div className="p-2.5 bg-background_alt rounded-2xl">
<div className="mb-5">Process CPU Usage</div> <div className="mb-5">Process CPU Usage</div>
{otherProcessCpuSeries.map((series) => ( {otherProcessCpuSeries.map((series) => (
<ThresholdBarGraph <ThresholdBarGraph
@ -420,7 +432,7 @@ export default function GeneralMetrics({
<Skeleton className="w-full aspect-tall" /> <Skeleton className="w-full aspect-tall" />
)} )}
{statsHistory.length != 0 ? ( {statsHistory.length != 0 ? (
<div className="p-2.5 bg-background_alt rounded-2xl flex-col"> <div className="p-2.5 bg-background_alt rounded-2xl">
<div className="mb-5">Process Memory Usage</div> <div className="mb-5">Process Memory Usage</div>
{otherProcessMemSeries.map((series) => ( {otherProcessMemSeries.map((series) => (
<ThresholdBarGraph <ThresholdBarGraph