Revision 2f9198be

b/htools/Ganeti/HTools/Program/Hspace.hs
159 159
                 PFinal -> "FIN"
160 160
                 PTiered -> "TRL"
161 161

  
162
-- | Print failure reason and scores
163
printFRScores :: Node.List -> Node.List -> [(FailMode, Int)] -> IO ()
164
printFRScores ini_nl fin_nl sreason = do
165
  printf "  - most likely failure reason: %s\n" $ failureReason sreason::IO ()
166
  printClusterScores ini_nl fin_nl
167
  printClusterEff (Cluster.totalResources fin_nl)
168

  
162 169
-- | Print final stats and related metrics.
163 170
printResults :: Bool -> Node.List -> Node.List -> Int -> Int
164 171
             -> [(FailMode, Int)] -> IO ()
......
186 193
printResults False ini_nl fin_nl _ allocs sreason = do
187 194
  putStrLn "Normal (fixed-size) allocation results:"
188 195
  printf "  - %3d instances allocated\n" allocs :: IO ()
189
  printf "  - most likely failure reason: %s\n" $ failureReason sreason::IO ()
190
  printClusterScores ini_nl fin_nl
191
  printClusterEff (Cluster.totalResources fin_nl)
196
  printFRScores ini_nl fin_nl sreason
192 197

  
193 198
-- | Prints the final @OK@ marker in machine readable output.
194 199
printFinal :: Bool -> IO ()
......
318 323
  mapM_ (\(ispec, cnt) ->
319 324
             printf "  - %3d instances of spec %s\n" cnt
320 325
                        (formatResources ispec specData)) spec_map
321
  printf "  - most likely failure reason: %s\n" $ failureReason sreason::IO ()
322
  printClusterScores ini_nl fin_nl
323
  printClusterEff (Cluster.totalResources fin_nl)
326
  printFRScores ini_nl fin_nl sreason
324 327

  
325 328
-- | Displays the initial/final cluster scores.
326 329
printClusterScores :: Node.List -> Node.List -> IO ()

Also available in: Unified diff