0.3.9 • Published 2 years ago

@gamechanger/metrics v0.3.9

Weekly downloads
215
License
-
Repository
-
Last release
2 years ago

gcmetrics.js

GameChanger Metrics API. This node module provides an API for logging application metrics to the infrastructure's monitoring platform.

How to use

  1. Include gcmetrics.js in your app project by adding a line to your package.json file:

        ...
        "dependencies": {
            "gcmetrics": "git+ssh://git@github.com:gamechanger/gcmetrics.js.git"
        }
        ...
  2. Run npm install to install the package into your app's node_modules.

  3. Within your app, require gcmetrics and use this object to log metrics:

    var metrics = require('gcmetrics');
    
    metrics.registerDogStatsD(host, port); // run this once, before emitting any metrics
    metrics.increment('requests');
  4. That's it.

Notes

  • Each key logged to the metrics API is automatically prefixed with the enclosing application's name, as declared in the application's package.json file. For example, if I call metrics.increment('requests') within the "push" application, the actual key logged to DataDog will be push.requests.

TODO:

  • Push/Pop tag context
  • Chained API, e.g.
    metrics.timed('response').tag('http_code', 404).exec(cb);

Development

To install gcmetrics dependencies run npm install.

To run test run make test.

0.3.9

2 years ago

0.3.8

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.7

2 years ago

0.3.4

2 years ago

0.3.3

3 years ago

0.3.2

3 years ago

0.2.3

9 years ago