Skip to content
Snippets Groups Projects
Commit 2f9198be authored by Iustin Pop's avatar Iustin Pop
Browse files

Abstract some common hspace code into a function


Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
parent 255f55a9
No related branches found
No related tags found
No related merge requests found
......@@ -159,6 +159,13 @@ printStats ph cs =
PFinal -> "FIN"
PTiered -> "TRL"
-- | Print failure reason and scores
printFRScores :: Node.List -> Node.List -> [(FailMode, Int)] -> IO ()
printFRScores ini_nl fin_nl sreason = do
printf " - most likely failure reason: %s\n" $ failureReason sreason::IO ()
printClusterScores ini_nl fin_nl
printClusterEff (Cluster.totalResources fin_nl)
-- | Print final stats and related metrics.
printResults :: Bool -> Node.List -> Node.List -> Int -> Int
-> [(FailMode, Int)] -> IO ()
......@@ -186,9 +193,7 @@ printResults True _ fin_nl num_instances allocs sreason = do
printResults False ini_nl fin_nl _ allocs sreason = do
putStrLn "Normal (fixed-size) allocation results:"
printf " - %3d instances allocated\n" allocs :: IO ()
printf " - most likely failure reason: %s\n" $ failureReason sreason::IO ()
printClusterScores ini_nl fin_nl
printClusterEff (Cluster.totalResources fin_nl)
printFRScores ini_nl fin_nl sreason
-- | Prints the final @OK@ marker in machine readable output.
printFinal :: Bool -> IO ()
......@@ -318,9 +323,7 @@ printTiered False spec_map _ ini_nl fin_nl sreason = do
mapM_ (\(ispec, cnt) ->
printf " - %3d instances of spec %s\n" cnt
(formatResources ispec specData)) spec_map
printf " - most likely failure reason: %s\n" $ failureReason sreason::IO ()
printClusterScores ini_nl fin_nl
printClusterEff (Cluster.totalResources fin_nl)
printFRScores ini_nl fin_nl sreason
-- | Displays the initial/final cluster scores.
printClusterScores :: Node.List -> Node.List -> IO ()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment