Try to link to ekg-core instead of re-exports in docs
This commit is contained in:
parent
3897d1485c
commit
b02310ea1e
4 changed files with 22 additions and 17 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
{-# OPTIONS_HADDOCK not-home #-}
|
||||||
|
|
||||||
-- | This module defines a type for mutable, integer-valued counters.
|
-- | This module defines a type for mutable, integer-valued counters.
|
||||||
-- Counters are non-negative, monotonically increasing values and can
|
-- Counters are non-negative, monotonically increasing values and can
|
||||||
-- be used to track e.g. the number of requests served since program
|
-- be used to track e.g. the number of requests served since program
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
{-# OPTIONS_HADDOCK not-home #-}
|
||||||
|
|
||||||
-- | This module defines a type for mutable, integer-valued gauges.
|
-- | This module defines a type for mutable, integer-valued gauges.
|
||||||
-- Gauges are variable values and can be used to track e.g. the
|
-- Gauges are variable values and can be used to track e.g. the
|
||||||
-- current number of concurrent connections. All operations on gauges
|
-- current number of concurrent connections. All operations on gauges
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{-# LANGUAGE BangPatterns #-}
|
{-# OPTIONS_HADDOCK not-home #-}
|
||||||
|
|
||||||
-- | This module defines a type for mutable, string-valued labels.
|
-- | This module defines a type for mutable, string-valued labels.
|
||||||
-- Labels are variable values and can be used to track e.g. the
|
-- Labels are variable values and can be used to track e.g. the
|
||||||
-- command line arguments or other free-form values. All operations on
|
-- command line arguments or other free-form values. All operations on
|
||||||
|
|
|
@ -51,10 +51,10 @@ import Data.Time.Clock.POSIX (getPOSIXTime)
|
||||||
import Prelude hiding (read)
|
import Prelude hiding (read)
|
||||||
|
|
||||||
import qualified System.Metrics as Metrics
|
import qualified System.Metrics as Metrics
|
||||||
import System.Metrics.Distribution (Distribution)
|
import qualified System.Metrics.Counter as Counter
|
||||||
import System.Remote.Counter (Counter)
|
import qualified System.Metrics.Distribution as Distribution
|
||||||
import System.Remote.Gauge (Gauge)
|
import qualified System.Metrics.Gauge as Gauge
|
||||||
import System.Remote.Label (Label)
|
import qualified System.Metrics.Label as Label
|
||||||
import System.Remote.Snap
|
import System.Remote.Snap
|
||||||
|
|
||||||
-- $configuration
|
-- $configuration
|
||||||
|
@ -102,13 +102,13 @@ import System.Remote.Snap
|
||||||
-- Each metric is returned as an object containing a @type@ field. Available types
|
-- Each metric is returned as an object containing a @type@ field. Available types
|
||||||
-- are:
|
-- are:
|
||||||
--
|
--
|
||||||
-- * \"c\" - 'Counter'
|
-- * \"c\" - 'Counter.Counter'
|
||||||
--
|
--
|
||||||
-- * \"g\" - 'Gauge'
|
-- * \"g\" - 'Gauge.Gauge'
|
||||||
--
|
--
|
||||||
-- * \"l\" - 'Label'
|
-- * \"l\" - 'Label.Label'
|
||||||
--
|
--
|
||||||
-- * \"d\" - 'Distribution'
|
-- * \"d\" - 'Distribution.Distribution'
|
||||||
--
|
--
|
||||||
-- In addition to the @type@ field, there are metric specific fields:
|
-- In addition to the @type@ field, there are metric specific fields:
|
||||||
--
|
--
|
||||||
|
@ -151,8 +151,8 @@ import System.Remote.Snap
|
||||||
-- result in an 'error'.
|
-- result in an 'error'.
|
||||||
--
|
--
|
||||||
-- To create and use a counter, simply call 'getCounter' to create it
|
-- To create and use a counter, simply call 'getCounter' to create it
|
||||||
-- and then call e.g. 'System.Remote.Counter.inc' or
|
-- and then call e.g. 'Counter.inc' or 'Counter.add' to modify its
|
||||||
-- 'System.Remote.Counter.add' to modify its value. Example:
|
-- value. Example:
|
||||||
--
|
--
|
||||||
-- > main = do
|
-- > main = do
|
||||||
-- > handle <- forkServer "localhost" 8000
|
-- > handle <- forkServer "localhost" 8000
|
||||||
|
@ -163,8 +163,8 @@ import System.Remote.Snap
|
||||||
-- > loop
|
-- > loop
|
||||||
--
|
--
|
||||||
-- To create a gauge, use 'getGauge' instead of 'getCounter' and then
|
-- To create a gauge, use 'getGauge' instead of 'getCounter' and then
|
||||||
-- call e.g. 'System.Remote.Gauge.set' or
|
-- call e.g. 'System.Remote.Gauge.set'. Similar for the other metric
|
||||||
-- 'System.Remote.Gauge.modify'. Similar for the other metric types.
|
-- types.
|
||||||
--
|
--
|
||||||
-- It's also possible to register metrics directly using the
|
-- It's also possible to register metrics directly using the
|
||||||
-- @System.Metrics@ module in the ekg-core package. This gives you a
|
-- @System.Metrics@ module in the ekg-core package. This gives you a
|
||||||
|
@ -234,7 +234,7 @@ forkServerWith store host port = do
|
||||||
-- arguments will result in an 'error'.
|
-- arguments will result in an 'error'.
|
||||||
getCounter :: T.Text -- ^ Counter name
|
getCounter :: T.Text -- ^ Counter name
|
||||||
-> Server -- ^ Server that will serve the counter
|
-> Server -- ^ Server that will serve the counter
|
||||||
-> IO Counter
|
-> IO Counter.Counter
|
||||||
getCounter name server = Metrics.createCounter name (serverMetricStore server)
|
getCounter name server = Metrics.createCounter name (serverMetricStore server)
|
||||||
|
|
||||||
-- | Return a new, zero-initialized gauge associated with the given
|
-- | Return a new, zero-initialized gauge associated with the given
|
||||||
|
@ -242,7 +242,7 @@ getCounter name server = Metrics.createCounter name (serverMetricStore server)
|
||||||
-- arguments will result in an 'error'.
|
-- arguments will result in an 'error'.
|
||||||
getGauge :: T.Text -- ^ Gauge name
|
getGauge :: T.Text -- ^ Gauge name
|
||||||
-> Server -- ^ Server that will serve the gauge
|
-> Server -- ^ Server that will serve the gauge
|
||||||
-> IO Gauge
|
-> IO Gauge.Gauge
|
||||||
getGauge name server = Metrics.createGauge name (serverMetricStore server)
|
getGauge name server = Metrics.createGauge name (serverMetricStore server)
|
||||||
|
|
||||||
-- | Return a new, empty label associated with the given name and
|
-- | Return a new, empty label associated with the given name and
|
||||||
|
@ -250,7 +250,7 @@ getGauge name server = Metrics.createGauge name (serverMetricStore server)
|
||||||
-- result in an 'error'.
|
-- result in an 'error'.
|
||||||
getLabel :: T.Text -- ^ Label name
|
getLabel :: T.Text -- ^ Label name
|
||||||
-> Server -- ^ Server that will serve the label
|
-> Server -- ^ Server that will serve the label
|
||||||
-> IO Label
|
-> IO Label.Label
|
||||||
getLabel name server = Metrics.createLabel name (serverMetricStore server)
|
getLabel name server = Metrics.createLabel name (serverMetricStore server)
|
||||||
|
|
||||||
-- | Return a new distribution associated with the given name and
|
-- | Return a new distribution associated with the given name and
|
||||||
|
@ -258,6 +258,6 @@ getLabel name server = Metrics.createLabel name (serverMetricStore server)
|
||||||
-- will result in an 'error'.
|
-- will result in an 'error'.
|
||||||
getDistribution :: T.Text -- ^ Distribution name
|
getDistribution :: T.Text -- ^ Distribution name
|
||||||
-> Server -- ^ Server that will serve the distribution
|
-> Server -- ^ Server that will serve the distribution
|
||||||
-> IO Distribution
|
-> IO Distribution.Distribution
|
||||||
getDistribution name server =
|
getDistribution name server =
|
||||||
Metrics.createDistribution name (serverMetricStore server)
|
Metrics.createDistribution name (serverMetricStore server)
|
||||||
|
|
Loading…
Reference in a new issue