Commit af53a5c4 authored by Iustin Pop's avatar Iustin Pop
Browse files

Beautify the cluster status list

This patch removes the primary/secondary instance lists from the node
status and also removes the tabbed formatting with explicit width
formatting.
parent 671b85b9
......@@ -565,7 +565,9 @@ printNodes :: [(Int, String)] -> NodeList -> String
printNodes ktn nl =
let snl = sortBy (compare `on` Node.idx) (Container.elems nl)
snl' = map (\ n -> ((fromJust $ lookup (Node.idx n) ktn), n)) snl
in unlines $ map (uncurry Node.list) snl'
m_name = maximum . (map length) . fst . unzip $ snl'
helper = Node.list m_name
in unlines $ map (uncurry helper) snl'
-- | Compute the mem and disk covariance.
compDetailedCV :: NodeList -> (Double, Double)
......
......@@ -197,18 +197,16 @@ str t =
(commaJoin (map show (slist t)))
-- | String converter for the node list functionality.
list :: String -> Node -> String
list n t =
list :: Int -> String -> Node -> String
list mname n t =
let pl = plist t
sl = slist t
mp = p_mem t
dp = p_dsk t
fn = failN1 t
in
printf " %c %s(%d)\t%5d\t%5d\t%3d\t%3d\t%s\t%s\t%.5f\t%.5f"
printf " %c %-*s %5d %5d %3d %3d %.5f %.5f"
(if fn then '*' else ' ')
n (idx t) (f_mem t) ((f_dsk t) `div` 1024)
mname n (f_mem t) ((f_dsk t) `div` 1024)
(length pl) (length sl)
(commaJoin (map show pl))
(commaJoin (map show sl))
mp dp
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