From 8f0ebccb58216594c5e0d86bd18b03815eaf4cfd Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Fri, 13 Aug 2021 13:13:11 +0200 Subject: [PATCH] fix(core): update --- ts/smartmetrics.classes.smartmetrics.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ts/smartmetrics.classes.smartmetrics.ts b/ts/smartmetrics.classes.smartmetrics.ts index 557cf54..211f1ca 100644 --- a/ts/smartmetrics.classes.smartmetrics.ts +++ b/ts/smartmetrics.classes.smartmetrics.ts @@ -49,11 +49,9 @@ export class SmartMetrics { cpu.times.irq + cpu.times.idle; } - - // Normalize the one returned by process.cpuUsage() - // (microseconds VS miliseconds) + const usage = process.cpuUsage(); - const currentCPUUsage = (usage.user + usage.system) * 1000; + const currentCPUUsage = (usage.user + usage.system); // Find out the percentage used for this specific CPU const perc = (currentCPUUsage / total) * 100;