| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Pickle
Synopsis
- type Tags = Map Text Text
- data StatsDConfig = StatsDConfig {
- statsdHost :: Text
- statsdPort :: Text
- statsdPrefix :: Text
- statsdTags :: Tags
- statsdVerbose :: Bool
- type MetricData a = (Show a, Real a)
- defaultConfig :: StatsDConfig
- setupPickle :: StatsDConfig -> IO ()
- metric :: MetricData a => Text -> Text -> a -> Maybe Tags -> Maybe Float -> IO ()
- gauge :: MetricData a => Text -> a -> Maybe Tags -> IO ()
- counter :: MetricData a => Text -> a -> Maybe Tags -> Maybe Float -> IO ()
- timer :: MetricData a => Text -> a -> Maybe Tags -> Maybe Float -> IO ()
- showT :: Show a => a -> Text
Documentation
type Tags = Map Text Text Source #
Tags for DogStatsD. Use empty text for rhs to send a keyed tag with no value. Example: M.fromList [("flag", "")]
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.
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.