Skip to content

Commit 71a4352

Browse files
committed
CP-309998: Add NUMA VM metrics to CLI
Signed-off-by: Christian Pardillo Laursen <christian.pardillolaursen@citrix.com>
1 parent ea4d6a2 commit 71a4352

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

ocaml/xapi-cli-server/records.ml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2156,6 +2156,31 @@ let vm_record rpc session_id vm =
21562156
)
21572157
~get_map:(fun () -> (x ()).API.vM_platform)
21582158
()
2159+
; make_field ~name:"numa-optimised"
2160+
~get:(fun () ->
2161+
Option.fold ~none:"false"
2162+
~some:(fun m -> string_of_bool m.API.vM_metrics_numa_optimised)
2163+
(xm ())
2164+
)
2165+
()
2166+
; make_field ~name:"numa-nodes"
2167+
~get:(fun () ->
2168+
Option.fold ~none:"0"
2169+
~some:(fun m -> Int64.to_string m.API.vM_metrics_numa_nodes)
2170+
(xm ())
2171+
)
2172+
()
2173+
; make_field ~name:"numa-node-memory"
2174+
~get:(fun () ->
2175+
Option.fold ~none:"[]"
2176+
~some:(fun m ->
2177+
map_and_concat
2178+
(fun (x, y) -> Printf.sprintf "%Li: %Li" x y)
2179+
m.API.vM_metrics_numa_node_memory
2180+
)
2181+
(xm ())
2182+
)
2183+
()
21592184
; make_field ~name:"allowed-operations"
21602185
~get:(fun () ->
21612186
map_and_concat Record_util.vm_operation_to_string

0 commit comments

Comments
 (0)