Skip to content

Commit b4e9e26

Browse files
committed
Update TrakerrClient
Update TrakerrClient to round on CPU and Memory percentages.
1 parent 4cea358 commit b4e9e26

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
_this.firstCpuTimes = getCPUS(os);
261261
}
262262
} catch (err) {
263-
263+
//ignored
264264
}
265265
}
266266

@@ -307,11 +307,11 @@
307307

308308
if (typeof _this.opsys !== 'undefined') {
309309
if (typeof appEvent.contextCpuPercentage === 'undefined') {
310-
appEvent.contextCpuPercentage = totalCPU();
310+
appEvent.contextCpuPercentage = Math.round(totalCPU());
311311
}
312312

313313
if(typeof appEvent.contextMemoryPercentage === 'undefined'){
314-
appEvent.contextMemoryPercentage = ((_this.opsys.totalmem() - _this.opsys.freemem())/_this.opsys.totalmem()) * 100
314+
appEvent.contextMemoryPercentage = Math.round(((_this.opsys.totalmem() - _this.opsys.freemem())/_this.opsys.totalmem()) * 100);
315315
}
316316
}
317317
else{

0 commit comments

Comments
 (0)