Skip to content

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

Notifications You must be signed in to change notification settings

n1ru/nuxt-pmx-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🔍 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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published