{"library":"pmx","title":"PMX","description":"PMX is the programmatic integration library for PM2 and Keymetrics.io (v1.6.8, latest stable). It enables Node.js applications to expose custom metrics (simple values, counters, meters, histograms), triggerable remote functions, exception alerts, custom events, and network traffic monitoring to the PM2 CLI and Keymetrics dashboard. Released irregularly with minor version bumps, it supports Node.js >= 0.10. Key differentiators: deep PM2/Keymetrics integration, low-overhead metric probes, and production monitoring without external monitoring services.","language":"javascript","status":"active","last_verified":"Sat May 09","install":{"commands":["npm install pmx"],"cli":{"name":"pmx","version":null}},"imports":["import pmx from 'pmx'","import pmx from 'pmx'; const probe = pmx.probe()","import type { Metric } from 'pmx'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pmx from 'pmx';\nimport http from 'http';\n\nconst probe = pmx.probe();\n\nconst users = {};\nconst metric = probe.metric({\n  name: 'Realtime user',\n  value: () => Object.keys(users).length\n});\n\nconst counter = probe.counter({ name: 'req/sec' });\n\nhttp.createServer((req, res) => {\n  counter.inc();\n  res.end('ok');\n}).listen(3000);\n\nconsole.log('Server running on port 3000');","lang":"javascript","description":"Initializes PMX, creates a metric tracking user count and a counter for HTTP requests.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}