fix(core): update

This commit is contained in:
Philipp Kunz 2021-08-14 22:47:31 +02:00
parent c108c00963
commit ce74c3da40

View File

@ -58,9 +58,9 @@ export class SmartMetrics {
let cpuPercentage = 0;
for (const stat of Object.keys(stats)) {
if (!stats[stat]) continue;
cpuPercentage += stats[stat].cpu / 100;
cpuPercentage += stats[stat].cpu;
}
let cpuUsageText = `${Math.round(cpuPercentage * 10000) / 100} %`;
let cpuUsageText = `${Math.round(cpuPercentage * 100) / 100} %`;
// lets compute memory usage
let memoryUsageBytes = 0;
@ -68,8 +68,8 @@ export class SmartMetrics {
if (!stats[stat]) continue;
memoryUsageBytes += stats[stat].memory;
}
let memoryPercentage = Math.round((memoryUsageBytes / 1000000000) * 100) / 100;
let memoryUsageText = `${memoryPercentage * 100}% | ${this.formatBytes(memoryUsageBytes)} / ${this.formatBytes(1000000000)}`;
let memoryPercentage = Math.round((memoryUsageBytes / 1000000000) * 100);
let memoryUsageText = `${memoryPercentage}% | ${this.formatBytes(memoryUsageBytes)} / ${this.formatBytes(1000000000)}`;
console.log(`${cpuUsageText} ||| ${memoryUsageText} `);