Update handling of stats to be simpler

This commit is contained in:
Nicolas Mowen
2026-03-28 10:21:57 -06:00
parent 3835e7649c
commit 31bd461ece
3 changed files with 19 additions and 8 deletions
+1 -2
View File
@@ -116,8 +116,7 @@ export default function Statusbar() {
case "amd-vaapi":
gpuTitle = "AMD GPU";
break;
case "intel-vaapi":
case "intel-qsv":
case "intel-gpu":
gpuTitle = "Intel GPU";
break;
case "rockchip":
+4 -6
View File
@@ -76,7 +76,7 @@ export default function GeneralMetrics({
statsHistory.length > 0 &&
Object.keys(statsHistory[0]?.gpu_usages ?? {}).forEach((key) => {
if (key == "amd-vaapi" || key == "intel-vaapi" || key == "intel-qsv") {
if (key == "amd-vaapi" || key == "intel-gpu") {
vaCount += 1;
}
@@ -265,7 +265,7 @@ export default function GeneralMetrics({
if (
Object.keys(statsHistory?.at(0)?.gpu_usages ?? {}).length == 1 &&
Object.keys(statsHistory?.at(0)?.gpu_usages ?? {})[0].includes("intel")
Object.keys(statsHistory?.at(0)?.gpu_usages ?? {})[0] === "intel-gpu"
) {
// intel gpu stats do not support memory
return undefined;
@@ -409,9 +409,7 @@ export default function GeneralMetrics({
}
const gpuKeys = Object.keys(statsHistory[0]?.gpu_usages ?? {});
const hasIntelGpu = gpuKeys.some(
(key) => key === "intel-vaapi" || key === "intel-qsv",
);
const hasIntelGpu = gpuKeys.some((key) => key === "intel-gpu");
if (!hasIntelGpu) {
return false;
@@ -427,7 +425,7 @@ export default function GeneralMetrics({
}
Object.entries(stats.gpu_usages || {}).forEach(([key, gpuStats]) => {
if (key === "intel-vaapi" || key === "intel-qsv") {
if (key === "intel-gpu") {
if (gpuStats.gpu) {
hasDataPoints = true;
const gpuValue = parseFloat(gpuStats.gpu.slice(0, -1));