Added the scaffolding for the jitter test. Now just need to perform the proper calculations.
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@ -25,6 +25,28 @@ pub fn ping_host(address: &str, count: &u16) {
|
||||
}
|
||||
}
|
||||
|
||||
// network jitter test
|
||||
pub fn jitter_test(address: &str, count: &u16) {
|
||||
println!("Pinging host {}, {} times to determine network jitter.", address, count);
|
||||
|
||||
// run the ping command
|
||||
let output = process::Command::new("ping")
|
||||
.arg(address)
|
||||
.arg(format!("-c {}", count))
|
||||
.output()
|
||||
.expect("Failed to execute command");
|
||||
|
||||
// check that the command succeeded
|
||||
assert!(output.status.success());
|
||||
|
||||
// grab the ping results from stdout
|
||||
let results_raw = &String::from_utf8_lossy(&output.stdout);
|
||||
let results = text::format::trim_output(results_raw, 4);
|
||||
for line in results {
|
||||
println!("{}", line);
|
||||
}
|
||||
}
|
||||
|
||||
// timed file copy test to guage bandwidth speeds
|
||||
pub fn bandwidth_test(download: &str, output: &str) {
|
||||
println!("Testing network bandwidth by downloading {}.", download);
|
||||
|
Reference in New Issue
Block a user