ganeti

Safe HaskellNone

Ganeti.HTools.Cluster.MetricsTH

Description

Declaration of the datatypes and functions dealing with cluster metrics generated by template haskell.

Synopsis

Documentation

data MetricComponent Source

Data type describing the metric component. The information provided by this data type is used to generate statistics data types and functions dealing with them

Constructors

MetricComponent 

Fields

name :: String

The component name

weight :: Q Exp

The component weight in the statistics sum

fromNode :: Q Exp

Quasi quoted function obtaining spread value from a node given (Node.Node -> fromNodeType)

fromNodeType :: Q Type

Quasi quoted spread value type

statisticsType :: Q Type

Quasi quoted statistics data type. Stat instance for fromNodeType and statisticsType should be defined

forOnlineNodes :: Bool

Whether this component should be calculated for online or offline nodes

optimalValue :: Maybe ExpQ

Maybe quasi quoted function obtaining optimal value of such component (Node.List -> Double)

declareStatistics :: [MetricComponent] -> Q [Dec]Source

Declares all functions and data types implemented in template haskell

getVarStrictTypeQ :: (String, Q Type) -> VarStrictTypeQSource

appTwice :: Q Exp -> Q Exp -> Q Exp -> Q ExpSource

getQNameExp :: String -> Q Exp -> Q (Name, Exp)Source