ekg-core- Tracking of system metrics

Safe HaskellNone




This module defines a type for tracking statistics about a series of events. An event could be handling of a request and the value associated with the event -- the value you'd pass to add -- could be the amount of time spent serving that request (e.g. in milliseconds). All operations are thread safe.



data Distribution Source

An metric for tracking events.

new :: IO Distribution Source

Create a new distribution.

add :: Distribution -> Double -> IO () Source

Add a value to the distribution.

addN :: Distribution -> Double -> Int64 -> IO () Source

Add the same value to the distribution N times.

read :: Distribution -> IO Stats Source

Get the current statistical summary for the event being tracked.

Gathered statistics

data Stats Source

Distribution statistics


mean :: Stats -> Double Source

Sample mean

variance :: Stats -> Double Source

Biased sample variance

count :: Stats -> Int64 Source

Event count

sum :: Stats -> Double Source

Sum of values

min :: Stats -> Double Source

Min value seen

max :: Stats -> Double Source

Max value seen