Commit 592601b3 authored by Agata Murawska's avatar Agata Murawska
Browse files

Print idx <-> uuid mappings in machine readable mode



As per Iustin Pop's suggestion, we are printing group mappings
from group idx (known only to htools) to group uuid, which identifies
the group uniquely. This is required because group uuid and name
may contain characters such as '-' which are not valid parts of
bash variable name.
Signed-off-by: default avatarAgata Murawska <agatamurawska@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent 5cdbde9a
......@@ -132,6 +132,14 @@ printBool True True = "1"
printBool True False = "0"
printBool False b = show b
-- | Print mapping from group idx to group uuid (only in machine readable mode).
printGroupsMappings :: Group.List -> IO ()
printGroupsMappings gl = do
let extract_vals = \g -> (printf "GROUP_UUID_%d" $ Group.idx g :: String,
printf "%s" $ Group.uuid g :: String)
printpairs = map extract_vals (Container.elems gl)
printKeysHTC printpairs
-- | Print all the statistics on a group level.
printGroupStats :: Int -> Bool -> Phase -> Group.Group -> [Int] -> Double -> IO ()
printGroupStats _ True phase grp stats score = do
......@@ -246,6 +254,7 @@ main opts args = do
let splitinstances = Cluster.findSplitInstances nlf ilf
splitcluster = Cluster.splitCluster nlf ilf
when machineread $ printGroupsMappings gl
groupsstats <- mapM (perGroupChecks verbose machineread Initial gl) splitcluster
let clusterstats = map sum (transpose groupsstats) :: [Int]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment