ganeti-3.1: Cluster-based virtualization management software
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ganeti.DataCollectors.Types

Description

Implementation of the Ganeti data collector types.

Synopsis

Documentation

addStatus :: DCStatus -> JSValue -> JSValue #

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

data DCCategory #

The possible classes a data collector can belong to.

Instances

Instances details
Bounded DCCategory # 
Instance details

Defined in Ganeti.DataCollectors.Types

Enum DCCategory # 
Instance details

Defined in Ganeti.DataCollectors.Types

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

Eq DCCategory # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

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

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

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

data DCKind #

The type representing the kind of the collector.

Constructors

DCKPerf

Performance reporting collector

DCKStatus

Status reporting collector

Instances

Instances details
Show DCKind # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

showsPrec :: Int -> DCKind -> ShowS

show :: DCKind -> String

showList :: [DCKind] -> ShowS

Eq DCKind # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

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

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

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

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

Constructors

DCReport 

Instances

Instances details
Show DCReport # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

showsPrec :: Int -> DCReport -> ShowS

show :: DCReport -> String

showList :: [DCReport] -> ShowS

ArrayObject DCReport # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

toJSArray :: DCReport -> [JSValue] #

fromJSArray :: [JSValue] -> Result DCReport #

DictObject DCReport # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

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

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

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

Eq DCReport # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

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

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

JSON DCReport # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

readJSON :: JSValue -> Result DCReport

showJSON :: DCReport -> JSValue

readJSONs :: JSValue -> Result [DCReport]

showJSONs :: [DCReport] -> JSValue

data DCStatus #

The status of a "status reporting data collector".

Constructors

DCStatus 

Instances

Instances details
Show DCStatus # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

showsPrec :: Int -> DCStatus -> ShowS

show :: DCStatus -> String

showList :: [DCStatus] -> ShowS

ArrayObject DCStatus # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

toJSArray :: DCStatus -> [JSValue] #

fromJSArray :: [JSValue] -> Result DCStatus #

DictObject DCStatus # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

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

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

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

Eq DCStatus # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

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

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

JSON DCStatus # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

readJSON :: JSValue -> Result DCStatus

showJSON :: DCStatus -> JSValue

readJSONs :: JSValue -> Result [DCStatus]

showJSONs :: [DCStatus] -> JSValue

data DCStatusCode #

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

Instances details
Show DCStatusCode # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

showsPrec :: Int -> DCStatusCode -> ShowS

show :: DCStatusCode -> String

showList :: [DCStatusCode] -> ShowS

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

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 DCVersion #

Type representing the version number of a data collector.

Constructors

DCVerBuiltin 
DCVersion String 

Instances

Instances details
Show DCVersion # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

showsPrec :: Int -> DCVersion -> ShowS

show :: DCVersion -> String

showList :: [DCVersion] -> ShowS

Eq DCVersion # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

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

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

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 #

Type for the value field of the CollectorMap below.

Constructors

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

Instances

Instances details
NFData CollectorData # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

rnf :: CollectorData -> ()

type CollectorMap = Map String CollectorData #

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

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

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.

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

Helper function for merging statuses.

getCategoryName :: DCCategory -> String #

Get the category name and return it as a string.

data ReportBuilder #

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

Constructors

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

data DataCollector #

Type describing a data collector basic information

Constructors

DataCollector 

Fields

Orphan instances

NFData ClockTime # 
Instance details

Methods

rnf :: ClockTime -> ()