mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vm-migration: add MemoryMigrationContext for precopy metrics
Introduce MemoryMigrationContext to track internal metrics of an ongoing precopy memory migration. The context aggregates information such as iteration count, transferred bytes, durations, bandwidth, and estimated downtime. This enables migration logic to make decisions based on runtime characteristics, such as terminating iterations once the expected downtime is below a target threshold. The type is used in the next commit to implement iteration-based migration metrics. Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
committed by
Rob Bradford
parent
447a4c236b
commit
beb5808406
@@ -376,6 +376,11 @@ impl MemoryRangeTable {
|
||||
}
|
||||
Self { data }
|
||||
}
|
||||
|
||||
/// Returns the effective size in bytes.
|
||||
pub fn effective_size(&self) -> u64 {
|
||||
self.data.iter().map(|r| r.length).sum()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user