Revision d1da5a45

b/htools/Ganeti/HTools/Program/Hinfo.hs
66 66
                           , giBadNodes  :: Int
67 67
                           , giBadInsts  :: Int
68 68
                           , giN1Status  :: Bool
69
                           , giScore     :: Double
69 70
                           }
70 71

  
71 72
-- | Node group statistics.
......
80 81
      bn_size                    = length bad_nodes
81 82
      bi_size                    = length bad_instances
82 83
      n1h                        = bn_size == 0
83
  in GroupInfo (Group.name g) nl_size il_size bn_size bi_size n1h
84
      score                      = Cluster.compCV nl
85
  in GroupInfo (Group.name g) nl_size il_size bn_size bi_size n1h score
84 86

  
85 87
-- | Helper to format one group row result.
86 88
groupRowFormatHelper :: GroupInfo -> [String]
......
91 93
  , printf "%d" $ giBadNodes gi
92 94
  , printf "%d" $ giBadInsts gi
93 95
  , show $ giN1Status gi
96
  , printf "%.8f" $ giScore gi
94 97
  ]
95 98

  
96 99
-- | Print node group information.
......
102 105
      cn1h   = all giN1Status cgrs
103 106
      grs    = map groupRowFormatHelper cgrs
104 107
      header = ["Group", "Nodes", "Instances", "Bad_Nodes", "Bad_Instances",
105
                "N+1"]
108
                "N+1", "Score"]
106 109

  
107 110
  when (verbose > 1) $
108 111
    printf "Node group information:\n%s"
109
           (printTable "  " header grs [False, True, True, True, True, False])
112
           (printTable "  " header grs [False, True, True, True, True,
113
                                        False, True])
110 114

  
111 115
  printf "Cluster is N+1 %s\n" $ if cn1h then "happy" else "unhappy"
112 116

  

Also available in: Unified diff