cargo fmt
This commit is contained in:
parent
efc175b45b
commit
4eca032745
|
@ -4,7 +4,7 @@ BridgeLine::random() or private fields */
|
|||
use super::bridge_table::BridgeLine;
|
||||
use super::proto::*;
|
||||
use super::*;
|
||||
use chrono::{Utc, DateTime, NaiveTime, Timelike};
|
||||
use chrono::{DateTime, NaiveTime, Timelike, Utc};
|
||||
use rand::Rng;
|
||||
use statistical::{mean, standard_deviation};
|
||||
use std::collections::HashSet;
|
||||
|
@ -760,7 +760,7 @@ fn stats_test_trust_levels() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let (open_perf_stat, cred) = th.open_invite();
|
||||
|
@ -884,7 +884,7 @@ fn stats_test_invitations() {
|
|||
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -934,7 +934,7 @@ fn stats_test_percent_blockage_migration_05() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -967,7 +967,7 @@ fn stats_test_percent_blockage_migration_010() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1000,7 +1000,7 @@ fn stats_test_percent_blockage_migration_15() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1033,7 +1033,7 @@ fn stats_test_percent_blockage_migration_20() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1066,7 +1066,7 @@ fn stats_test_percent_blockage_migration_25() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1099,7 +1099,7 @@ fn stats_test_percent_blockage_migration_30() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1132,7 +1132,7 @@ fn stats_test_percent_blockage_migration_35() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1165,7 +1165,7 @@ fn stats_test_percent_blockage_migration_40() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1198,7 +1198,7 @@ fn stats_test_percent_blockage_migration_45() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1231,7 +1231,7 @@ fn stats_test_percent_blockage_migration_50() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1264,7 +1264,7 @@ fn stats_test_percent_blockage_migration_55() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1297,7 +1297,7 @@ fn stats_test_percent_blockage_migration_60() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1330,7 +1330,7 @@ fn stats_test_percent_blockage_migration_65() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1363,7 +1363,7 @@ fn stats_test_percent_blockage_migration_70() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1396,7 +1396,7 @@ fn stats_test_percent_blockage_migration_75() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1429,7 +1429,7 @@ fn stats_test_percent_blockage_migration_80() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1462,7 +1462,7 @@ fn stats_test_percent_blockage_migration_85() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1495,7 +1495,7 @@ fn stats_test_percent_blockage_migration_90() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1528,7 +1528,7 @@ fn stats_test_percent_blockage_migration_95() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1561,7 +1561,7 @@ fn stats_test_percent_blockage_migration_100() {
|
|||
let h: NaiveTime = DateTime::time(&Utc::now());
|
||||
if h.hour() == 23 && h.minute() == 59 {
|
||||
println!("Wait for UTC 00:00");
|
||||
thread::sleep(Duration::new(60,0));
|
||||
thread::sleep(Duration::new(60, 0));
|
||||
println!("Ready to work again");
|
||||
}
|
||||
let cred = th.open_invite().1 .0;
|
||||
|
@ -1685,16 +1685,56 @@ fn print_stats_test_results(
|
|||
resp_time: Vec<f64>,
|
||||
resp_handle_time: Vec<f64>,
|
||||
) {
|
||||
let mean_req_size = if req_size.len() > 0 {mean(&req_size)} else {0.0};
|
||||
let req_std_dev = if req_size.len() > 1 {standard_deviation(&req_size, Some(mean_req_size))} else {0.0};
|
||||
let mean_req_time = if req_time.len() > 0 {mean(&req_time)} else {0.0};
|
||||
let req_time_std_dev = if req_time.len() > 1 {standard_deviation(&req_time, Some(mean_req_time))} else {0.0};
|
||||
let mean_resp_size = if resp_size.len() > 0 {mean(&resp_size)} else {0.0};
|
||||
let resp_std_dev = if resp_size.len() > 1 {standard_deviation(&resp_size, Some(mean_resp_size))} else {0.0};
|
||||
let mean_resp_time = if resp_time.len() > 0 {mean(&resp_time)} else {0.0};
|
||||
let resp_time_std_dev = if resp_time.len() > 1 {standard_deviation(&resp_time, Some(mean_resp_time))} else {0.0};
|
||||
let mean_resp_handle_time = if resp_handle_time.len() > 0 {mean(&resp_handle_time)} else {0.0};
|
||||
let resp_handle_time_std_dev = if resp_handle_time.len() > 1 {standard_deviation(&resp_handle_time, Some(mean_resp_handle_time))} else {0.0};
|
||||
let mean_req_size = if req_size.len() > 0 {
|
||||
mean(&req_size)
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
let req_std_dev = if req_size.len() > 1 {
|
||||
standard_deviation(&req_size, Some(mean_req_size))
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
let mean_req_time = if req_time.len() > 0 {
|
||||
mean(&req_time)
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
let req_time_std_dev = if req_time.len() > 1 {
|
||||
standard_deviation(&req_time, Some(mean_req_time))
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
let mean_resp_size = if resp_size.len() > 0 {
|
||||
mean(&resp_size)
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
let resp_std_dev = if resp_size.len() > 1 {
|
||||
standard_deviation(&resp_size, Some(mean_resp_size))
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
let mean_resp_time = if resp_time.len() > 0 {
|
||||
mean(&resp_time)
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
let resp_time_std_dev = if resp_time.len() > 1 {
|
||||
standard_deviation(&resp_time, Some(mean_resp_time))
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
let mean_resp_handle_time = if resp_handle_time.len() > 0 {
|
||||
mean(&resp_handle_time)
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
let resp_handle_time_std_dev = if resp_handle_time.len() > 1 {
|
||||
standard_deviation(&resp_handle_time, Some(mean_resp_handle_time))
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
|
||||
println!("Average request size = {} bytes", mean_req_size);
|
||||
println!("Request size standard deviation = {} bytes", req_std_dev);
|
||||
|
|
Loading…
Reference in New Issue