Portability | non-portable (GHC extensions) |
---|---|
Stability | experimental |
Maintainer | Brendan Hay <brendan.g.hay@gmail.com> |
Safe Haskell | None |
- data Handle = Handle Socket SockAddr
- type Host = ByteString
- type Group = ByteString
- type Bucket = ByteString
- data Metric
- data AnyMeasurable = forall a . Measurable a => AnyMeasurable a
- data AnySink = forall a . Sink a => AnySink a
- class Measurable a where
- class (Show a, Typeable a) => Encodable a where
- encode :: a -> ByteString
- class Sink a where
- push :: Measurable b => a -> b -> IO ()
- close :: a -> IO ()
- key :: Maybe Host -> Group -> Bucket -> ByteString
- fOpen :: Sink a => (Handle -> a) -> SocketType -> HostName -> PortNumber -> IO AnySink
- hOpen :: SocketType -> HostName -> PortNumber -> IO Handle
- hClose :: Handle -> IO ()
- hPush :: Handle -> ByteString -> IO ()
- type HostName = String
- data PortNumber
Exported Types
type Host = ByteStringSource
Metric host
type Group = ByteStringSource
Metric group
type Bucket = ByteStringSource
Metric bucket
Existential Types
data AnyMeasurable Source
Any instance of the Measurable type class
forall a . Measurable a => AnyMeasurable a |
Any instance of the Sink type class
Exported Type Classes
class Measurable a whereSource
Measure a type for a collection of metrics
class (Show a, Typeable a) => Encodable a whereSource
Metric value to be encoded
encode :: a -> ByteStringSource
Encode the value as a bytestring
Sink resource to write metrics to
push :: Measurable b => a -> b -> IO ()Source
Write a metric to the sink.
Close the sink - subsequent writes will throw an error.
General Functions
key :: Maybe Host -> Group -> Bucket -> ByteStringSource
Combine a Host, Group and Bucket into a single key
Socket Handle Functions
fOpen :: Sink a => (Handle -> a) -> SocketType -> HostName -> PortNumber -> IO AnySinkSource
Helper to curry a constructor function for a sink
hOpen :: SocketType -> HostName -> PortNumber -> IO HandleSource
Create a new socket handle (in a disconnected state) for UDP communication
hPush :: Handle -> ByteString -> IO ()Source
Direct access for writing a bytestring to a socket handle
Re-exports
Either a host name e.g., "haskell.org"
or a numeric host
address string consisting of a dotted decimal IPv4 address or an
IPv6 address e.g., "192.168.0.1"
.