You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

performance-nodejs

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

performance-nodejs - npm Package Compare versions

Comparing version

to
1.0.6

History.md

@@ -67,2 +67,12 @@ 'use strict';

function getMemoryUsage(unit) {
const data = process.memoryUsage();
const keys = Object.keys(data);
const result = {};
keys.forEach((key) => {
result[key] = format(data[key], unit);
});
return result;
}
function get(arr, filter, defaultValue) {

@@ -119,2 +129,3 @@ let result;

cpuUsage: getCpuUsage(cpuUsage, start),
memoryUsage: getMemoryUsage(unitInfo),
});

@@ -121,0 +132,0 @@ start = process.hrtime();

4

package.json
{
"name": "performance-nodejs",
"description": "get nodejs performance, such as: heap statistics, event loop delay",
"version": "1.0.5",
"version": "1.0.6",
"author": "Tree Xie <vicansocanbico@gmail.com>",

@@ -34,2 +34,2 @@ "keywords": [

"license": "MIT"
}
}

@@ -18,9 +18,9 @@ # performance-nodejs

## Examples
View the [./examples](examples) directory for working examples.
View the [./examples](examples) directory for working examples.
## Description
The `performance()` function get node.js performance (include event loop, heap statistics and heap space statistics).
The `performance()` function get node.js performance (include event loop, heap statistics and heap space statistics).

@@ -39,3 +39,3 @@ * If node.js support v8.getHeapSpaceStatistics(), the heap space will be return.

Returns: A reference to the timer. Useful for clearing the timer.
Returns: A reference to the timer. Useful for clearing the timer.

@@ -99,2 +99,8 @@

"total": 474737
},
"memoryUsage": {
"rss": 20,
"heapTotal": 5,
"heapUsed": 4,
"external": 0
}

@@ -101,0 +107,0 @@ }