feat: initial node groups #44

Merged
max merged 44 commits from feat/group-node-own into main 2026-05-05 22:08:18 +02:00
Showing only changes of commit db5ee8ba29 - Show all commits
+6 -13
View File
@@ -22,22 +22,15 @@ export async function readCpuSnapshot(): Promise<CpuSnapshot> {
const stat = await readFile('/proc/stat', 'utf8');
const line = stat.split('\n')[0];
const parts = line
const parts: number[] = line
.trim()
.split(/\s+/)
.slice(1)
.map(v => Number(v));
.map((v: unknown) => Number(v));
const [
user,
nice,
system,
idle,
iowait,
irq,
softirq,
steal
] = parts;
const idle = parts[3];
const iowait = parts[4];
const steal = parts[7];
return {
idle: idle + iowait,
@@ -74,7 +67,7 @@ export async function readCgroupCpuStat() {
for (const path of possiblePaths) {
try {
const txt = await readFile(path, 'utf8');
const txt: string = await readFile(path, 'utf8');
return Object.fromEntries(
txt