Compare commits

...
Author SHA1 Message Date
ajnart f677e23d09 fix(unraid): use byte-based memory metrics 2026-09-06 10:51:42 +02:00
2 changed files with 2 additions and 15 deletions

No files matched your search

@@ -39,9 +39,8 @@ export class UnraidIntegration extends Integration implements ISystemHealthMonit
const cpuUtilization = systemInfo.metrics.cpu.cpus.reduce((acc, val) => acc + val.percentTotal, 0); const cpuUtilization = systemInfo.metrics.cpu.cpus.reduce((acc, val) => acc + val.percentTotal, 0);
const cpuCount = systemInfo.info.cpu.cores; const cpuCount = systemInfo.info.cpu.cores;
// We use "info" object instead of the stats since this is the exact amount the kernel sees, which is what Unraid displays. const totalMemory = systemInfo.metrics.memory.total;
const totalMemory = systemInfo.info.memory.layout.reduce((acc, layout) => layout.size + acc, 0); const usedMemory = Math.max(totalMemory - systemInfo.metrics.memory.available, 0);
const usedMemory = totalMemory * (systemInfo.metrics.memory.percentTotal / 100);
const uptime = dayjs(systemInfo.info.os.uptime); const uptime = dayjs(systemInfo.info.os.uptime);
return { return {
@@ -136,11 +135,6 @@ export class UnraidIntegration extends Integration implements ISystemHealthMonit
brand, brand,
cores, cores,
threads threads
},
memory {
layout {
size
}
} }
} }
} }
@@ -60,13 +60,6 @@ export const unraidSystemInfoSchema = z.object({
cores: z.number(), cores: z.number(),
threads: z.number(), threads: z.number(),
}), }),
memory: z.object({
layout: z.array(
z.object({
size: z.number(),
}),
),
}),
}), }),
}); });