@squared-functions/module
Advanced tools
Comparing version 1.2.6 to 1.2.7
11
index.js
@@ -1,2 +0,2 @@ | ||
/* @squared-functions/module 1.2.6 | ||
/* @squared-functions/module 1.2.7 | ||
https://github.com/anpham6/squared-functions */ | ||
@@ -31,6 +31,6 @@ | ||
const ASYNC_FUNCTION = Object.getPrototypeOf(async () => { }).constructor; | ||
const [CPU_CORETIME, MEM_TOTAL] = (function () { | ||
const [CPU_CORETIME, CPU_CORETOTAL, MEM_TOTAL] = (function () { | ||
const lib = require('os'); | ||
const cpus = lib.cpus(); | ||
return [cpus.reduce((a, b) => a + b.times.user + b.times.sys, 0) / cpus.length, lib.totalmem()]; | ||
return [cpus.reduce((a, b) => a + b.times.user + b.times.sys, 0), cpus.length, lib.totalmem()]; | ||
})(); | ||
@@ -797,3 +797,3 @@ const [VER_MAJOR, VER_MINOR, VER_PATCH] = process.version.substring(1).split('.').map(value => +value); | ||
const { user, system } = process.cpuUsage(previous); | ||
const result = (user + system) / CPU_CORETIME; | ||
const result = (user + system) / (CPU_CORETIME * CPU_CORETOTAL); | ||
return format ? formatPercent(result) : result; | ||
@@ -809,4 +809,3 @@ } | ||
} | ||
result /= MEM_TOTAL; | ||
return format ? formatPercent(result) : result; | ||
return format ? formatPercent(result / MEM_TOTAL) : result; | ||
} | ||
@@ -813,0 +812,0 @@ static cleanupStream(writable, uri) { |
{ | ||
"name": "@squared-functions/module", | ||
"version": "1.2.6", | ||
"version": "1.2.7", | ||
"description": "Module extension class for squared-functions", | ||
@@ -18,3 +18,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@squared-functions/types": "1.2.6", | ||
"@squared-functions/types": "1.2.7", | ||
"uuid": "^8.3.2", | ||
@@ -21,0 +21,0 @@ "chalk": "^4.1.2" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40315
989
+ Added@squared-functions/types@1.2.7(transitive)
- Removed@squared-functions/types@1.2.6(transitive)