Comparing version 2.0.16 to 2.0.17
@@ -38,1 +38,2 @@ 'use strict' | ||
module.exports = pidusage | ||
module.exports.clear = require('./lib/history').clear |
@@ -72,5 +72,19 @@ 'use strict' | ||
function deleteLoop (obj) { for (let i in obj) { delete obj[i] } } | ||
function clear () { | ||
if (interval !== null) { | ||
clearInterval(interval) | ||
interval = null | ||
} | ||
deleteLoop(history) | ||
deleteLoop(expiration) | ||
deleteLoop(expireListeners) | ||
} | ||
module.exports = { | ||
get: get, | ||
set: set | ||
set: set, | ||
clear: clear | ||
} |
@@ -115,4 +115,4 @@ var fs = require('fs') | ||
ctime: (stat.utime + stat.stime) / cpuInfo.clockTick, | ||
elapsed: date - (stat.start * 1000), | ||
timestamp: stat.start * 1000, // start date | ||
elapsed: (stat.uptime * 1000) - (stat.start * 1000), // process uptime minus start time | ||
timestamp: date, | ||
pid: pid, | ||
@@ -119,0 +119,0 @@ ppid: stat.ppid |
{ | ||
"name": "pidusage", | ||
"version": "2.0.16", | ||
"version": "2.0.17", | ||
"description": "Cross-platform process cpu % and memory usage of a PID", | ||
@@ -38,3 +38,3 @@ "license": "MIT", | ||
"mockery": "2.1.0", | ||
"nyc": "^13.0.0", | ||
"nyc": "13.0.0", | ||
"pify": "^3.0.0", | ||
@@ -41,0 +41,0 @@ "standard": "*", |
@@ -113,2 +113,6 @@ # pidusage | ||
### pidusage.clear() | ||
If needed this function can be used to clear the event loop. Indeed, we're registering an interval to free up the in-memory metrics. By calling this, it will clear this interval and all delete all in-memory data. | ||
## Related | ||
@@ -115,0 +119,0 @@ - [pidusage-tree][gh:pidusage-tree] - |
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
30980
661
142