@@ -410,6 +410,10 @@ pub struct PutRequestsMetrics {
410
410
pub drive_count : SharedIncMetric ,
411
411
/// Number of failures in attaching a block device.
412
412
pub drive_fails : SharedIncMetric ,
413
+ /// Number of PUTs for hotplugging
414
+ pub hotplug : SharedIncMetric ,
415
+ /// Number of failures for hotplugging.
416
+ pub hotplug_fails : SharedIncMetric ,
413
417
/// Number of PUTs for initializing the logging system.
414
418
pub logger_count : SharedIncMetric ,
415
419
/// Number of failures in initializing the logging system.
@@ -449,6 +453,8 @@ impl PutRequestsMetrics {
449
453
boot_source_fails : SharedIncMetric :: new ( ) ,
450
454
drive_count : SharedIncMetric :: new ( ) ,
451
455
drive_fails : SharedIncMetric :: new ( ) ,
456
+ hotplug : SharedIncMetric :: new ( ) ,
457
+ hotplug_fails : SharedIncMetric :: new ( ) ,
452
458
logger_count : SharedIncMetric :: new ( ) ,
453
459
logger_fails : SharedIncMetric :: new ( ) ,
454
460
machine_cfg_count : SharedIncMetric :: new ( ) ,
@@ -824,6 +830,28 @@ impl VmmMetrics {
824
830
}
825
831
}
826
832
833
+ /// Metrics specific to hotplugging
834
+ #[ derive( Debug , Default , Serialize ) ]
835
+ pub struct HotplugMetrics {
836
+ pub hotplug_request_count : SharedIncMetric ,
837
+ pub hotplug_request_fails : SharedIncMetric ,
838
+ pub vcpu_hotplug_request_fails : SharedIncMetric ,
839
+ pub vcpus_added : SharedIncMetric ,
840
+ }
841
+
842
+ impl HotplugMetrics {
843
+ /// Const default construction.
844
+
845
+ pub const fn new ( ) -> Self {
846
+ Self {
847
+ hotplug_request_count : SharedIncMetric :: new ( ) ,
848
+ hotplug_request_fails : SharedIncMetric :: new ( ) ,
849
+ vcpu_hotplug_request_fails : SharedIncMetric :: new ( ) ,
850
+ vcpus_added : SharedIncMetric :: new ( ) ,
851
+ }
852
+ }
853
+ }
854
+
827
855
// The sole purpose of this struct is to produce an UTC timestamp when an instance is serialized.
828
856
#[ derive( Debug , Default ) ]
829
857
struct SerializeToUtcTimestampMs ;
@@ -887,6 +915,8 @@ pub struct FirecrackerMetrics {
887
915
pub deprecated_api : DeprecatedApiMetrics ,
888
916
/// Metrics related to API GET requests.
889
917
pub get_api_requests : GetRequestsMetrics ,
918
+ /// Metrics related to hot-plugging.
919
+ pub hotplug : HotplugMetrics ,
890
920
#[ serde( flatten) ]
891
921
/// Metrics related to the legacy device.
892
922
pub legacy_dev_ser : LegacyDevMetricsSerializeProxy ,
@@ -931,6 +961,7 @@ impl FirecrackerMetrics {
931
961
block_ser : BlockMetricsSerializeProxy { } ,
932
962
deprecated_api : DeprecatedApiMetrics :: new ( ) ,
933
963
get_api_requests : GetRequestsMetrics :: new ( ) ,
964
+ hotplug : HotplugMetrics :: new ( ) ,
934
965
legacy_dev_ser : LegacyDevMetricsSerializeProxy { } ,
935
966
latencies_us : PerformanceMetrics :: new ( ) ,
936
967
logger : LoggerSystemMetrics :: new ( ) ,
0 commit comments