hriemann-0.2.1.0: Initial project template from stack

Safe HaskellNone
LanguageHaskell2010

Network.Monitoring.Riemann.BatchClient

Synopsis

Documentation

data BatchClient Source #

Constructors

BatchClient (InChan LogCommand) 

Instances

data LogCommand Source #

Constructors

Event Event 
Stop (MVar ()) 

batchClient :: HostName -> Port -> Int -> Int -> (Event -> IO ()) -> IO BatchClient Source #

A new BatchClient

The BatchClient is a Client that will do the following

  • Batch events into a specified batch size
  • If events are produced more quickly than Riemann can cope with, they will be passed to the overflow function

Batching events is important for throughput, see https://aphyr.com/posts/269-reaching-200k-events-sec

It is important to deal with back pressure, if the buffer of events to be sent to Riemann fills up, they will be passed to the overflow function until the buffer has space again. This overflow function can be as simple as print

Current time and host name will be set if not provided.

''Note'': We never use IPv6 address resolved for given hostname.

drainAll :: Queue a -> Int -> IO (Seq a) Source #