mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-21 23:41:15 +00:00
performance-metrics: Rename test_time to test_timeout
This clarifies its usage vs the more ambiguous name. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
3f4cbce900
commit
60d805771b
@ -84,7 +84,7 @@ impl Default for MetricsReport {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub struct PerformanceTestControl {
|
pub struct PerformanceTestControl {
|
||||||
test_time: u32,
|
test_timeout: u32,
|
||||||
test_iterations: u32,
|
test_iterations: u32,
|
||||||
queue_num: Option<u32>,
|
queue_num: Option<u32>,
|
||||||
queue_size: Option<u32>,
|
queue_size: Option<u32>,
|
||||||
@ -96,7 +96,7 @@ impl fmt::Display for PerformanceTestControl {
|
|||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
let mut output = format!(
|
let mut output = format!(
|
||||||
"test_time = {}s, test_iterations = {}",
|
"test_time = {}s, test_iterations = {}",
|
||||||
self.test_time, self.test_iterations
|
self.test_timeout, self.test_iterations
|
||||||
);
|
);
|
||||||
if let Some(o) = self.queue_num {
|
if let Some(o) = self.queue_num {
|
||||||
output = format!("{}, queue_num = {}", output, o);
|
output = format!("{}, queue_num = {}", output, o);
|
||||||
@ -118,7 +118,7 @@ impl fmt::Display for PerformanceTestControl {
|
|||||||
impl PerformanceTestControl {
|
impl PerformanceTestControl {
|
||||||
const fn default() -> Self {
|
const fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
test_time: 10,
|
test_timeout: 10,
|
||||||
test_iterations: 5,
|
test_iterations: 5,
|
||||||
queue_num: None,
|
queue_num: None,
|
||||||
queue_size: None,
|
queue_size: None,
|
||||||
@ -161,7 +161,7 @@ impl PerformanceTest {
|
|||||||
// Calculate the timeout for each test
|
// Calculate the timeout for each test
|
||||||
// Note: To cover the setup/cleanup time, 20s is added for each iteration of the test
|
// Note: To cover the setup/cleanup time, 20s is added for each iteration of the test
|
||||||
pub fn calc_timeout(&self) -> u64 {
|
pub fn calc_timeout(&self) -> u64 {
|
||||||
((self.control.test_time + 20) * self.control.test_iterations) as u64
|
((self.control.test_timeout + 20) * self.control.test_iterations) as u64
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ const TEST_LIST: [PerformanceTest; 15] = [
|
|||||||
name: "performance_boot_time",
|
name: "performance_boot_time",
|
||||||
func_ptr: performance_boot_time,
|
func_ptr: performance_boot_time,
|
||||||
control: PerformanceTestControl {
|
control: PerformanceTestControl {
|
||||||
test_time: 2,
|
test_timeout: 2,
|
||||||
test_iterations: 10,
|
test_iterations: 10,
|
||||||
..PerformanceTestControl::default()
|
..PerformanceTestControl::default()
|
||||||
},
|
},
|
||||||
@ -209,7 +209,7 @@ const TEST_LIST: [PerformanceTest; 15] = [
|
|||||||
name: "performance_boot_time_pmem",
|
name: "performance_boot_time_pmem",
|
||||||
func_ptr: performance_boot_time_pmem,
|
func_ptr: performance_boot_time_pmem,
|
||||||
control: PerformanceTestControl {
|
control: PerformanceTestControl {
|
||||||
test_time: 2,
|
test_timeout: 2,
|
||||||
test_iterations: 10,
|
test_iterations: 10,
|
||||||
..PerformanceTestControl::default()
|
..PerformanceTestControl::default()
|
||||||
},
|
},
|
||||||
|
@ -209,7 +209,7 @@ fn measure_virtio_net_throughput(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn performance_net_throughput(control: &PerformanceTestControl) -> f64 {
|
pub fn performance_net_throughput(control: &PerformanceTestControl) -> f64 {
|
||||||
let test_time = control.test_time;
|
let test_time = control.test_timeout;
|
||||||
let queue_pairs = control.queue_num.unwrap();
|
let queue_pairs = control.queue_num.unwrap();
|
||||||
let queue_size = control.queue_size.unwrap();
|
let queue_size = control.queue_size.unwrap();
|
||||||
let rx = control.net_rx.unwrap();
|
let rx = control.net_rx.unwrap();
|
||||||
@ -361,7 +361,7 @@ pub fn performance_net_latency(control: &PerformanceTestControl) -> f64 {
|
|||||||
guest.wait_vm_boot(None).unwrap();
|
guest.wait_vm_boot(None).unwrap();
|
||||||
|
|
||||||
// 'ethr' tool will measure the latency multiple times with provided test time
|
// 'ethr' tool will measure the latency multiple times with provided test time
|
||||||
let latency = measure_virtio_net_latency(&guest, control.test_time).unwrap();
|
let latency = measure_virtio_net_latency(&guest, control.test_timeout).unwrap();
|
||||||
mean(&latency).unwrap()
|
mean(&latency).unwrap()
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -491,7 +491,7 @@ pub fn performance_boot_time(control: &PerformanceTestControl) -> f64 {
|
|||||||
.args(&["--console", "off"])
|
.args(&["--console", "off"])
|
||||||
.default_disks();
|
.default_disks();
|
||||||
|
|
||||||
measure_boot_time(c, control.test_time).unwrap()
|
measure_boot_time(c, control.test_timeout).unwrap()
|
||||||
});
|
});
|
||||||
|
|
||||||
match r {
|
match r {
|
||||||
@ -521,7 +521,7 @@ pub fn performance_boot_time_pmem(control: &PerformanceTestControl) -> f64 {
|
|||||||
.as_str(),
|
.as_str(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
measure_boot_time(c, control.test_time).unwrap()
|
measure_boot_time(c, control.test_timeout).unwrap()
|
||||||
});
|
});
|
||||||
|
|
||||||
match r {
|
match r {
|
||||||
@ -605,7 +605,7 @@ fn parse_fio_output(output: &str, fio_ops: &FioOps, num_jobs: u32) -> Result<f64
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn performance_block_io(control: &PerformanceTestControl) -> f64 {
|
pub fn performance_block_io(control: &PerformanceTestControl) -> f64 {
|
||||||
let test_time = control.test_time;
|
let test_time = control.test_timeout;
|
||||||
let queue_num = control.queue_num.unwrap();
|
let queue_num = control.queue_num.unwrap();
|
||||||
let queue_size = control.queue_size.unwrap();
|
let queue_size = control.queue_size.unwrap();
|
||||||
let fio_ops = control.fio_ops.as_ref().unwrap();
|
let fio_ops = control.fio_ops.as_ref().unwrap();
|
||||||
|
Loading…
Reference in New Issue
Block a user