https://github.com/abhin4v/purescript-metrics
A metrics library for PureScript
https://github.com/abhin4v/purescript-metrics
instrumentation metrics purescript
Last synced: 4 months ago
JSON representation
A metrics library for PureScript
- Host: GitHub
- URL: https://github.com/abhin4v/purescript-metrics
- Owner: abhin4v
- License: mit
- Created: 2017-11-15T12:29:14.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-20T11:37:30.000Z (over 8 years ago)
- Last Synced: 2026-02-01T18:30:31.264Z (4 months ago)
- Topics: instrumentation, metrics, purescript
- Language: PureScript
- Size: 18.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# purescript-metrics
A metrics library for PureScript inspired by the Haskell library [ekg](https://github.com/tibbe/ekg-core). It is a wrapper upon the JavaScript [metrics library](https://github.com/mikejihbe/metrics) which itself is a port of the Java Dropwizard [metrics library](http://metrics.dropwizard.io/).
API documentation can be found in [Pursuit](https://pursuit.purescript.org/packages/purescript-metrics).
## Sample Usage
```haskell
main = do
store <- newStore
counter <- createOrGetCounter "counter" store
gauge <- createOrGetGauge "gauge" (pure 3) store
hist <- createOrGetHistogramWithExponentialDecaySampling "hist" 1028 0.015 store
meter <- createOrGetMeter "meter" store
timer <- createOrGetTimer "timer" store
Counter.inc counter 2
Histogram.update hist 1.2
Histogram.update hist 2.1
Meter.mark meter
Timer.update timer (Milliseconds 1000.0)
launchAff $ sample store >>= logShow
```