Commit 301789f4 authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix totalResources avail disk computation

This uses the newly-added Node.availDisk to compute the actual available
disk correctl, and display the total allocatable disk in hspace.
parent fe3d6f02
......@@ -173,13 +173,14 @@ updateCStats cs node =
= cs
inc_amem = (Node.f_mem node) - (Node.r_mem node)
inc_amem' = if inc_amem > 0 then inc_amem else 0
inc_adsk = Node.availDisk node
in CStats { cs_fmem = x_fmem + (Node.f_mem node)
, cs_fdsk = x_fdsk + (Node.f_dsk node)
, cs_amem = x_amem + inc_amem'
, cs_adsk = x_adsk
, cs_adsk = x_adsk + inc_adsk
, cs_acpu = x_acpu
, cs_mmem = max x_mmem inc_amem'
, cs_mdsk = max x_mdsk (Node.f_dsk node)
, cs_mdsk = max x_mdsk inc_adsk
, cs_mcpu = x_mcpu
}
......
......@@ -192,6 +192,7 @@ printStats kind cs = do
printf "%s free RAM: %d\n" kind (Cluster.cs_fmem cs)
printf "%s allocatable RAM: %d\n" kind (Cluster.cs_amem cs)
printf "%s free disk: %d\n" kind (Cluster.cs_fdsk cs)
printf "%s allocatable disk: %d\n" kind (Cluster.cs_adsk cs)
printf "%s max node allocatable RAM: %d\n" kind (Cluster.cs_mmem cs)
printf "%s max node allocatable disk: %d\n" kind (Cluster.cs_mdsk cs)
......
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