Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype BatchClient = BatchClient (InChan LogCommand)
- newtype BatchClientNoBuffer = BatchClientNoBuffer (Queue LogCommand)
- data LogCommand
- batchClient :: HostName -> Port -> Int -> Int -> (Event -> IO ()) -> IO BatchClient
- bufferlessBatchClient :: HostName -> Port -> Int -> IO BatchClientNoBuffer
- overflowConsumer :: OutChan LogCommand -> Queue LogCommand -> Int -> (Event -> IO ()) -> IO ()
- drainAll :: Queue a -> Int -> IO (Seq a)
- riemannConsumer :: Int -> Queue LogCommand -> TCPConnection -> IO ()
Documentation
newtype BatchClient Source #
Instances
MonadIO m => Client m BatchClient Source # | |
Defined in Network.Monitoring.Riemann.BatchClient sendEvent :: BatchClient -> Event -> m () Source # close :: BatchClient -> m () Source # |
newtype BatchClientNoBuffer Source #
Instances
MonadIO m => Client m BatchClientNoBuffer Source # | |
Defined in Network.Monitoring.Riemann.BatchClient sendEvent :: BatchClientNoBuffer -> Event -> m () Source # close :: BatchClientNoBuffer -> m () Source # |
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.
bufferlessBatchClient :: HostName -> Port -> Int -> IO BatchClientNoBuffer Source #
overflowConsumer :: OutChan LogCommand -> Queue LogCommand -> Int -> (Event -> IO ()) -> IO () Source #
riemannConsumer :: Int -> Queue LogCommand -> TCPConnection -> IO () Source #