ekg-core-0.1.1.6: Tracking of system metrics

Safe Haskell | None
Language | Haskell2010

System.Metrics.Distribution

Contents

- Gathered statistics

Description

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.

Synopsis

- data Distribution
- new :: IO Distribution
- add :: Distribution -> Double -> IO ()
- addN :: Distribution -> Double -> Int64 -> IO ()
- read :: Distribution -> IO Stats
- data Stats
- mean :: Stats -> Double
- variance :: Stats -> Double
- count :: Stats -> Int64
- sum :: Stats -> Double
- min :: Stats -> Double
- max :: Stats -> Double

# Documentation

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

Instances

Eq Stats Source # |
Instance details Defined in System.Metrics.Distribution.Internal Methods (==) :: Stats -> Stats -> Bool Source # (/=) :: Stats -> Stats -> Bool Source #
Show Stats Source # |
Instance details Defined in System.Metrics.Distribution.Internal Methods showsPrec :: Int -> Stats -> ShowS Source # show :: Stats -> String Source # showList :: [Stats] -> ShowS Source #

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