fix(core): update

This commit is contained in:
Philipp Kunz 2021-08-14 21:37:52 +02:00
parent 0972f1c64d
commit dd46f0d90b

View File

@ -60,7 +60,7 @@ export class SmartMetrics {
if (!stats[stat]) continue;
cpuPercentage += stats[stat].cpu / 100;
}
let cpuUsageText = `${cpuPercentage * 100} %`;
let cpuUsageText = `${Math.round(cpuPercentage * 10000) / 100} %`;
// lets compute memory usage
let memoryUsageBytes = 0;
@ -71,6 +71,8 @@ export class SmartMetrics {
let memoryUsageText = `${this.formatBytes(memoryUsageBytes)} / ${this.formatBytes(plugins.os.totalmem())}`;
let memoryPercentage = Math.round((memoryUsageBytes / plugins.os.totalmem()) * 100) / 100;
// console.log(`${cpuUsageText} ||| ${memoryUsageText} `);
const returnMetrics: interfaces.IMetricsSnapshot = {
originalMetrics,
process_cpu_seconds_total: (