metrics-0.3.0.0: 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

fromSnapshot :: Vector Double

A sorted Vector of samples.

Instances

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]

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.