rm-metrics
v1.1.2
Published
Expose node metrics with express router
Downloads
3
Readme
Description
Expose node metrics with express router
Install
Go into a node project and type the following :
$> npm install rm-metrics
Exemple
Run
$> node exemple.js
$> curl http://localhost:3000/metrics
The module creates the following routes :
/metrics
will return various metrics
/slow
will wait using the cpu (sync) to generate eventloop lag. Either a random time between 0 and 1 sec. Or you can specify a number of ms from querystring (/slow?ms=100)
/leak
will cause a leak by allocating a random big string in the global namespace
/leakclean
will remove all allocated strings.
log format
This package calls the logger in that way :
logger[level](key, message, obj, callback);
- level : can be info, error, warn
- key : the package name
- message : blablabla
- obj (optional) : additional data in an object
- callback (optional) : called when the data is logged