npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

parade

v2.1.0

Published

Parade is a cluster manager and also a process monitor for node.js applications.

Downloads

13

Readme

parade

parade is a cluster manager and also a process monitor for node.js applications. It forks multiple instances (process) of your application based on the number of cores available in the CPU and provides restful endpoints that provide data to track status, memory and cpu for individual node processes and servers.

NPM Version Build Status

Why Parade

  • nodejs runs on single thread which would not fully utilize all cores available in the server. parade is a command line utility which forks multiple worker process of the application to fully utilize all the cores of the server.

  • It helps to keep the application running forever without any downtime by automatically forking new workers whenever a worker process dies.

  • It helps to manage multiple worker processes by giving availability and usage stats on a web api.

  • Its open source and will remain open source.

Installation

$ npm install -g parade

Start the app

$ parade <app.js> [clusters]

Arguments

  • app.js: the main js file of your application
  • clusters (optional): # of worker process to fork. By default, it is set to (# of cores - 1)

Examples

To run your app

$ parade app.js
$ parade app.js 3

To run the example in this module

$ parade example/app.js
$ parade example/app.js 3

Argument 3, worker file name: example/app.js
Number of process forks  : 3
parade web api server running in 5667
Worker is online, Worker ID :  1
Worker is online, Worker ID :  2
Worker is online, Worker ID :  3

Tests

$ npm install
$ npm test

Rest Endpoints

Start the app with parade and test the following rest end points

$ parade app.js

Stats

It gets metrics of all worker processes

http://localhost:5667/api/stats

Sample result

{
  "processStats": [
    {
      "pid": 12335,
      "memory": 39047168,
      "cpu": 0
    },
    {
      "pid": 12337,
      "memory": 42954752,
      "cpu": 0
    }
  ],
  "osStats": {
    "totalMem": 4009091072,
    "freeMem": 1395204096,
    "cpus": [
      {
        "model": "Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz",
        "speed": 2599,
        "times": {
          "user": 125852300,
          "nice": 334700,
          "sys": 59101600,
          "idle": 108351690500,
          "irq": 54764100
        }
      },
      {
        "model": "Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz",
        "speed": 2599,
        "times": {
          "user": 57877800,
          "nice": 343100,
          "sys": 31694400,
          "idle": 108823011800,
          "irq": 0
        }
      }
    ],
    "loadAvg": [
      0,
      0,
      0
    ],
    "uptime": 10986836.192939406,
    "platform": "linux"
  }
}

Status

It gets the status of all worker processes

http://localhost:5667/api/status

Sample result

{
  "1": {
    "workerId": 1,
    "uniqueId": 1,
    "processId": 12335,
    "status": "ONLINE"
  },
  "2": {
    "workerId": 2,
    "uniqueId": 2,
    "processId": 12337,
    "status": "ONLINE"
  }
}

Credits

License

The MIT License