mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
test_infra: make measure_virtio_net_throughput & co measure PPS too
While measuring UDP PPS, we saturate the link, so there are packets lost. We only account for the packets that are not lost. Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
@@ -105,7 +105,7 @@ pub fn performance_net_throughput(control: &PerformanceTestControl) -> f64 {
|
||||
|
||||
let r = std::panic::catch_unwind(|| {
|
||||
guest.wait_vm_boot(None).unwrap();
|
||||
measure_virtio_net_throughput(test_timeout, num_queues / 2, &guest, rx).unwrap()
|
||||
measure_virtio_net_throughput(test_timeout, num_queues / 2, &guest, rx, true).unwrap()
|
||||
});
|
||||
|
||||
let _ = child.kill();
|
||||
@@ -429,7 +429,7 @@ mod tests {
|
||||
}
|
||||
"#;
|
||||
assert_eq!(
|
||||
parse_iperf3_output(output.as_bytes(), true).unwrap(),
|
||||
parse_iperf3_output(output.as_bytes(), true, true).unwrap(),
|
||||
23957198874.604115
|
||||
);
|
||||
|
||||
@@ -448,9 +448,31 @@ mod tests {
|
||||
}
|
||||
"#;
|
||||
assert_eq!(
|
||||
parse_iperf3_output(output.as_bytes(), false).unwrap(),
|
||||
parse_iperf3_output(output.as_bytes(), false, true).unwrap(),
|
||||
39520744482.79
|
||||
);
|
||||
let output = r#"
|
||||
{
|
||||
"end": {
|
||||
"sum": {
|
||||
"start": 0,
|
||||
"end": 5.000036,
|
||||
"seconds": 5.000036,
|
||||
"bytes": 29944971264,
|
||||
"bits_per_second": 47911877363.396217,
|
||||
"jitter_ms": 0.0038609822983198556,
|
||||
"lost_packets": 16,
|
||||
"packets": 913848,
|
||||
"lost_percent": 0.0017508382137948542,
|
||||
"sender": true
|
||||
}
|
||||
}
|
||||
}
|
||||
"#;
|
||||
assert_eq!(
|
||||
parse_iperf3_output(output.as_bytes(), true, false).unwrap(),
|
||||
182765.08409139456
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user