问题
Are there any standard metrics publishing packages for node.js? I'm not asking about general metrics libraries, but rather packages that produce a specific set of metrics (e.g. http QPS, runtime memory usage, gc stats, etc...) If you wanted to offer a monitoring service for node.js users, what would you monitor?
回答1:
I believe that Node Application Metrics ('appmetrics') provides what your looking for. This is a module that provides a set of metrics about a running Node.js process, rather than a monitoring solution in itself.
In version 1.0.2 is provides the following data types:
- Environment
- CPU
- Memory
- GC
- Function profiling
- HTTP
- MySQL
- MongoDB
- Request tracking
- Function trace
回答2:
I'm not aware of any package that provides all of that metrics but you can collect most using very popular libraries like pidusage for process related metrics, mongodb driver to retrieve mongo stats, etc
You may read here (my post, bullet 12) about memory profiling
来源:https://stackoverflow.com/questions/29905547/standard-node-js-metrics