ganeti

Safe HaskellNone

Ganeti.DataCollectors.Types

Contents

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 # 
Instance details

Defined in Ganeti.DataCollectors.Types

Enum DCCategory # 
Instance details

Defined in Ganeti.DataCollectors.Types

Eq DCCategory # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

(==) :: DCCategory -> DCCategory -> Bool

(/=) :: DCCategory -> DCCategory -> Bool

Read DCCategory # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

readsPrec :: Int -> ReadS DCCategory

readList :: ReadS [DCCategory]

readPrec :: ReadPrec DCCategory

readListPrec :: ReadPrec [DCCategory]

Show DCCategory # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

showsPrec :: Int -> DCCategory -> ShowS

show :: DCCategory -> String

showList :: [DCCategory] -> ShowS

JSON DCCategory #

The JSON instance for DCCategory.

Instance details

Defined in Ganeti.DataCollectors.Types

Methods

readJSON :: JSValue -> Result DCCategory

showJSON :: DCCategory -> JSValue

readJSONs :: JSValue -> Result [DCCategory]

showJSONs :: [DCCategory] -> JSValue

getCategoryName :: DCCategory -> String Source #

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 # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

(==) :: DCStatusCode -> DCStatusCode -> Bool

(/=) :: DCStatusCode -> DCStatusCode -> Bool

Ord DCStatusCode # 
Instance details

Defined in Ganeti.DataCollectors.Types

Show DCStatusCode # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

showsPrec :: Int -> DCStatusCode -> ShowS

show :: DCStatusCode -> String

showList :: [DCStatusCode] -> ShowS

JSON DCStatusCode #

The JSON instance for CollectorStatus.

Instance details

Defined in Ganeti.DataCollectors.Types

Methods

readJSON :: JSValue -> Result DCStatusCode

showJSON :: DCStatusCode -> JSValue

readJSONs :: JSValue -> Result [DCStatusCode]

showJSONs :: [DCStatusCode] -> JSValue

data DCStatus Source #

The status of a "status reporting data collector".

Constructors

DCStatus 
Instances
Eq DCStatus # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

(==) :: DCStatus -> DCStatus -> Bool

(/=) :: DCStatus -> DCStatus -> Bool

Show DCStatus # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

showsPrec :: Int -> DCStatus -> ShowS

show :: DCStatus -> String

showList :: [DCStatus] -> ShowS

JSON DCStatus # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

readJSON :: JSValue -> Result DCStatus

showJSON :: DCStatus -> JSValue

readJSONs :: JSValue -> Result [DCStatus]

showJSONs :: [DCStatus] -> JSValue

ArrayObject DCStatus # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

toJSArray :: DCStatus -> [JSValue] Source #

fromJSArray :: [JSValue] -> Result DCStatus Source #

DictObject DCStatus # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

toDict :: DCStatus -> [(String, JSValue)] Source #

fromDictWKeys :: [(String, JSValue)] -> WriterT UsedKeys Result DCStatus Source #

fromDict :: [(String, JSValue)] -> Result DCStatus Source #

data DCKind Source #

The type representing the kind of the collector.

Constructors

DCKPerf

Performance reporting collector

DCKStatus

Status reporting collector

Instances
Eq DCKind # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

(==) :: DCKind -> DCKind -> Bool

(/=) :: DCKind -> DCKind -> Bool

Show DCKind # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

showsPrec :: Int -> DCKind -> ShowS

show :: DCKind -> String

showList :: [DCKind] -> ShowS

JSON DCKind #

The JSON instance for CollectorKind.

Instance details

Defined in Ganeti.DataCollectors.Types

Methods

readJSON :: JSValue -> Result DCKind

showJSON :: DCKind -> JSValue

readJSONs :: JSValue -> Result [DCKind]

showJSONs :: [DCKind] -> JSValue

data DCVersion Source #

Type representing the version number of a data collector.

Constructors

DCVerBuiltin 
DCVersion String 
Instances
Eq DCVersion # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

(==) :: DCVersion -> DCVersion -> Bool

(/=) :: DCVersion -> DCVersion -> Bool

Show DCVersion # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

showsPrec :: Int -> DCVersion -> ShowS

show :: DCVersion -> String

showList :: [DCVersion] -> ShowS

JSON DCVersion #

The JSON instance for DCVersion.

Instance details

Defined in Ganeti.DataCollectors.Types

Methods

readJSON :: JSValue -> Result DCVersion

showJSON :: DCVersion -> JSValue

readJSONs :: JSValue -> Result [DCVersion]

showJSONs :: [DCVersion] -> JSValue

data CollectorData Source #

Type for the value field of the CollectorMap below.

Constructors

CPULoadData (Seq (ClockTime, [Int])) 
InstanceCpuLoad (Map String (Seq (ClockTime, Double))) 
Instances
NFData CollectorData # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

rnf :: CollectorData -> ()

type CollectorMap = Map String CollectorData Source #

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.

Constructors

DCReport 
Instances
Eq DCReport # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

(==) :: DCReport -> DCReport -> Bool

(/=) :: DCReport -> DCReport -> Bool

Show DCReport # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

showsPrec :: Int -> DCReport -> ShowS

show :: DCReport -> String

showList :: [DCReport] -> ShowS

JSON DCReport # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

readJSON :: JSValue -> Result DCReport

showJSON :: DCReport -> JSValue

readJSONs :: JSValue -> Result [DCReport]

showJSONs :: [DCReport] -> JSValue

ArrayObject DCReport # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

toJSArray :: DCReport -> [JSValue] Source #

fromJSArray :: [JSValue] -> Result DCReport Source #

DictObject DCReport # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

toDict :: DCReport -> [(String, JSValue)] Source #

fromDictWKeys :: [(String, JSValue)] -> WriterT UsedKeys Result DCReport Source #

fromDict :: [(String, JSValue)] -> Result DCReport Source #

addStatus :: DCStatus -> JSValue -> JSValue Source #

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 DCReport Source #

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) 

data DataCollector Source #

Type describing a data collector basic information

Constructors

DataCollector 

Fields

Orphan instances

NFData ClockTime # 
Instance details

Methods

rnf :: ClockTime -> ()