network-metrics-0.2.8: Send metrics to Ganglia, Graphite, and statsd.

Portabilitynon-portable (GHC extensions)
Stabilityexperimental
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Safe HaskellNone

Network.Metric.Internal

Contents

Description

 

Synopsis

Exported Types

data Handle Source

Socket handle

Constructors

Handle Socket SockAddr 

Instances

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

Constructors

forall a . Measurable a => AnyMeasurable a 

data AnySink Source

Any instance of the Sink type class

Constructors

forall a . Sink a => AnySink a 

Instances

Sink AnySink

Existential sink instance

Exported Type Classes

class Measurable a whereSource

Measure a type for a collection of metrics

Methods

measure :: a -> [Metric]Source

Convert a measurable instance from a host into a list of metrics

class (Show a, Typeable a) => Encodable a whereSource

Metric value to be encoded

Methods

encode :: a -> ByteStringSource

Encode the value as a bytestring

class Sink a whereSource

Sink resource to write metrics to

Methods

push :: Measurable b => a -> b -> IO ()Source

Write a metric to the sink.

close :: a -> IO ()Source

Close the sink - subsequent writes will throw an error.

Instances

Sink AnySink

Existential sink instance

Sink Ganglia 
Sink SinkHandle 

General Functions

key :: 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

hClose :: Handle -> IO ()Source

Close a socket handle

hPush :: Handle -> ByteString -> IO ()Source

Direct access for writing a bytestring to a socket handle

Re-exports

type HostName = String

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".