Socket
Socket
Sign inDemoInstall

pmx

Package Overview
Dependencies
Maintainers
3
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pmx

PM2/Keymetrics advanced API


Version published
Weekly downloads
208K
increased by5.22%
Maintainers
3
Weekly downloads
 
Created

What is pmx?

The pmx npm package is a monitoring and profiling tool designed to work with Node.js applications. It provides functionalities for monitoring application performance, tracking metrics, and handling exceptions. It integrates seamlessly with PM2, a popular process manager for Node.js applications, to provide enhanced monitoring and management capabilities.

What are pmx's main functionalities?

Custom Metrics

This feature allows you to create custom metrics to monitor specific aspects of your application. In this example, a custom metric is created to track the number of real-time users.

const pmx = require('pmx');

const probe = pmx.probe();

const metric = probe.metric({
  name: 'Realtime user',
  value: function() {
    return Object.keys(users).length;
  }
});

Custom Actions

Custom actions allow you to define specific actions that can be triggered remotely. In this example, a custom action 'refresh:db' is defined to refresh the database.

const pmx = require('pmx');

pmx.action('refresh:db', (reply) => {
  // Refresh the database
  reply({ success: true });
});

Error Management

This feature enables automatic error management by catching all uncaught exceptions and unhandled rejections. It helps in tracking and logging errors effectively.

const pmx = require('pmx');

pmx.catchAll();

Event Tracking

Event tracking allows you to emit custom events and track them. In this example, a custom event 'user:register' is emitted with user data.

const pmx = require('pmx');

pmx.emit('user:register', { user: 'John Doe' });

Other packages similar to pmx

Keywords

FAQs

Package last updated on 22 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc