Skip to content

Commit

Permalink
CP-48430 Update the running_domains metrics to count the not paused s…
Browse files Browse the repository at this point in the history
…tate domains

Signed-off-by: Lunfan Zhang <[email protected]>
  • Loading branch information
LunfanZhang committed Mar 14, 2024
1 parent 4e0d37c commit d50b592
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ocaml/xcp-rrdd/bin/rrdd/xcp_rrdd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,11 @@ let dss_loadavg () =
)
]

let count_running_domain domains =
let count_power_state_running_domains domains =
List.fold_left
(fun count (dom, _, _) -> if dom.Xenctrl.running then count + 1 else count)
(fun count (dom, _, _) ->
if not dom.Xenctrl.paused then count + 1 else count
)
0 domains

let dss_hostload xc domains =
Expand All @@ -386,7 +388,7 @@ let dss_hostload xc domains =
)
0 domains
in
let running_domains = count_running_domain domains in
let running_domains = count_power_state_running_domains domains in

let load_per_cpu = float_of_int load /. float_of_int pcpus in
[
Expand Down

0 comments on commit d50b592

Please sign in to comment.