| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Ganeti.DataCollectors.Types
Contents
Description
Implementation of the Ganeti data collector types.
Synopsis
- addStatus :: DCStatus -> JSValue -> JSValue
- data DCCategory
- data DCKind
- data DCReport = DCReport {
- dcReportName :: String
- dcReportVersion :: DCVersion
- dcReportFormatVersion :: Int
- dcReportTimestamp :: Integer
- dcReportCategory :: (Maybe DCCategory)
- dcReportKind :: DCKind
- dcReportData :: JSValue
- data DCStatus = DCStatus {
- dcStatusCode :: DCStatusCode
- dcStatusMessage :: String
- data DCStatusCode
- data DCVersion
- = DCVerBuiltin
- | DCVersion String
- data CollectorData
- = CPULoadData (Seq (ClockTime, [Int]))
- | InstanceCpuLoad (Map String (Seq (ClockTime, Double)))
- type CollectorMap = Map String CollectorData
- buildReport :: String -> DCVersion -> Int -> Maybe DCCategory -> DCKind -> JSValue -> IO DCReport
- mergeStatuses :: (DCStatusCode, String) -> (DCStatusCode, [String]) -> (DCStatusCode, [String])
- getCategoryName :: DCCategory -> String
- data ReportBuilder
- = StatelessR (IO DCReport)
- | StatefulR (Maybe CollectorData -> IO DCReport)
- data DataCollector = DataCollector {
- dName :: Name
- dCategory :: Maybe DCCategory
- dKind :: DCKind
- dReport :: ReportBuilder
- dUpdate :: Maybe (Maybe CollectorData -> IO CollectorData)
- dActive :: Name -> ConfigData -> Bool
- dInterval :: Name -> ConfigData -> Integer
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.
Constructors
| DCInstance | |
| DCStorage | |
| DCDaemon | |
| DCHypervisor |
Instances
The type representing the kind of the collector.
This is the format of the report produced by each data collector.
Constructors
| DCReport | |
Fields
| |
Instances
| Show DCReport # | |
| ArrayObject DCReport # | |
Defined in Ganeti.DataCollectors.Types | |
| DictObject DCReport # | |
Defined in Ganeti.DataCollectors.Types | |
| Eq DCReport # | |
| JSON DCReport # | |
The status of a "status reporting data collector".
Constructors
| DCStatus | |
Fields
| |
Instances
| Show DCStatus # | |
| ArrayObject DCStatus # | |
Defined in Ganeti.DataCollectors.Types | |
| DictObject DCStatus # | |
Defined in Ganeti.DataCollectors.Types | |
| Eq DCStatus # | |
| JSON DCStatus # | |
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
| Show DCStatusCode # | |
Defined in Ganeti.DataCollectors.Types Methods showsPrec :: Int -> DCStatusCode -> ShowS show :: DCStatusCode -> String showList :: [DCStatusCode] -> ShowS | |
| Eq DCStatusCode # | |
Defined in Ganeti.DataCollectors.Types | |
| Ord DCStatusCode # | |
Defined in Ganeti.DataCollectors.Types Methods compare :: DCStatusCode -> DCStatusCode -> Ordering (<) :: DCStatusCode -> DCStatusCode -> Bool (<=) :: DCStatusCode -> DCStatusCode -> Bool (>) :: DCStatusCode -> DCStatusCode -> Bool (>=) :: DCStatusCode -> DCStatusCode -> Bool max :: DCStatusCode -> DCStatusCode -> DCStatusCode min :: DCStatusCode -> DCStatusCode -> DCStatusCode | |
| JSON DCStatusCode # | The JSON instance for CollectorStatus. |
Defined in Ganeti.DataCollectors.Types Methods readJSON :: JSValue -> Result DCStatusCode showJSON :: DCStatusCode -> JSValue readJSONs :: JSValue -> Result [DCStatusCode] showJSONs :: [DCStatusCode] -> JSValue | |
Type representing the version number of a data collector.
Constructors
| DCVerBuiltin | |
| DCVersion String |
data CollectorData #
Type for the value field of the CollectorMap below.
Constructors
| CPULoadData (Seq (ClockTime, [Int])) | |
| InstanceCpuLoad (Map String (Seq (ClockTime, Double))) |
Instances
| NFData CollectorData # | |
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
| |