ganeti-htoolsSource codeContentsIndex
Ganeti.HTools.Program.Hspace
Description
Cluster space sizing
Synopsis
options :: [OptType]
data Phase
= PInitial
| PFinal
| PTiered
data SpecType
= SpecNormal
| SpecTiered
htsPrefix :: String
specPrefix :: SpecType -> String
specDescription :: SpecType -> String
effFn :: (CStats -> Integer) -> (CStats -> Double) -> CStats -> Double
memEff :: CStats -> Double
dskEff :: CStats -> Double
cpuEff :: CStats -> Double
statsData :: [(String, CStats -> String)]
specData :: [(String, RSpec -> String)]
clusterData :: [(String, CStats -> String)]
printStats :: Phase -> CStats -> [(String, String)]
printFRScores :: List -> List -> [(FailMode, Int)] -> IO ()
printResults :: Bool -> List -> List -> Int -> Int -> [(FailMode, Int)] -> IO ()
printFinalHTS :: Bool -> IO ()
tieredSpecMap :: [Instance] -> [(RSpec, Int)]
formatSpecMap :: [(RSpec, Int)] -> [String]
formatRSpec :: String -> AllocInfo -> [(String, String)]
printAllocationStats :: List -> List -> IO ()
printKeysHTS :: [(String, String)] -> IO ()
printInstance :: List -> Instance -> [String]
printAllocationMap :: Int -> String -> List -> [Instance] -> IO ()
formatResources :: a -> [(String, a -> String)] -> String
printCluster :: Bool -> CStats -> Int -> IO ()
printISpec :: Bool -> RSpec -> SpecType -> DiskTemplate -> IO ()
printTiered :: Bool -> [(RSpec, Int)] -> List -> List -> [(FailMode, Int)] -> IO ()
printClusterScores :: List -> List -> IO ()
printClusterEff :: CStats -> IO ()
failureReason :: [(FailMode, Int)] -> String
sortReasons :: [(FailMode, Int)] -> [(FailMode, Int)]
runAllocation :: ClusterData -> Maybe AllocResult -> Result AllocResult -> RSpec -> DiskTemplate -> SpecType -> Options -> IO (FailStats, List, Int, [(RSpec, Int)])
instFromSpec :: RSpec -> DiskTemplate -> Int -> Instance
main :: Options -> [String] -> IO ()
Documentation
options :: [OptType]Source
Options list and functions.
data Phase Source
The allocation phase we're in (initial, after tiered allocs, or after regular allocation).
Constructors
PInitial
PFinal
PTiered
data SpecType Source
The kind of instance spec we print.
Constructors
SpecNormal
SpecTiered
htsPrefix :: StringSource
Prefix for machine readable names
specPrefix :: SpecType -> StringSource
What we prefix a spec with.
specDescription :: SpecType -> StringSource
The description of a spec.
effFn :: (CStats -> Integer) -> (CStats -> Double) -> CStats -> DoubleSource
Efficiency generic function.
memEff :: CStats -> DoubleSource
Memory efficiency.
dskEff :: CStats -> DoubleSource
Disk efficiency.
cpuEff :: CStats -> DoubleSource
Cpu efficiency.
statsData :: [(String, CStats -> String)]Source
Holds data for converting a CStats structure into detailed statictics.
specData :: [(String, RSpec -> String)]Source
List holding RSpec formatting information.
clusterData :: [(String, CStats -> String)]Source
List holding CStats formatting information.
printStats :: Phase -> CStats -> [(String, String)]Source
Function to print stats for a given phase.
printFRScores :: List -> List -> [(FailMode, Int)] -> IO ()Source
Print failure reason and scores
printResults :: Bool -> List -> List -> Int -> Int -> [(FailMode, Int)] -> IO ()Source
Print final stats and related metrics.
printFinalHTS :: Bool -> IO ()Source
Prints the final OK marker in machine readable output.
tieredSpecMap :: [Instance] -> [(RSpec, Int)]Source
Compute the tiered spec counts from a list of allocated instances.
formatSpecMap :: [(RSpec, Int)] -> [String]Source
Formats a spec map to strings.
formatRSpec :: String -> AllocInfo -> [(String, String)]Source
Formats "key-metrics" values.
printAllocationStats :: List -> List -> IO ()Source
Shows allocations stats.
printKeysHTS :: [(String, String)] -> IO ()Source
Format a list of key/values as a shell fragment.
printInstance :: List -> Instance -> [String]Source
Converts instance data to a list of strings.
printAllocationMap :: Int -> String -> List -> [Instance] -> IO ()Source
Optionally print the allocation map.
formatResources :: a -> [(String, a -> String)] -> StringSource
Formats nicely a list of resources.
printCluster :: Bool -> CStats -> Int -> IO ()Source
Print the cluster resources.
printISpec :: Bool -> RSpec -> SpecType -> DiskTemplate -> IO ()Source
Prints the normal instance spec.
printTiered :: Bool -> [(RSpec, Int)] -> List -> List -> [(FailMode, Int)] -> IO ()Source
Prints the tiered results.
printClusterScores :: List -> List -> IO ()Source
Displays the initial/final cluster scores.
printClusterEff :: CStats -> IO ()Source
Displays the cluster efficiency.
failureReason :: [(FailMode, Int)] -> StringSource
Computes the most likely failure reason.
sortReasons :: [(FailMode, Int)] -> [(FailMode, Int)]Source
Sorts the failure reasons.
runAllocationSource
:: ClusterDataCluster data
-> Maybe AllocResultOptional stop-allocation
-> Result AllocResultAllocation result
-> RSpecRequested instance spec
-> DiskTemplateRequested disk template
-> SpecTypeAllocation type
-> OptionsCLI options
-> IO (FailStats, List, Int, [(RSpec, Int)])
Runs an allocation algorithm and saves cluster state.
instFromSpec :: RSpec -> DiskTemplate -> Int -> InstanceSource
Create an instance from a given spec.
main :: Options -> [String] -> IO ()Source
Main function.
Produced by Haddock version 2.6.0