fix(core): update
This commit is contained in:
parent
c108c00963
commit
ce74c3da40
@ -58,9 +58,9 @@ export class SmartMetrics {
|
|||||||
let cpuPercentage = 0;
|
let cpuPercentage = 0;
|
||||||
for (const stat of Object.keys(stats)) {
|
for (const stat of Object.keys(stats)) {
|
||||||
if (!stats[stat]) continue;
|
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
|
// lets compute memory usage
|
||||||
let memoryUsageBytes = 0;
|
let memoryUsageBytes = 0;
|
||||||
@ -68,8 +68,8 @@ export class SmartMetrics {
|
|||||||
if (!stats[stat]) continue;
|
if (!stats[stat]) continue;
|
||||||
memoryUsageBytes += stats[stat].memory;
|
memoryUsageBytes += stats[stat].memory;
|
||||||
}
|
}
|
||||||
let memoryPercentage = Math.round((memoryUsageBytes / 1000000000) * 100) / 100;
|
let memoryPercentage = Math.round((memoryUsageBytes / 1000000000) * 100);
|
||||||
let memoryUsageText = `${memoryPercentage * 100}% | ${this.formatBytes(memoryUsageBytes)} / ${this.formatBytes(1000000000)}`;
|
let memoryUsageText = `${memoryPercentage}% | ${this.formatBytes(memoryUsageBytes)} / ${this.formatBytes(1000000000)}`;
|
||||||
|
|
||||||
console.log(`${cpuUsageText} ||| ${memoryUsageText} `);
|
console.log(`${cpuUsageText} ||| ${memoryUsageText} `);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user