Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- initWorkerCSV :: ConnectInfo -> FilePath -> Int -> AggProcessConfig -> IO ()
- initWorkerCSV' :: FilePath -> AggProcessConfig -> IO AggProcess
- initWorkerGraphite :: ConnectInfo -> Int -> HostName -> Int -> AggProcessConfig -> IO ()
- initWorkerGraphite' :: HostName -> Int -> AggProcessConfig -> IO AggProcess
- work :: Connection -> Int -> AggProcess -> IO ()
- initWorker :: String -> ConnectInfo -> Int -> AggProcess -> IO ()
- data AggProcess = AggProcess {
- apConfig :: AggProcessConfig
- apProc :: Aggregated -> Redis ()
- data AggProcessConfig = AggProcessConfig {
- metricQuantiles :: MetricName -> Set Quantile
- standardQuantiles :: MetricName -> Set Quantile
- noQuantiles :: MetricName -> Set Quantile
- quantileMap :: Map MetricName (Set Quantile) -> Set Quantile -> MetricName -> Set Quantile
- defAggProcessConfig :: AggProcessConfig
- expandDims :: forall packets. (Monoid packets, Eq packets) => Map Dimensions packets -> Map Dimensions packets
Documentation
:: ConnectInfo | |
-> FilePath | Target file name |
-> Int | Aggregation period / flush interval in seconds |
-> AggProcessConfig | |
-> IO () |
A CSV backend to store aggregation results in a CSV
:: FilePath | Target file name |
-> AggProcessConfig | |
-> IO AggProcess |
Create an AggProcess that dumps to CSV. Use this to compose with other AggProcesses
:: ConnectInfo | Redis connection |
-> Int | Aggregation period / flush interval in seconds |
-> HostName | Graphite host |
-> Int | Graphite port |
-> AggProcessConfig | |
-> IO () |
Initialize a Graphite backend
:: HostName | Graphite host |
-> Int | Graphite port |
-> AggProcessConfig | |
-> IO AggProcess |
Crete an AggProcess that dumps to graphite. Use this to compose with other AggProcesses
work :: Connection -> Int -> AggProcess -> IO () Source #
Go over all pending stats buffers in redis.
initWorker :: String -> ConnectInfo -> Int -> AggProcess -> IO () Source #
Generic utility for making worker backends. Will retry indefinitely with exponential backoff.
data AggProcess Source #
A function that does something with the aggregation results. Can implement multiple backends simply using this. Note that Semigroup and Monoid instances are provided for defaulting and combining agg processes.
AggProcess | |
|
Instances
Monoid AggProcess Source # | |
Defined in Instrument.Worker mempty :: AggProcess # mappend :: AggProcess -> AggProcess -> AggProcess # mconcat :: [AggProcess] -> AggProcess # | |
Semigroup AggProcess Source # | |
Defined in Instrument.Worker (<>) :: AggProcess -> AggProcess -> AggProcess # sconcat :: NonEmpty AggProcess -> AggProcess # stimes :: Integral b => b -> AggProcess -> AggProcess # |
Configuring agg processes
data AggProcessConfig Source #
General configuration for agg processes. Defaulted with def
,
defAggProcessConfig
, and mempty
. Configurations can be combined
with (<>) from Monoid or Semigroup.
AggProcessConfig | |
|
Instances
Monoid AggProcessConfig Source # | |
Defined in Instrument.Worker | |
Semigroup AggProcessConfig Source # | |
Defined in Instrument.Worker (<>) :: AggProcessConfig -> AggProcessConfig -> AggProcessConfig # sconcat :: NonEmpty AggProcessConfig -> AggProcessConfig # stimes :: Integral b => b -> AggProcessConfig -> AggProcessConfig # | |
Default AggProcessConfig Source # | |
Defined in Instrument.Worker def :: AggProcessConfig # |
standardQuantiles :: MetricName -> Set Quantile Source #
This is usually a good, comprehensive default. Produces quantiles 10,20,30,40,50,60,70,80,90,99. *Note:* for some backends like cloudwatch, each quantile produces an additional metric, so you should probably consider using something more limited than this.
noQuantiles :: MetricName -> Set Quantile Source #
Regardless of metric, produce no quantiles.
:: Map MetricName (Set Quantile) | |
-> Set Quantile | What to return on miss |
-> MetricName -> Set Quantile |
If you have a fixed set of metric names, this is often a convenient way to express quantiles-per-metric.
Exported for testing
expandDims :: forall packets. (Monoid packets, Eq packets) => Map Dimensions packets -> Map Dimensions packets Source #
Take a map of packets by dimensions and *add* aggregations of the existing dims that isolate each distinct dimension/dimensionvalue pair + one more entry with an empty dimension set that aggregates the whole thing. worked example:
Given: { {d1=>d1v1,d2=>d2v1} => p1 , {d1=>d1v1,d2=>d2v2} => p2 } Produces: { {d1=>d1v1,d2=>d2v1} => p1 , {d1=>d1v1,d2=>d2v2} => p2 , {d1=>d1v1} => p1 + p2 , {d2=>d2v1} => p1 , {d2=>d2v2} => p2 , {} => p1 + p2 }