File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -2501,6 +2501,8 @@ functor
25012501 let snapshot = Db.VM. get_record ~__context ~self: vm in
25022502 reserve_memory_for_vm ~__context ~vm ~host ~snapshot
25032503 ~host_op: `vm_migrate (fun () ->
2504+ if Db.VM. get_VGPUs ~__context ~self: vm <> [] then
2505+ Xapi_stats. incr_pool_vgpu_migration_count () ;
25042506 forward_vm_op ~local_fn ~__context ~vm ~remote_fn
25052507 )
25062508 ) ;
@@ -2622,6 +2624,8 @@ functor
26222624 assert_can_migrate ~__context ~vm ~dest ~live ~vdi_map
26232625 ~vif_map ~vgpu_map ~options
26242626 ) ;
2627+ if vgpu_map <> [] then
2628+ Xapi_stats. incr_pool_vgpu_migration_count () ;
26252629 forward_migrate_send ()
26262630 )
26272631 in
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ module D = Debug.Make (struct let name = "xapi_stats" end)
1616
1717let with_lock = Xapi_stdext_threads.Threadext.Mutex. execute
1818
19+ let pool_vgpu_migration_count : int Atomic.t = Atomic. make 0
20+
21+ let incr_pool_vgpu_migration_count () = Atomic. incr pool_vgpu_migration_count
22+
1923let generate_master_stats ~__context =
2024 let session_count =
2125 Db.Session. get_all ~__context |> List. length |> Int64. of_int
@@ -44,7 +48,23 @@ let generate_master_stats ~__context =
4448 ~min: 0.0 ~units: " sessions/s" ()
4549 )
4650 in
47- [session_count_ds; task_count_ds; session_count_change_ds]
51+ let vgpu_migration_count =
52+ Atomic. exchange pool_vgpu_migration_count 0 |> Int64. of_int
53+ in
54+ let vgpu_migration_count_ds =
55+ ( Rrd. Host
56+ , Ds. ds_make ~name: " pool_vgpu_migration_rate"
57+ ~description: " Number of vGPU migrations occurred per second"
58+ ~value: (Rrd. VT_Int64 vgpu_migration_count) ~ty: Rrd. Absolute
59+ ~default: true ~min: 0. ~units: " migrations/s" ()
60+ )
61+ in
62+ [
63+ session_count_ds
64+ ; task_count_ds
65+ ; session_count_change_ds
66+ ; vgpu_migration_count_ds
67+ ]
4868
4969let gc_debug = ref true
5070
Original file line number Diff line number Diff line change @@ -18,3 +18,6 @@ val start : unit -> unit
1818
1919val stop : unit -> unit
2020(* * Stop the stats reporting thread. *)
21+
22+ val incr_pool_vgpu_migration_count : unit -> unit
23+ (* * Increments the pool_vgpu_migration_count by 1 . *)
You can’t perform that action at this time.
0 commit comments