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

Show the load on nodes in node lists

The strange printf usage is due to some limitation (it seems) in ghc for
very long argument lists. The whole printout should be rewritten later.
parent 2180829f
No related branches found
No related tags found
No related merge requests found
......@@ -677,6 +677,7 @@ printNodes nl =
let snl = sortBy (compare `on` Node.idx) (Container.elems nl)
m_name = maximum . map (length . Node.name) $ snl
helper = Node.list m_name
h2 = printf " %5s %5s %5s %5s" "lCpu" "lMem" "lDsk" "lNet"::String
header = printf
"%2s %-*s %5s %5s %5s %5s %5s %5s %5s %5s %4s %4s \
\%3s %3s %6s %6s %5s"
......@@ -684,7 +685,7 @@ printNodes nl =
"t_mem" "n_mem" "i_mem" "x_mem" "f_mem" "r_mem"
"t_dsk" "f_dsk" "pcpu" "vcpu"
"pri" "sec" "p_fmem" "p_fdsk" "r_cpu"::String
in unlines (header:map helper snl)
in unlines ((header++h2):map helper snl)
-- | Print the instance list.
printInsts :: Node.List -> Instance.List -> String
......
......@@ -356,6 +356,9 @@ list mname t =
xmem = xMem t
fmem = fMem t
imem = truncate tmem - nmem - xmem - fmem
T.DynUtil { T.cpuWeight = uC, T.memWeight = uM,
T.dskWeight = uD, T.netWeight = uN } = utilLoad t
wstr = printf " %5.3f %5.3f %5.3f %5.3f" uC uM uD uN::String
in
if off
then printf " - %-*s %57s %3d %3d"
......@@ -367,4 +370,4 @@ list mname t =
mname (name t) tmem nmem imem xmem fmem (rMem t)
(tDsk t / 1024) (fDsk t `div` 1024)
(tCpu t) (uCpu t)
pl sl mp dp cp
pl sl mp dp cp ++ wstr
......@@ -257,6 +257,18 @@ percent of free disk
.TP
.B r_cpu
ratio of virtual to physical cpus
.TP
.B lCpu
the dynamic CPU load (if the information is available)
.TP
.B lMem
the dynamic memory load (if the information is available)
.TP
.B lDsk
the dynamic disk load (if the information is available)
.TP
.B lNet
the dynamic net load (if the information is available)
.RE
.TP
......
......@@ -258,6 +258,18 @@ percent of free disk
.TP
.B r_cpu
ratio of virtual to physical cpus
.TP
.B lCpu
the dynamic CPU load (if the information is available)
.TP
.B lMem
the dynamic memory load (if the information is available)
.TP
.B lDsk
the dynamic disk load (if the information is available)
.TP
.B lNet
the dynamic net load (if the information is available)
.RE
.TP
......
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