hriemann-0.3.3.3: A Riemann Client for Haskell

Safe HaskellNone
LanguageHaskell2010

Network.Monitoring.Riemann.BatchClient

Synopsis

Documentation

newtype BatchClient Source #

Constructors

BatchClient (InChan LogCommand) 
Instances
MonadIO m => Client m BatchClient Source # 
Instance details

Defined in Network.Monitoring.Riemann.BatchClient

Methods

sendEvent :: BatchClient -> Event -> m () Source #

close :: BatchClient -> m () Source #

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 #