/seneca-msgstats

seneca-msgstats

Primary LanguageJavaScriptMIT LicenseMIT

seneca-msgstats

Node.js Seneca Message Statistics

This module is a plugin for the Seneca framework. It provides a message throughput statistics.

Current Version: 0.1.2

Tested on: Seneca 0.6.0, Node 0.10.33

Quick example

var influxOptions = { host:'localhost',
                      port: 8086,
                      username:'root',
                      password:'root',
                      database:'test_db',
                      seriesName:'test_series'
                    };
seneca.use('msgstats', {pin:{}, influxOpts:influxOptions});

Options can also be set in options.mine.js, e.g:

msgstats: {
    pin:{},
    influxOpts:{
      host:'localhost',
      port: 8086,
      username:'root',
      password:'root',
      database:'test_db2',
      seriesName:'actions'
    }
  }

seneca.use('msgstats');

Requirements

InfluxDB must be installed. Please see the installation guide here: http://influxdb.com/docs/v0.6/introduction/installation.html

Install

npm install seneca
npm install seneca-msgstats

Capturing Seneca Actions

To capture all seneca actions, set the pin in the options to:

pin: {}

To only capture role:web actions, set the pin to:

pin: {role:'web'}

Message Patterns

Foo.

  • role:msgstats, cmd:foo foo

Bar.

Test

mocha test/*.test.js