Fix NPU stats

This commit is contained in:
Nicolas Mowen 2025-04-30 17:25:28 -06:00
parent 377b78af11
commit 2bc139d34c

View File

@ -391,7 +391,7 @@ export default function GeneralMetrics({
series[key] = { name: key, data: [] };
}
if (stats.npu) {
if (stats?.npu) {
hasValidNpu = true;
series[key].data.push({ x: statsIdx + 1, y: stats.npu });
}
@ -399,6 +399,7 @@ export default function GeneralMetrics({
});
if (!hasValidNpu) {
console.log(`returning blank`);
return [];
}
@ -585,8 +586,8 @@ export default function GeneralMetrics({
</div>
{(statsHistory.length == 0 ||
statsHistory[0].gpu_usages ||
statsHistory[0].npu_usages) && (
gpuSeries.length > 0 ||
npuSeries.length > 0) && (
<>
<div className="mt-4 flex items-center justify-between">
<div className="text-sm font-medium text-muted-foreground">