fix CPU Display to show Real Core Usage
This commit is contained in:
@@ -80,10 +80,10 @@ async function getDockerStats() {
|
||||
const now = Date.now();
|
||||
const timeDiffMs = now - prev.time;
|
||||
|
||||
// Calculate CPU usage as percentage relative to the 6 cores limit
|
||||
// Calculate CPU usage as percentage relative to total host cores
|
||||
let cpuUsage = 0;
|
||||
if (systemDelta > 0 && timeDiffMs > 0) {
|
||||
cpuUsage = (cpuDelta / systemDelta) * (TOTAL_CORES / 6) * 100;
|
||||
cpuUsage = (cpuDelta / systemDelta) * TOTAL_CORES * 100;
|
||||
}
|
||||
|
||||
// Memory usage in GB
|
||||
|
Reference in New Issue
Block a user