Revision 30ff0c73
b/Ganeti/HTools/Cluster.hs | ||
---|---|---|
668 | 668 |
printInsts :: Node.List -> Instance.List -> String |
669 | 669 |
printInsts nl il = |
670 | 670 |
let sil = sortBy (compare `on` Instance.idx) (Container.elems il) |
671 |
helper inst = [ (Instance.name inst) |
|
672 |
, (Container.nameOf nl (Instance.pNode inst)) |
|
671 |
helper inst = [ if Instance.running inst then "R" else " " |
|
672 |
, Instance.name inst |
|
673 |
, Container.nameOf nl (Instance.pNode inst) |
|
673 | 674 |
, (let sdx = Instance.sNode inst |
674 | 675 |
in if sdx == Node.noSecondary |
675 | 676 |
then "" |
676 |
else Container.nameOf nl sdx) ] |
|
677 |
header = ["Name", "Pri_node", "Sec_node"] |
|
678 |
isnum = repeat False |
|
677 |
else Container.nameOf nl sdx) |
|
678 |
, printf "%3d" $ Instance.vcpus inst |
|
679 |
, printf "%5d" $ Instance.mem inst |
|
680 |
, printf "%5d" $ Instance.dsk inst `div` 1024 |
|
681 |
, printf "%5.3f" lC |
|
682 |
, printf "%5.3f" lM |
|
683 |
, printf "%5.3f" lD |
|
684 |
, printf "%5.3f" lN |
|
685 |
] |
|
686 |
where DynUtil lC lM lD lN = Instance.util inst |
|
687 |
header = [ "F", "Name", "Pri_node", "Sec_node", "vcpu", "mem" |
|
688 |
, "dsk", "lCpu", "lMem", "lDsk", "lNet" ] |
|
689 |
isnum = False:False:False:False:repeat True |
|
679 | 690 |
in unlines . map ((:) ' ' . intercalate " ") $ |
680 | 691 |
formatTable (header:map helper sil) isnum |
681 | 692 |
|
Also available in: Unified diff