metricify
Metrics Done Easy
Last updated 3 years ago by dirwin517 .
UNLICENSED · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install metricify 
SYNC missed versions from official npm registry.

metricify

Metrics Done Easy

npm version dependencies Build Status Pledge To Arupex! lifetimeDownloadCount

Install

    npm install metricify --save

Usage

    function optionalCallbackOnAllMetersFinish(meterResult){
        console.log(JSON.stringify(meterResult, null, 3));
    }

    var Metrics = require('metricify');

    var factory = new Metrics(optionalCallbackOnAllMetersFinish);

    var myMeter = factory.meter('myMeter');

    //do some stuff
    for(var i = 0; i < 10000; ++i){}

    myMeter.end();


    //factory.getMeters(); returns meter min/max and data points

    //factory.calcMetrics(); //returns detailed stats using stats-lite

Promises

// creates a meter that starts at function call, and ends when promise is resolved
// lets you force the scope incase your function calls assuming some scope
factory.promiseMeter('my-meter-name', functionThatResultsInPromise, argumentsToFunctionCallAsArray, forceScope)

Current Tags

  • 2.0.1                                ...           latest (3 years ago)

4 Versions

  • 2.0.1                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |