Revision c3024b7e htools/Ganeti/HTools/Cluster.hs
b/htools/Ganeti/HTools/Cluster.hs | ||
---|---|---|
1302 | 1302 |
_ -> fs |
1303 | 1303 |
snl = sortBy (comparing Node.idx) (Container.elems nl) |
1304 | 1304 |
(header, isnum) = unzip $ map Node.showHeader fields |
1305 |
in unlines . map ((:) ' ' . unwords) $ |
|
1306 |
formatTable (header:map (Node.list fields) snl) isnum |
|
1305 |
in printTable "" header (map (Node.list fields) snl) isnum |
|
1307 | 1306 |
|
1308 | 1307 |
-- | Print the instance list. |
1309 | 1308 |
printInsts :: Node.List -> Instance.List -> String |
... | ... | |
1329 | 1328 |
header = [ "F", "Name", "Pri_node", "Sec_node", "Auto_bal" |
1330 | 1329 |
, "vcpu", "mem" , "dsk", "lCpu", "lMem", "lDsk", "lNet" ] |
1331 | 1330 |
isnum = False:False:False:False:False:repeat True |
1332 |
in unlines . map ((:) ' ' . unwords) $ |
|
1333 |
formatTable (header:map helper sil) isnum |
|
1331 |
in printTable "" header (map helper sil) isnum |
|
1334 | 1332 |
|
1335 | 1333 |
-- | Shows statistics for a given node list. |
1336 | 1334 |
printStats :: String -> Node.List -> String |
... | ... | |
1344 | 1342 |
, printf "%.8f" val |
1345 | 1343 |
, printf "x%.2f" w |
1346 | 1344 |
]) hd |
1347 |
in unlines . map ((++) lp) . map ((:) ' ' . unwords) $ |
|
1348 |
formatTable (header:formatted) $ False:repeat True |
|
1345 |
in printTable lp header formatted $ False:repeat True |
|
1349 | 1346 |
|
1350 | 1347 |
-- | Convert a placement into a list of OpCodes (basically a job). |
1351 | 1348 |
iMoveToJob :: Node.List -- ^ The node list; only used for node |
Also available in: Unified diff