Skip to content

Commit

Permalink
Merge pull request xapi-project#5510 from LunfanZhang/private/luzhan/…
Browse files Browse the repository at this point in the history
…CP-48430

CP-48430 Update the running_domains metrics to include the blocked state domains
  • Loading branch information
robhoes authored Mar 14, 2024
2 parents 9b94769 + d50b592 commit 0f6163e
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 0f6163e

Please sign in to comment.