Safe Haskell | Safe-Infered |
---|
Monitoring daemon backend
This module holds implements the querying of the monitoring daemons for dynamic utilisation data.
- data Report
- = CPUavgloadReport CPUavgload
- | InstanceCpuReport (Map String Double)
- | InstanceRSSReport (Map String Double)
- data DataCollector = DataCollector {}
- mkCpuReport :: DCReport -> Maybe Report
- updateNodeCpuFromReport :: (Node, Report) -> Node
- updateCpuUtilDataFromNode :: List -> Node -> List
- useNodeTotalCPU :: [(Node, Report)] -> (List, List) -> Result (List, List)
- totalCPUCollector :: DataCollector
- mkXenCpuReport :: DCReport -> Maybe Report
- useInstanceCpuData :: [(Node, Report)] -> (List, List) -> Result (List, List)
- xenCPUCollector :: DataCollector
- mkKvmRSSReport :: DCReport -> Maybe Report
- pagesPerMiB :: Double
- useInstanceRSSData :: [(Node, Report)] -> (List, List) -> Result (List, List)
- kvmRSSCollector :: DataCollector
- scaleMemoryWeight :: Double -> (List, List) -> (List, List)
- collectors :: Options -> [DataCollector]
- mkReport :: DataCollector -> Maybe DCReport -> Maybe Report
- type MonDData = (String, [DCReport])
- type MapMonDData = Map String [DCReport]
- fromFile :: DataCollector -> Node -> MapMonDData -> Maybe DCReport
- getDCCName :: Maybe DCCategory -> String
- prepareUrl :: DataCollector -> Node -> URLString
- fromCurl :: DataCollector -> Node -> IO (Maybe DCReport)
- pMonDN :: JSRecord -> Result MonDData
- pMonDData :: String -> Result [MonDData]
- queryAMonD :: Maybe MapMonDData -> DataCollector -> Node -> IO (Maybe Report)
- queryAllMonDs :: Maybe MapMonDData -> (List, List) -> DataCollector -> WriterT All IO (List, List)
- queryAllMonDDCs :: ClusterData -> Options -> WriterT All IO ClusterData
General definitions
The actual data types for MonD's Data Collectors.
CPUavgloadReport CPUavgload | |
InstanceCpuReport (Map String Double) | |
InstanceRSSReport (Map String Double) |
data DataCollector Source
Type describing a data collector basic information.
Node-total CPU load average data collector
mkCpuReport :: DCReport -> Maybe ReportSource
updateNodeCpuFromReport :: (Node, Report) -> NodeSource
updateCpuUtilDataFromNode :: List -> Node -> ListSource
totalCPUCollector :: DataCollectorSource
The node-total CPU collector.
Xen instance CPU-usage collector
mkXenCpuReport :: DCReport -> Maybe ReportSource
xenCPUCollector :: DataCollectorSource
Collector for per-instance CPU data as observed by Xen
kvm instance RSS collector
mkKvmRSSReport :: DCReport -> Maybe ReportSource
pagesPerMiB :: DoubleSource
useInstanceRSSData :: [(Node, Report)] -> (List, List) -> Result (List, List)Source
Update cluster data based on per-instance RSS data. Also set the node's memoy util pool correctly. Our unit of memory usage is pages; there are 256 pages per MiB of node memory not used by the node itself.
kvmRSSCollector :: DataCollectorSource
Update cluster data based on the per-instance CPU usage
scaleMemoryWeight :: Double -> (List, List) -> (List, List)Source
Scale the importance of the memory weight in dynamic utilisation, by multiplying the usage with the given factor. Note that the underlying model for dynamic utilisation is that they are reported in arbitrary units.
Collector choice
collectors :: Options -> [DataCollector]Source
Querying infrastructure
mkReport :: DataCollector -> Maybe DCReport -> Maybe ReportSource
Return the data from correct combination of a Data Collector and a DCReport.
type MapMonDData = Map String [DCReport]Source
fromFile :: DataCollector -> Node -> MapMonDData -> Maybe DCReportSource
getDCCName :: Maybe DCCategory -> StringSource
prepareUrl :: DataCollector -> Node -> URLStringSource
fromCurl :: DataCollector -> Node -> IO (Maybe DCReport)Source
Query a specified MonD for a Data Collector.
queryAMonD :: Maybe MapMonDData -> DataCollector -> Node -> IO (Maybe Report)Source
queryAllMonDs :: Maybe MapMonDData -> (List, List) -> DataCollector -> WriterT All IO (List, List)Source
queryAllMonDDCs :: ClusterData -> Options -> WriterT All IO ClusterDataSource
Query all MonDs for all Data Collector. Return the cluster enriched by dynamic data, as well as a bit indicating wether all collectors could be queried successfully.