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

Show the x_mem/i_mem in node list

This patch adds checking of cluster data in the binaries and display of
node's x_mem/i_mem in the node list.
parent 5d1baf63
......@@ -643,8 +643,10 @@ printNodes ktn nl =
snl' = map (\ n -> ((fromJust $ lookup (Node.idx n) ktn), n)) snl
m_name = maximum . (map length) . fst . unzip $ snl'
helper = Node.list m_name
header = printf "%2s %-*s %5s %5s %5s %5s %5s %5s %3s %3s %7s %7s"
" F" m_name "Name" "t_mem" "n_mem" "f_mem" "r_mem"
header = printf
"%2s %-*s %5s %5s %5s %5s %5s %5s %5s %5s %3s %3s %7s %7s"
" F" m_name "Name"
"t_mem" "n_mem" "i_mem" "x_mem" "f_mem" "r_mem"
"t_dsk" "f_dsk"
"pri" "sec" "p_fmem" "p_fdsk"
in unlines $ (header:map (uncurry helper) snl')
......
......@@ -217,10 +217,15 @@ list mname n t =
dp = p_dsk t
off = offline t
fn = failN1 t
tmem = t_mem t
nmem = n_mem t
xmem = x_mem t
fmem = f_mem t
imem = (truncate tmem) - nmem - xmem - fmem
in
printf " %c %-*s %5.0f %5d %5d %5d %5.0f %5d %3d %3d %.5f %.5f"
printf " %c %-*s %5.0f %5d %5d %5d %5d %5d %5.0f %5d %3d %3d %.5f %.5f"
(if off then '-' else if fn then '*' else ' ')
mname n (t_mem t) (n_mem t) (f_mem t) (r_mem t)
mname n tmem nmem imem xmem fmem (r_mem t)
((t_dsk t) / 1024) ((f_dsk t) `div` 1024)
(length pl) (length sl)
mp dp
......@@ -153,6 +153,11 @@ main = do
readData getInstances host)
(loaded_nl, il, csf, ktn, kti) <- liftM2 Cluster.loadData node_data inst_data
let (fix_msgs, fixed_nl) = Cluster.checkData loaded_nl il ktn kti
unless (null fix_msgs) $ do
putStrLn "Warning: cluster has inconsistent data:"
putStrLn . unlines . map (\s -> printf " - %s" s) $ fix_msgs
let offline_names = optOffline opts
offline_indices = fst . unzip .
......@@ -160,7 +165,7 @@ main = do
let nl = Container.map (\n -> if elem (Node.idx n) offline_indices
then Node.setOffline n True
else n) loaded_nl
else n) fixed_nl
unless oneline $ printf "Loaded %d nodes, %d instances\n"
(Container.size nl)
......
......@@ -137,7 +137,13 @@ main = do
host -> (readData getNodes host,
readData getInstances host)
(nl, il, csf, ktn, kti) <- liftM2 Cluster.loadData node_data inst_data
(loaded_nl, il, csf, ktn, kti) <- liftM2 Cluster.loadData node_data inst_data
let (fix_msgs, nl) = Cluster.checkData loaded_nl il ktn kti
unless (null fix_msgs) $ do
putStrLn "Warning: cluster has inconsistent data:"
putStrLn . unlines . map (\s -> printf " - %s" s) $ fix_msgs
printf "Loaded %d nodes, %d instances\n"
(Container.size nl)
......
......@@ -162,8 +162,9 @@ main = do
(nl, il, csf, ktn, kti) =
Cluster.loadData ndata idata
putStrLn $ printCluster nl il ktn kti
when (optShowNodes opts) $
putStr $ Cluster.printNodes ktn nl
when (optShowNodes opts) $ do
let (_, fix_nl) = Cluster.checkData nl il ktn kti
putStr $ Cluster.printNodes ktn fix_nl
let ndata = serializeNodes nl csf ktn
idata = serializeInstances il csf ktn kti
oname = odir </> name
......
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