fix(unraid): use byte-based memory metrics
This commit is contained in:
1 parent
35155b18b9
commit
f677e23d09
2 files changed
+2
-15
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(),
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
}),
|
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user