Instruments allows you to collects metrics over discrete time intervals. This a fork of the (original library)[https://github.com/heroku/instruments] which comes with several new additions - consider it a v2!
Collected metrics will only reflect observations from last time window only, rather than including observations from prior windows, contrary to EWMA based metrics.
The new features include:
- Slighly faster
- More convenient API
- Support for tags
- Built-in reporters
- Accurate histograms
Instruments support two types of instruments: Discrete instruments return a single value, and Sample instruments a sorted array of values.
These base instruments are available:
- Counter: a simple counter.
- Rate: tracks the rate of values per seconds.
- Reservoir: randomly samples values.
- Derive: tracks the rate of values based on the delta with previous value.
- Gauge: tracks last value.
- Timer: tracks durations.
You can create custom instruments or compose new instruments form the built-in instruments as long as they implements the Sample or Discrete interfaces.
Please see the API documentation for package and API descriptions and examples.