ganeti
Safe HaskellNone

Ganeti.DataCollectors.CPUload

Description

procstat data collector.

Synopsis

Documentation

defaultFile :: FilePath Source #

The default path of the CPU status file. It is hardcoded because it is not likely to change.

bufferSize :: Int Source #

The buffer size of the values kept in the map.

windowSize :: Integer Source #

The window size of the values that will export the average load.

defaultCharNum :: Int Source #

The default setting for the maximum amount of not parsed character to print in case of error. It is set to use most of the screen estate on a standard 80x25 terminal. TODO: add the possibility to set this with a command line parameter.

dcName :: String Source #

The name of this data collector.

dcVersion :: DCVersion Source #

The version of this data collector.

dcFormatVersion :: Int Source #

The version number for the data format of this data collector.

dcCategory :: Maybe DCCategory Source #

The category of this data collector.

dcKind :: DCKind Source #

The kind of this data collector.

dcReport :: Maybe CollectorData -> IO DCReport Source #

The data exported by the data collector, taken from the default location.

type Buffer = Seq (ClockTime, [Int]) Source #

Data stored by the collector in mond's memory.

computeLoad :: CPUstat -> Int Source #

Compute the load from a CPU.

dcCollectFromFile :: FilePath -> IO (ClockTime, [Int]) Source #

Reads and Computes the load for each CPU.

dcCollect :: IO Buffer Source #

Returns the collected data in the appropriate type.

formatData :: [Double] -> CPUavgload Source #

Formats data for JSON transformation.

updateEntry :: Buffer -> Buffer -> Buffer Source #

Update a Map Entry.

dcUpdate :: Maybe CollectorData -> IO CollectorData Source #

Updates the given Collector data.

computeAverage :: Buffer -> Integer -> Integer -> Result [Double] Source #

Computes the average load for every CPU and the overall from data read from the map. Returns Bad if there are not enough values to compute it.

buildJsonReport :: Buffer -> IO JSValue Source #

This function computes the JSON representation of the CPU load.

buildDCReport :: Buffer -> IO DCReport Source #

This function computes the DCReport for the CPU load.