ganeti

Safe HaskellSafe-Infered

Ganeti.HTools.Backend.MonD

Contents

Description

Monitoring daemon backend

This module holds implements the querying of the monitoring daemons for dynamic utilisation data.

Synopsis

General definitions

data Report Source

The actual data types for MonD's Data Collectors.

Constructors

CPUavgloadReport CPUavgload 
InstanceCpuReport (Map String Double) 
InstanceRSSReport (Map String Double) 

data DataCollector Source

Type describing a data collector basic information.

Constructors

DataCollector 

Fields

dName :: String

Name of the data collector

dCategory :: Maybe DCCategory
 
dMkReport :: DCReport -> Maybe Report
 
dUse :: [(Node, Report)] -> (List, List) -> Result (List, List)
 

Node-total CPU load average data collector

totalCPUCollector :: DataCollectorSource

The node-total CPU collector.

Xen instance CPU-usage collector

xenCPUCollector :: DataCollectorSource

Collector for per-instance CPU data as observed by Xen

kvm instance RSS collector

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

Querying infrastructure

mkReport :: DataCollector -> Maybe DCReport -> Maybe ReportSource

Return the data from correct combination of a Data Collector and a DCReport.

type MonDData = (String, [DCReport])Source

type MapMonDData = Map String [DCReport]Source

getDCCName :: Maybe DCCategory -> StringSource

fromCurl :: DataCollector -> Node -> IO (Maybe DCReport)Source

Query a specified MonD for a Data Collector.

pMonDData :: String -> Result [MonDData]Source

Parse MonD data file contents.

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.