Skip to content

Commit

Permalink
feat(vhost-user): added config_change_time_us to the metrics
Browse files Browse the repository at this point in the history
Added `config_change_time_us` to the metrics for vhost-user devices.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
  • Loading branch information
ShadowCurse committed Nov 23, 2023
1 parent b93e9c3 commit b35bff0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/vmm/src/devices/virtio/vhost_user_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,28 @@
//! "cfg_fails": "SharedIncMetric",
//! "init_time_us": SharedStoreMetric,
//! "activate_time_us": SharedStoreMetric,
//! "config_change_time_us": SharedStoreMetric,
//! }
//! "vhost_user_{mod}_id1": {
//! "activate_fails": "SharedIncMetric",
//! "cfg_fails": "SharedIncMetric",
//! "init_time_us": SharedStoreMetric,
//! "activate_time_us": SharedStoreMetric,
//! "config_change_time_us": SharedStoreMetric,
//! }
//! ...
//! "vhost_user_{mod}_idN": {
//! "activate_fails": "SharedIncMetric",
//! "cfg_fails": "SharedIncMetric",
//! "init_time_us": SharedStoreMetric,
//! "activate_time_us": SharedStoreMetric,
//! "config_change_time_us": SharedStoreMetric,
//! }
//! }
//! ```
//! Each `vhost_user` field in the example above is a serializable `VhostUserDeviceMetrics`
//! structure collecting metrics such as `activate_fails`, `cfg_fails`, `init_time_us` and
//! `activate_time_us` for the vhost_user device.
//! structure collecting metrics such as `activate_fails`, `cfg_fails`, `init_time_us`,
//! `activate_time_us` and `config_change_time_us` for the vhost_user device.
//! For vhost-user block device having endpoint "/drives/drv0" the emitted metrics would be
//! `vhost_user_block_drv0`.
//! For vhost-user block device having endpoint "/drives/drvN" the emitted metrics would be
Expand Down Expand Up @@ -139,6 +142,8 @@ pub struct VhostUserDeviceMetrics {
pub init_time_us: SharedStoreMetric,
// Vhost-user activate time in microseconds.
pub activate_time_us: SharedStoreMetric,
// Vhost-user config change time in microseconds.
pub config_change_time_us: SharedStoreMetric,
}

#[cfg(test)]
Expand Down
1 change: 1 addition & 0 deletions tests/host_tools/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ def validate_fc_metrics(metrics):
"cfg_fails",
"init_time_us",
"activate_time_us",
"config_change_time_us",
]
vhost_user_devices.append(metrics_name)

Expand Down

0 comments on commit b35bff0

Please sign in to comment.