| Portability | non-portable (GHC extensions) |
|---|---|
| Stability | experimental |
| Maintainer | Brendan Hay <brendan@soundcloud.com> |
| Safe Haskell | Safe-Infered |
Network.Metrics.Ganglia
Description
- data Slope
- = Zero
- | Positive
- | Negative
- | Both
- | Unspecified
- data GangliaType
- data GangliaMetric = GangliaMetric {
- name :: ByteString
- type' :: GangliaType
- units :: ByteString
- value :: ByteString
- host :: ByteString
- spoof :: ByteString
- group :: ByteString
- slope :: Slope
- tmax :: Word32
- dmax :: Word32
- data Ganglia = Ganglia Handle
- defaultMetric :: GangliaMetric
- putMetaData :: GangliaMetric -> Put
- putValue :: GangliaMetric -> Put
- open :: String -> String -> IO Ganglia
- class MetricSink a where
- type Group = ByteString
- type Bucket = ByteString
- type Value = ByteString
- data MetricType
- data Metric = Metric MetricType Group Bucket Value
Exported Types
Allows gmetad and the PHP webfrontend to efficiently separate constant data metrics from volatile ones
Constructors
| Zero | |
| Positive | |
| Negative | |
| Both | |
| Unspecified |
data GangliaMetric Source
concrete metric type used to emit metadata and value packets
Constructors
| GangliaMetric | |
Fields
| |
Instances
Defaults
defaultMetric :: GangliaMetricSource
Sensible defaults for a GangliaMetric
Binary Encoding
putMetaData :: GangliaMetric -> PutSource
Encode a GangliaMetric's metadata into a Binary.Put monad
The format for this can be found in either: * gm_protocol.x in the Ganglia 3.1 sources * https:github.comlookfirstjmxtrans
putValue :: GangliaMetric -> PutSource
Encode a GangliaMetric's value into a Binary.Put monad
Sink Functions
class MetricSink a whereSource
Sink resource to write metrics to
Methods
push :: Metric -> a -> IO ()Source
Write a metric to the sink.
Close the sink, any subsequent writes will throw an error.
Instances
| MetricSink Graphite | |
| MetricSink Statsd | |
| MetricSink Ganglia |
Re-exports
type Group = ByteStringSource
Metric group
type Bucket = ByteStringSource
Metric bucket
type Value = ByteStringSource
Metric value