springernature / boomcatch

A standalone, node.js-based beacon receiver for boomerang.
GNU General Public License v3.0
110 stars 33 forks source link
boomerang

boomcatch

A standalone, node.js-based beacon receiver for boomerang. Read more.

Build Status

Installation

At the system level

First you must install node.

You can then install boomcatch via npm:

npm install -g boomcatch

Local to a node.js project

Add boomcatch to the dependencies in your project's package.json, then run:

npm install

Usage

From the command line

To see the list of command line options run:

boomcatch --help

Available options are:

From a node.js project

var path = require('path');
var boomcatch = require('boomcatch');

boomcatch.listen({
    host: 'rum.example.com',                  // Defaults to '0.0.0.0' (INADDR_ANY)
    port: 8080,                               // Defaults to 80 for HTTP or 443 for HTTPS
    https: true,                              // Defaults to false
    httpsKey: 'foo.key',
    httpsCert: 'bar.cert',
    httpsPass: 'baz',
    path: '/perf',                            // Defaults to '/beacon'
    referer: /^\w+\.example\.com$/,           // Defaults to /.*/
    origin: [                                 // Defaults to '*'
    'http://foo.example.com',
    'http://bar.example.com'
    ],
    limit: 100,                               // Defaults to 0
    maxSize: 1048576,                         // Defaults to -1
    log: console,                             // Defaults to object with `info`, `warn` and `error` log functions.
    workers: require('os').cpus().length,     // Defaults to 0
    validator: path.resolve('./myvalidator'), // Defaults to 'permissive'
    mapper: path.resolve('./mymapper'),       // Defaults to 'statsd'
    prefix: 'mystats.rum.',                   // Defaults to ''
    forwarder: 'http',                        // Defaults to 'udp'
    fwdUrl: 'https://stats.example.com/',     // No default
    fwdMethod: 'POST'                         // Defaults to 'GET'
});

Extensions

Boomcatch implements four extension points to control how beacon requests are handled: validators, filters, mappers and forwarders. These extension points are invoked as a pipeline when a beacon request is received.

boomcatch extensions' diagram

Several extensions are shipped as part of Boomcatch, or you can implement your own custom extensions.

You can read more details in the documentation about extensions.

Development

Before submitting any pull requests, please ensure that you have adhered to the contribution guidelines.

To clone the repository:

git clone git@github.com:nature/boomcatch.git

To set up the development environment:

npm install

To lint the code:

npm run lint

To run the unit tests:

npm test

Change log

History

Support

You can have a look at the Springer Nature Frontend Playbook for an explanation of how we support our open source projects.

License

GPL 3

Copyright © 2014, 2015, 2016 Springer Nature