ganeti

Safe HaskellNone

Ganeti.DataCollectors.Types

Description

Implementation of the Ganeti data collector types.

Synopsis

Documentation

data DCCategory Source

The possible classes a data collector can belong to.

Instances

Bounded DCCategory 
Enum DCCategory 
Eq DCCategory 
Read DCCategory 
Show DCCategory 
JSON DCCategory

The JSON instance for DCCategory.

getCategoryName :: DCCategory -> StringSource

Get the category name and return it as a string.

data DCStatusCode Source

The possible status codes of a data collector.

Constructors

DCSCOk

Everything is OK

DCSCTempBad

Bad, but being automatically fixed

DCSCUnknown

Unable to determine the status

DCSCBad

Bad. External intervention required

Instances

Eq DCStatusCode 
Ord DCStatusCode 
Show DCStatusCode 
JSON DCStatusCode

The JSON instance for CollectorStatus.

data DCStatus Source

The status of a "status reporting data collector".

Constructors

DCStatus 

loadDCStatus :: JSValue -> Result DCStatusSource

data DCKind Source

The type representing the kind of the collector.

Constructors

DCKPerf

Performance reporting collector

DCKStatus

Status reporting collector

Instances

Eq DCKind 
Show DCKind 
JSON DCKind

The JSON instance for CollectorKind.

data DCVersion Source

Type representing the version number of a data collector.

Constructors

DCVerBuiltin 
DCVersion String 

Instances

Eq DCVersion 
Show DCVersion 
JSON DCVersion

The JSON instance for DCVersion.

data CollectorData Source

Type for the value field of the CollectorMap below.

Constructors

CPULoadData (Seq (ClockTime, [Integer])) 
InstanceCpuLoad (Map String (Seq (ClockTime, Double))) 

Instances

NFData CollectorData 

type CollectorMap = Map String CollectorDataSource

Type for the map storing the data of the statefull DataCollectors.

data DCReport Source

This is the format of the report produced by each data collector.

loadDCReport :: JSValue -> Result DCReportSource

addStatus :: DCStatus -> JSValue -> JSValueSource

Add the data collector status information to the JSON representation of the collector data.

mergeStatuses :: (DCStatusCode, String) -> (DCStatusCode, [String]) -> (DCStatusCode, [String])Source

Helper function for merging statuses.

buildReport :: String -> DCVersion -> Int -> Maybe DCCategory -> DCKind -> JSValue -> IO DCReportSource

Utility function for building a report automatically adding the current timestamp (rounded up to seconds). If the version is not specified, it will be set to the value indicating a builtin collector.

data ReportBuilder Source

A report of a data collector might be stateful or stateless.

Constructors

StatelessR (IO DCReport) 
StatefulR (Maybe CollectorData -> IO DCReport) 

type Name = StringSource

data DataCollector Source

Type describing a data collector basic information

Constructors

DataCollector 

Fields

dName :: Name

Name of the data collector

dCategory :: Maybe DCCategory

Category (storage, instance, ecc) of the collector

dKind :: DCKind

Kind (performance or status reporting) of the data collector

dReport :: ReportBuilder

Report produced by the collector

dUpdate :: Maybe (Maybe CollectorData -> IO CollectorData)

Update operation for stateful collectors.

dActive :: Name -> ConfigData -> Bool

Checks if the collector applies for the cluster.

dInterval :: Name -> ConfigData -> Integer

Interval between collection in microseconds