npm

npm’s 2019 JavaScript ecosystem survey analysis is now available! Get your copy here »

rhq-metrics-middleware

0.1.0 • Public • Published

rhq-metrics-middleware

Middleware for express and connect apps to inject system and site data into rhq-metrics as timeseries data.

Documentation

Docs can be found here: http://lanceball.com/rhq-metrics-middleware

Usage

// load the RHQ middleware module
var rhq = require('rhq-metrics-middleware');

var express = require('express');
var app = express();

app.set('port', 9000);

// Use the rhq-metrics-middleware module.
// By default the module will insert the following data:
// load-1: 1 minute load average. See `os.loadavg()`
// load-5: 5 minute load average. See `os.loadavg()`
// load-15: 15 minute load average. See `os.loadavg()`
// free-memory: Current free memory. See `os.freemem()`
// response-time: Response time for the current request.
app.use(rhq({
  host: 'metricserver.mydomain.com', // default is localhost
  port: 4567, // default is 8080
  path: '/rhq-metrics/metrics' // default
  }));

app.get('/*', function(req, res) {
  res.send('Well hello there');
});

var server = app.listen(app.settings.port, function () {
  var addr = server.address();
  console.log('listening at http://%s:%s', addr.address, addr.port);
});

install

npm i rhq-metrics-middleware

Downloadsweekly downloads

4

version

0.1.0

license

Apache-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability