mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-12 22:25:24 +03:00
Don't fail when cpu property is missing
This commit is contained in:
parent
b12514ed37
commit
8295a0de73
@ -163,10 +163,14 @@ export default function GeneralMetrics({
|
|||||||
series[key] = { name: key, data: [] };
|
series[key] = { name: key, data: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const data = stats.cpu_usages[detStats.pid.toString()].cpu;
|
||||||
|
|
||||||
|
if (data != undefined) {
|
||||||
series[key].data.push({
|
series[key].data.push({
|
||||||
x: statsIdx + 1,
|
x: statsIdx + 1,
|
||||||
y: stats.cpu_usages[detStats.pid.toString()].cpu,
|
y: data,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return Object.values(series);
|
return Object.values(series);
|
||||||
@ -300,11 +304,15 @@ export default function GeneralMetrics({
|
|||||||
series[key] = { name: key, data: [] };
|
series[key] = { name: key, data: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const data = stats.cpu_usages[procStats.pid.toString()].cpu;
|
||||||
|
|
||||||
|
if (data != undefined) {
|
||||||
series[key].data.push({
|
series[key].data.push({
|
||||||
x: statsIdx + 1,
|
x: statsIdx + 1,
|
||||||
y: stats.cpu_usages[procStats.pid.toString()].cpu,
|
y: data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return Object.keys(series).length > 0 ? Object.values(series) : [];
|
return Object.keys(series).length > 0 ? Object.values(series) : [];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user