- , dsMin :: !(Maybe Double)
- -- |See 'dsMin'.
- , dsMax :: !(Maybe Double)
- }
- -- |COUNTER is for continuous incrementing counters like the
- -- ifInOctets counter in a router. The COUNTER data source assumes
- -- that the counter never decreases, except when a counter
- -- overflows. The update function takes the overflow into
- -- account. The counter is stored as a per-second rate. When the
- -- counter overflows, RRDtool checks if the overflow happened at
- -- the 32bit or 64bit border and acts accordingly by adding an
- -- appropriate value to the result.
- | COUNTER {
- dsName :: !String
- , dsHeartbeat :: !NominalDiffTime
- , dsMin :: !(Maybe Double)
- , dsMax :: !(Maybe Double)
- }
- -- |DERIVE will store the derivative of the line going from the
- -- last to the current value of the data source. This can be
- -- useful for gauges, for example, to measure the rate of people
- -- entering or leaving a room. Internally, derive works exactly
- -- like COUNTER but without overflow checks. So if your counter
- -- does not reset at 32 or 64 bit you might want to use DERIVE and
- -- combine it with a 'dsMin' value of 0.
- | DERIVE {
- dsName :: !String
- , dsHeartbeat :: !NominalDiffTime
- , dsMin :: !(Maybe Double)
- , dsMax :: !(Maybe Double)
- }
- -- |ABSOLUTE is for counters which get reset upon reading. This is
- -- used for fast counters which tend to overflow. So instead of
- -- reading them normally you reset them after every read to make
- -- sure you have a maximum time available before the next
- -- overflow. Another usage is for things you count like number of
- -- messages since the last update.
- | ABSOLUTE {
- dsName :: !String
- , dsHeartbeat :: !NominalDiffTime
- , dsMin :: !(Maybe Double)
- , dsMax :: !(Maybe Double)
- }
- -- |COMPUTE is for storing the result of a formula applied to
- -- other data sources in the RRD. This data source is not supplied
- -- a value on update, but rather its Primary Data Points (PDPs)
- -- are computed from the PDPs of the data sources according to the
- -- rpn-expression that defines the formula. Consolidation
- -- functions are then applied normally to the PDPs of the COMPUTE
- -- data source (that is the rpn-expression is only applied to
- -- generate PDPs). In database software, such data sets are
- -- referred to as \"virtual\" or \"computed\" columns.
- --
- -- FIXME: doc links
- | forall a. IsCommonExpr a => COMPUTE {
- dsName :: !String
+ , edsMin :: !(Maybe Double)
+ -- |See 'edsMin'.
+ , edsMax :: !(Maybe Double)
+ }
+ deriving (Show, Eq, Ord)
+
+
+-- |ComputedDataSource is for storing the result of a formula applied
+-- to other data sources in the RRD. This data source is not supplied
+-- a value on update, but rather its Primary Data Points (PDPs) are
+-- computed from the PDPs of the data sources according to the
+-- rpn-expression that defines the formula. Consolidation functions
+-- are then applied normally to the PDPs of the COMPUTE data source
+-- (that is the rpn-expression is only applied to generate PDPs). In
+-- database software, such data sets are referred to as \"virtual\" or
+-- \"computed\" columns.
+--
+-- FIXME: doc links
+data ComputedDataSource e
+ = ComputedDataSource {
+ -- |See 'edsName'
+ cdsName :: !String