1.0.3 • Published 6 years ago

nuxt-pmx-module v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

:mag: PMX module

Add base pmx http, network and memory metrics to Nuxt.js project

npm npm

Following metrics are available at pm2 monit command:

  • pmx:http:latency - request processing time, same as pmx pmx:http:latency metric
  • HTTP - RPS counter, same as pmx HTTP metric
  • Network Download, Network Upload - default pmx network metric
  • Active handles, Active requests - default pmx network metric
  • memory:rss, memory:heapTotal, memory:heapUsed - memory usage of the Node.js process from process.memoryUsage()

Motivation

pmx.init({ http: true }) command has to be initialized before Nuxt http server, but there are no Nuxt hooks called before Nuxt server initialization, so we can't use built-in pmx http metric.

Setup

  • Add nuxt-pmx-module dependency using yarn or npm to your project
  • Add nuxt-pmx-module to modules section of nuxt.config.js
{
  modules: ['nuxt-pmx-module'],
}
  • Start your app with pm2: pm2 start app.js --name my-fancy-project
  • Open pm2 monit:

pm2 monit example