metrics-0.4.0.1: High-performance application metric tracking

Safe HaskellNone
LanguageHaskell2010

Data.Metrics.Snapshot

Description

 

Synopsis

Documentation

newtype Snapshot Source #

A wrapper around a *sorted* vector intended for calculating quantile statistics.

Constructors

Snapshot 

Fields

quantile :: Double -> Snapshot -> Double Source #

Calculate an arbitrary quantile value for a Snapshot. Values below zero or greater than one will be clamped to the range [0, 1]. Returns 0 if no values are in the snapshot

size :: Snapshot -> Int Source #

Get the number of elements in a Snapshot

median :: Snapshot -> Double Source #

Calculate the median value of a Snapshot

get75thPercentile :: Snapshot -> Double Source #

Calculate the 75th percentile of a Snapshot

get95thPercentile :: Snapshot -> Double Source #

Calculate the 95th percentile of a Snapshot

get98thPercentile :: Snapshot -> Double Source #

Calculate the 98th percentile of a Snapshot

get99thPercentile :: Snapshot -> Double Source #

Calculate the 99th percentile of a Snapshot

get999thPercentile :: Snapshot -> Double Source #

Calculate the 99.9th percentile of a Snapshot

takeSnapshot :: PrimMonad m => MVector (PrimState m) Double -> m Snapshot Source #

A utility function for snapshotting data from an unsorted MVector of samples.

NB: this function uses "unsafeFreeze" under the hood, so be sure that the vector being snapshotted is not used after calling this function.