Comparing version 1.0.0 to 1.0.1
@@ -5,3 +5,6 @@ 'use strict'; | ||
var caculateCPU = function () { | ||
var lastTotal = 0; | ||
var lastIdle = 0; | ||
var calculateCPU = function () { | ||
var cpus = os.cpus(); | ||
@@ -15,3 +18,9 @@ var total = 0; | ||
} | ||
return 1 - idle / total; | ||
var diffTotal = total - lastTotal; | ||
var diffIdle = idle - lastIdle; | ||
lastTotal = total; | ||
lastIdle = idle; | ||
return 1 - diffIdle / diffTotal; | ||
}; | ||
@@ -28,3 +37,3 @@ | ||
load15: loadavg[2], | ||
cpu: caculateCPU() | ||
cpu: calculateCPU() | ||
}; | ||
@@ -39,1 +48,2 @@ }; | ||
}; | ||
{ | ||
"name": "agentx", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "agentx is powered by alinode", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
14913
483