Revision 2922d2c5 htools/Ganeti/HTools/Cluster.hs

b/htools/Ganeti/HTools/Cluster.hs
1330 1330
     formatTable (header:map helper sil) isnum
1331 1331

  
1332 1332
-- | Shows statistics for a given node list.
1333
printStats :: Node.List -> String
1334
printStats nl =
1333
printStats :: String -> Node.List -> String
1334
printStats lp nl =
1335 1335
  let dcvs = compDetailedCV $ Container.elems nl
1336 1336
      (weights, names) = unzip detailedCVInfo
1337 1337
      hd = zip3 (weights ++ repeat 1) (names ++ repeat "unknown") dcvs
1338
      formatted = map (\(w, header, val) ->
1339
                         printf "%s=%.8f(x%.2f)" header val w::String) hd
1340
  in intercalate ", " formatted
1338
      header = [ "Field", "Value", "Weight" ]
1339
      formatted = map (\(w, h, val) ->
1340
                         [ h
1341
                         , printf "%.8f" val
1342
                         , printf "x%.2f" w
1343
                         ]) hd
1344
  in unlines . map ((++) lp) . map ((:) ' ' . unwords) $
1345
     formatTable (header:formatted) $ False:repeat True
1341 1346

  
1342 1347
-- | Convert a placement into a list of OpCodes (basically a job).
1343 1348
iMoveToJob :: Node.List        -- ^ The node list; only used for node

Also available in: Unified diff