pickle-1.0.0.0: Instant StatsD in Haskell

Safe HaskellNone
LanguageHaskell2010

Data.Pickle

Synopsis

Documentation

type Tags = Map Text Text Source #

Tags for DogStatsD

data StatsDConfig Source #

Configuration for the UDP connection used

Constructors

StatsDConfig 

Fields

type MetricData a = (Show a, Real a) Source #

Something that can be sent as a metric.

defaultConfig :: StatsDConfig Source #

Default config used for StatsD UDP connection ()

setupPickle :: StatsDConfig -> IO () Source #

Start up our statsd client. You probably want to do this first in main:

main = do

setupPickle defaultConfig ...

Subsequent calls to setupPickle will close the existing connection and create a new one with the updated settings. If multiple threads race to setup the connection, the last one to finish wins.

metric Source #

Arguments

:: MetricData a 
=> Text

metric kind in character form (g,c,ms,s)

-> Text

metric name

-> a

metric value

-> Maybe Tags

Tags for metric

-> Maybe Float

Sampling rate for applicable metrics.

-> IO () 

Send a metric. Parses the options together. This function makes a best-effort to send the metric; no metric-sending exceptions will be thrown. The metric won't be sent if setupPickle hasn't been called yet.

gauge :: MetricData a => Text -> a -> Maybe Tags -> IO () Source #

Send a gauge.

counter :: MetricData a => Text -> a -> Maybe Tags -> Maybe Float -> IO () Source #

Send a counter.

timer :: MetricData a => Text -> a -> Maybe Tags -> Maybe Float -> IO () Source #

Send a timer.

showT :: Show a => a -> Text Source #

Internal utility to show something as Text