mikejihbe / metrics

A metrics library for Node.js
574 stars 58 forks source link

meter should expose current rate per second #53

Open mseld opened 6 years ago

mseld commented 6 years ago

meter should expose current rate per second

{
    "meter": {
        "type": "meter",
        "count": 60,
        "currentRate": 7, // expose 
        "m1": 0.1968129595640299,
        "m5": 0.1356642465884818,
        "m15": 0.057142134744181075,
        "mean": 0.3178959526546961,
        "unit": "seconds"
    }
}
tolbertam commented 5 years ago

This may be possible, although I think the utility of it may be limited. The m1/m5/m15 metrics record rate per second over those time period. Rate over the last second is compelling, but because of #37, it's not a good idea as it would require configuring an interval to run every 1 second. If we fix that, this may be possible although I'm not sure how well ExponentiallyWeightedMovingAverage works over short time periods. I'll evaluate as part of #37.