Revision 179c0828 htools/Ganeti/HTools/Cluster.hs
b/htools/Ganeti/HTools/Cluster.hs | ||
---|---|---|
139 | 139 |
data Table = Table Node.List Instance.List Score [Placement] |
140 | 140 |
deriving (Show, Read) |
141 | 141 |
|
142 |
-- | Cluster statistics data type. |
|
142 | 143 |
data CStats = CStats { csFmem :: Integer -- ^ Cluster free mem |
143 | 144 |
, csFdsk :: Integer -- ^ Cluster free disk |
144 | 145 |
, csAmem :: Integer -- ^ Cluster allocatable mem |
... | ... | |
278 | 279 |
, (2, "pri_tags_score") |
279 | 280 |
] |
280 | 281 |
|
282 |
-- | Holds the weights used by 'compCVNodes' for each metric. |
|
281 | 283 |
detailedCVWeights :: [Double] |
282 | 284 |
detailedCVWeights = map fst detailedCVInfo |
283 | 285 |
|
... | ... | |
333 | 335 |
compCV :: Node.List -> Double |
334 | 336 |
compCV = compCVNodes . Container.elems |
335 | 337 |
|
336 |
|
|
337 | 338 |
-- | Compute online nodes from a 'Node.List'. |
338 | 339 |
getOnline :: Node.List -> [Node.Node] |
339 | 340 |
getOnline = filter (not . Node.offline) . Container.elems |
... | ... | |
1314 | 1315 |
in intercalate ", " formatted |
1315 | 1316 |
|
1316 | 1317 |
-- | Convert a placement into a list of OpCodes (basically a job). |
1317 |
iMoveToJob :: Node.List -> Instance.List |
|
1318 |
-> Idx -> IMove -> [OpCodes.OpCode] |
|
1318 |
iMoveToJob :: Node.List -- ^ The node list; only used for node |
|
1319 |
-- names, so any version is good |
|
1320 |
-- (before or after the operation) |
|
1321 |
-> Instance.List -- ^ The instance list; also used for |
|
1322 |
-- names only |
|
1323 |
-> Idx -- ^ The index of the instance being |
|
1324 |
-- moved |
|
1325 |
-> IMove -- ^ The actual move to be described |
|
1326 |
-> [OpCodes.OpCode] -- ^ The list of opcodes equivalent to |
|
1327 |
-- the given move |
|
1319 | 1328 |
iMoveToJob nl il idx move = |
1320 | 1329 |
let inst = Container.find idx il |
1321 | 1330 |
iname = Instance.name inst |
Also available in: Unified diff