Giter Site home page Giter Site logo

node-amqp-stats's Introduction

Node.js Interface for RabbitMQ Management Statistics

This package creates an easy interface for getting statistics from a RabbitMQ instance with the management plugin installed. Read more about the management plugin here:

Required

You will need:

  1. An instance of RabbitMQ (running locally or in the cloud)
  2. The Management Plugin

Installation

npm install amqp-stats

Usage

Require the amqp-stats package:

var AMQPStats = require('amqp-stats');

Instantiate and provide authentication details (defaults to standard setup for a local instance).

var stats = new AMQPStats({
  username: "AMQP_USERNAME", // default: guest
  password: "AMQP_PASSWORD", // default: guest
  hostname: "AMQP_HOSTNAME",  // default: localhost:55672
  protocol: "HTTP_OR_HTTPS"  // default: http
});

NOTE: for RabbitMQ instances running on heroku, the hostname should look something like:

heroku.srs.rabbitmq.com/rabbitmq/sdaewywqh

From there you can use the stats instance to get data about your system's usage:

stats.overview(function(err, res, data){
  if (err) { throw err; }
  console.log('data: ', data);
});

This will return a list of your queues with lots of data about their rate of use, total messages sent, etc:

stats.queues(callback);

Note that when you lack admin privileges (on heroku instances for example) you may not be able to get at certain parts of this API. You can check your status with:

stats.whoami(callback);

node-amqp-stats's People

Contributors

dresende avatar pdehaan avatar timisbusy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.