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:
Rob Bradford 2022-02-25 10:29:02 +00:00
parent 3f4cbce900
commit 60d805771b
2 changed files with 11 additions and 11 deletions

View File

@ -84,7 +84,7 @@ impl Default for MetricsReport {
}
pub struct PerformanceTestControl {
test_time: u32,
test_timeout: u32,
test_iterations: u32,
queue_num: Option<u32>,
queue_size: Option<u32>,
@ -96,7 +96,7 @@ impl fmt::Display for PerformanceTestControl {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut output = format!(
"test_time = {}s, test_iterations = {}",
self.test_time, self.test_iterations
self.test_timeout, self.test_iterations
);
if let Some(o) = self.queue_num {
output = format!("{}, queue_num = {}", output, o);
@ -118,7 +118,7 @@ impl fmt::Display for PerformanceTestControl {
impl PerformanceTestControl {
const fn default() -> Self {
Self {
test_time: 10,
test_timeout: 10,
test_iterations: 5,
queue_num: None,
queue_size: None,
@ -161,7 +161,7 @@ impl PerformanceTest {
// Calculate the timeout for each test
// Note: To cover the setup/cleanup time, 20s is added for each iteration of the test
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",
func_ptr: performance_boot_time,
control: PerformanceTestControl {
test_time: 2,
test_timeout: 2,
test_iterations: 10,
..PerformanceTestControl::default()
},
@ -209,7 +209,7 @@ const TEST_LIST: [PerformanceTest; 15] = [
name: "performance_boot_time_pmem",
func_ptr: performance_boot_time_pmem,
control: PerformanceTestControl {
test_time: 2,
test_timeout: 2,
test_iterations: 10,
..PerformanceTestControl::default()
},

View File

@ -209,7 +209,7 @@ fn measure_virtio_net_throughput(
}
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_size = control.queue_size.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();
// '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()
});
@ -491,7 +491,7 @@ pub fn performance_boot_time(control: &PerformanceTestControl) -> f64 {
.args(&["--console", "off"])
.default_disks();
measure_boot_time(c, control.test_time).unwrap()
measure_boot_time(c, control.test_timeout).unwrap()
});
match r {
@ -521,7 +521,7 @@ pub fn performance_boot_time_pmem(control: &PerformanceTestControl) -> f64 {
.as_str(),
]);
measure_boot_time(c, control.test_time).unwrap()
measure_boot_time(c, control.test_timeout).unwrap()
});
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 {
let test_time = control.test_time;
let test_time = control.test_timeout;
let queue_num = control.queue_num.unwrap();
let queue_size = control.queue_size.unwrap();
let fio_ops = control.fio_ops.as_ref().unwrap();