@@ -410,6 +410,10 @@ pub struct PutRequestsMetrics {
410410 pub drive_count : SharedIncMetric ,
411411 /// Number of failures in attaching a block device.
412412 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 ,
413417 /// Number of PUTs for initializing the logging system.
414418 pub logger_count : SharedIncMetric ,
415419 /// Number of failures in initializing the logging system.
@@ -449,6 +453,8 @@ impl PutRequestsMetrics {
449453 boot_source_fails : SharedIncMetric :: new ( ) ,
450454 drive_count : SharedIncMetric :: new ( ) ,
451455 drive_fails : SharedIncMetric :: new ( ) ,
456+ hotplug : SharedIncMetric :: new ( ) ,
457+ hotplug_fails : SharedIncMetric :: new ( ) ,
452458 logger_count : SharedIncMetric :: new ( ) ,
453459 logger_fails : SharedIncMetric :: new ( ) ,
454460 machine_cfg_count : SharedIncMetric :: new ( ) ,
@@ -824,6 +830,28 @@ impl VmmMetrics {
824830 }
825831}
826832
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+
827855// The sole purpose of this struct is to produce an UTC timestamp when an instance is serialized.
828856#[ derive( Debug , Default ) ]
829857struct SerializeToUtcTimestampMs ;
@@ -887,6 +915,8 @@ pub struct FirecrackerMetrics {
887915 pub deprecated_api : DeprecatedApiMetrics ,
888916 /// Metrics related to API GET requests.
889917 pub get_api_requests : GetRequestsMetrics ,
918+ /// Metrics related to hot-plugging.
919+ pub hotplug : HotplugMetrics ,
890920 #[ serde( flatten) ]
891921 /// Metrics related to the legacy device.
892922 pub legacy_dev_ser : LegacyDevMetricsSerializeProxy ,
@@ -931,6 +961,7 @@ impl FirecrackerMetrics {
931961 block_ser : BlockMetricsSerializeProxy { } ,
932962 deprecated_api : DeprecatedApiMetrics :: new ( ) ,
933963 get_api_requests : GetRequestsMetrics :: new ( ) ,
964+ hotplug : HotplugMetrics :: new ( ) ,
934965 legacy_dev_ser : LegacyDevMetricsSerializeProxy { } ,
935966 latencies_us : PerformanceMetrics :: new ( ) ,
936967 logger : LoggerSystemMetrics :: new ( ) ,
0 commit comments