metrics-0.4.1.1: High-performance application metric tracking

Safe HaskellNone
LanguageHaskell2010

Data.Metrics.Meter

Description

A meter measures the rate at which a set of events occur:

Meters measure the rate of the events in a few different ways. The mean rate is the average rate of events. It’s generally useful for trivia, but as it represents the total rate for your application’s entire lifetime (e.g., the total number of requests handled, divided by the number of seconds the process has been running), it doesn’t offer a sense of recency. Luckily, meters also record three different exponentially-weighted moving average rates: the 1-, 5-, and 15-minute moving averages.

(Just like the Unix load averages visible in uptime or top.)

Synopsis

Documentation

data Meter m Source #

A measure of the rate at which a set of events occurs.

meter :: IO (Meter IO) Source #

Create a new meter using an exponentially weighted moving average

mark :: PrimMonad m => Meter m -> m () Source #

Register a single occurrence of an event.

mark' :: PrimMonad m => Meter m -> Int -> m () Source #

Register multiple occurrences of an event.

mkMeter :: PrimMonad m => m NominalDiffTime -> m (Meter m) Source #

Create a meter using a custom function for retrieving the current time.

This is mostly exposed for testing purposes: prefer using "meter" if possible.