|
@@ -790,18 +790,6 @@ fn stats_test_trust_levels() {
|
|
four_resp_size.push(four_perf_stat.resp_len as f64);
|
|
four_resp_size.push(four_perf_stat.resp_len as f64);
|
|
four_resp_time.push(four_perf_stat.resp_t.as_secs_f64());
|
|
four_resp_time.push(four_perf_stat.resp_t.as_secs_f64());
|
|
four_resp_handle_time.push(four_perf_stat.resp_handle_t.as_secs_f64());
|
|
four_resp_handle_time.push(four_perf_stat.resp_handle_t.as_secs_f64());
|
|
- // println!("OPEN_INVITE");
|
|
|
|
- // print_time_test_results(open_perf_stat);
|
|
|
|
- // println!("TRUST_PROMOTION");
|
|
|
|
- // print_time_test_results(tp_perf_stat);
|
|
|
|
- // println!("LEVEL_1_MIGRATION");
|
|
|
|
- // print_time_test_results(mig_perf_stat);
|
|
|
|
- // println!("LEVEL_2_UP");
|
|
|
|
- // print_time_test_results(sec_perf_stat);
|
|
|
|
- // println!("LEVEL_3_UP");
|
|
|
|
- // print_time_test_results(three_perf_stat);
|
|
|
|
- // println!("LEVEL_4_UP");
|
|
|
|
- // print_time_test_results(four_perf_stat);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
println!("\n***START: {}*3*2 BUCKETS LEVELS***\n", x);
|
|
println!("\n***START: {}*3*2 BUCKETS LEVELS***\n", x);
|
|
@@ -1454,188 +1442,6 @@ fn stats_test_blockage_migration_100() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-//#[test] Check if times/sizes change after blocking
|
|
|
|
-fn stats_test_blockage_migration_incremental_and_levels(x: u16) {
|
|
|
|
- let mut th = TestHarness::new_buckets(x, x);
|
|
|
|
- for y in 0..15 {
|
|
|
|
- let mut req_size: Vec<f64> = Vec::new();
|
|
|
|
- let mut resp_size: Vec<f64> = Vec::new();
|
|
|
|
- let mut req_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut resp_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut resp_handle_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut red_req_size: Vec<f64> = Vec::new();
|
|
|
|
- let mut red_resp_size: Vec<f64> = Vec::new();
|
|
|
|
- let mut red_req_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut red_resp_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut red_resp_handle_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut promo_req_size: Vec<f64> = Vec::new();
|
|
|
|
- let mut promo_resp_size: Vec<f64> = Vec::new();
|
|
|
|
- let mut promo_req_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut promo_resp_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut promo_resp_handle_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut mig_req_size: Vec<f64> = Vec::new();
|
|
|
|
- let mut mig_resp_size: Vec<f64> = Vec::new();
|
|
|
|
- let mut mig_req_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut mig_resp_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut mig_resp_handle_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut sec_req_size: Vec<f64> = Vec::new();
|
|
|
|
- let mut sec_resp_size: Vec<f64> = Vec::new();
|
|
|
|
- let mut sec_req_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut sec_resp_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut sec_resp_handle_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut three_req_size: Vec<f64> = Vec::new();
|
|
|
|
- let mut three_resp_size: Vec<f64> = Vec::new();
|
|
|
|
- let mut three_req_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut three_resp_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut three_resp_handle_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut four_req_size: Vec<f64> = Vec::new();
|
|
|
|
- let mut four_resp_size: Vec<f64> = Vec::new();
|
|
|
|
- let mut four_req_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut four_resp_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut four_resp_handle_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut open_req_size: Vec<f64> = Vec::new();
|
|
|
|
- let mut open_resp_size: Vec<f64> = Vec::new();
|
|
|
|
- let mut open_req_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut open_resp_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut open_resp_handle_time: Vec<f64> = Vec::new();
|
|
|
|
- let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
|
- for _ in 0..10000 {
|
|
|
|
- let (open_perf_stat, cred) = th.open_invite();
|
|
|
|
- th.advance_days(30);
|
|
|
|
- let (tp_perf_stat, migcred) = th.trust_promotion(&cred.0);
|
|
|
|
- let (mig_perf_stat, cred1) = th.level0_migration(&cred.0, &migcred);
|
|
|
|
- th.advance_days(14);
|
|
|
|
- let (sec_perf_stat, cred2) = th.level_up(&cred1);
|
|
|
|
- let (perf_stat, (cred2a, invite)) = th.issue_invite(&cred2);
|
|
|
|
- let (bob_perf_stat, _) = th.redeem_invite(&invite);
|
|
|
|
- th.advance_days(28);
|
|
|
|
- let (three_perf_stat, cred3) = th.level_up(&cred2a);
|
|
|
|
- th.advance_days(56);
|
|
|
|
- let (four_perf_stat, cred4) = th.level_up(&cred3);
|
|
|
|
- credentials.push(cred4);
|
|
|
|
- open_req_size.push(open_perf_stat.req_len as f64);
|
|
|
|
- open_req_time.push(open_perf_stat.req_t.as_secs_f64());
|
|
|
|
- open_resp_size.push(open_perf_stat.resp_len as f64);
|
|
|
|
- open_resp_time.push(open_perf_stat.resp_t.as_secs_f64());
|
|
|
|
- open_resp_handle_time.push(open_perf_stat.resp_handle_t.as_secs_f64());
|
|
|
|
- promo_req_size.push(tp_perf_stat.req_len as f64);
|
|
|
|
- promo_req_time.push(tp_perf_stat.req_t.as_secs_f64());
|
|
|
|
- promo_resp_size.push(tp_perf_stat.resp_len as f64);
|
|
|
|
- promo_resp_time.push(tp_perf_stat.resp_t.as_secs_f64());
|
|
|
|
- promo_resp_handle_time.push(tp_perf_stat.resp_handle_t.as_secs_f64());
|
|
|
|
- mig_req_size.push(mig_perf_stat.req_len as f64);
|
|
|
|
- mig_req_time.push(mig_perf_stat.req_t.as_secs_f64());
|
|
|
|
- mig_resp_size.push(mig_perf_stat.resp_len as f64);
|
|
|
|
- mig_resp_time.push(mig_perf_stat.resp_t.as_secs_f64());
|
|
|
|
- mig_resp_handle_time.push(mig_perf_stat.resp_handle_t.as_secs_f64());
|
|
|
|
- sec_req_size.push(sec_perf_stat.req_len as f64);
|
|
|
|
- sec_req_time.push(sec_perf_stat.req_t.as_secs_f64());
|
|
|
|
- sec_resp_size.push(sec_perf_stat.resp_len as f64);
|
|
|
|
- sec_resp_time.push(sec_perf_stat.resp_t.as_secs_f64());
|
|
|
|
- sec_resp_handle_time.push(sec_perf_stat.resp_handle_t.as_secs_f64());
|
|
|
|
- three_req_size.push(three_perf_stat.req_len as f64);
|
|
|
|
- three_req_time.push(three_perf_stat.req_t.as_secs_f64());
|
|
|
|
- three_resp_size.push(three_perf_stat.resp_len as f64);
|
|
|
|
- three_resp_time.push(three_perf_stat.resp_t.as_secs_f64());
|
|
|
|
- three_resp_handle_time.push(three_perf_stat.resp_handle_t.as_secs_f64());
|
|
|
|
- four_req_size.push(four_perf_stat.req_len as f64);
|
|
|
|
- four_req_time.push(four_perf_stat.req_t.as_secs_f64());
|
|
|
|
- four_resp_size.push(four_perf_stat.resp_len as f64);
|
|
|
|
- four_resp_time.push(four_perf_stat.resp_t.as_secs_f64());
|
|
|
|
- four_resp_handle_time.push(four_perf_stat.resp_handle_t.as_secs_f64());
|
|
|
|
- req_size.push(perf_stat.req_len as f64);
|
|
|
|
- req_time.push(perf_stat.req_t.as_secs_f64());
|
|
|
|
- resp_size.push(perf_stat.resp_len as f64);
|
|
|
|
- resp_time.push(perf_stat.resp_t.as_secs_f64());
|
|
|
|
- resp_handle_time.push(perf_stat.resp_handle_t.as_secs_f64());
|
|
|
|
- red_req_size.push(bob_perf_stat.req_len as f64);
|
|
|
|
- red_req_time.push(bob_perf_stat.req_t.as_secs_f64());
|
|
|
|
- red_resp_size.push(bob_perf_stat.resp_len as f64);
|
|
|
|
- red_resp_time.push(bob_perf_stat.resp_t.as_secs_f64());
|
|
|
|
- red_resp_handle_time.push(bob_perf_stat.resp_handle_t.as_secs_f64());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- println!("\n***START: {}*3*2 BUCKETS FOR WEIRD TEST***\n", x);
|
|
|
|
- println!("\n----WEIRD-OPEN-INVITATION-{}-ROUND-{}--\n", x, y);
|
|
|
|
- print_stats_test_results(
|
|
|
|
- open_req_size,
|
|
|
|
- open_req_time,
|
|
|
|
- open_resp_size,
|
|
|
|
- open_resp_time,
|
|
|
|
- open_resp_handle_time,
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- println!("\n----WEIRD-TRUST-PROMOTION-1: 30 days-{}---\n", x);
|
|
|
|
- print_stats_test_results(
|
|
|
|
- promo_req_size,
|
|
|
|
- promo_req_time,
|
|
|
|
- promo_resp_size,
|
|
|
|
- promo_resp_time,
|
|
|
|
- promo_resp_handle_time,
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- println!("\n----WEIRD-TRUST-MIGRATION-0: 30 days---------{}---\n", x);
|
|
|
|
- print_stats_test_results(
|
|
|
|
- mig_req_size,
|
|
|
|
- mig_req_time,
|
|
|
|
- mig_resp_size,
|
|
|
|
- mig_resp_time,
|
|
|
|
- mig_resp_handle_time,
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- println!("\n----WEIRD-LEVEL-UP-2: 44 days-{}---\n", x);
|
|
|
|
- print_stats_test_results(
|
|
|
|
- sec_req_size,
|
|
|
|
- sec_req_time,
|
|
|
|
- sec_resp_size,
|
|
|
|
- sec_resp_time,
|
|
|
|
- sec_resp_handle_time,
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- println!("\n----WEIRD-LEVEL-UP-3: 72 days---{}---\n", x);
|
|
|
|
- print_stats_test_results(
|
|
|
|
- three_req_size,
|
|
|
|
- three_req_time,
|
|
|
|
- three_resp_size,
|
|
|
|
- three_resp_time,
|
|
|
|
- three_resp_handle_time,
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- println!("\n----WEIRD-LEVEL-UP-4: 128 days---{}---\n", x);
|
|
|
|
- print_stats_test_results(
|
|
|
|
- four_req_size,
|
|
|
|
- four_req_time,
|
|
|
|
- four_resp_size,
|
|
|
|
- four_resp_time,
|
|
|
|
- four_resp_handle_time,
|
|
|
|
- );
|
|
|
|
- println!("\n----WEIRD-ISSUE-INVITATION-{}---\n", x);
|
|
|
|
- print_stats_test_results(req_size, req_time, resp_size, resp_time, resp_handle_time);
|
|
|
|
- println!("\n----WEIRD-REDEEM-INVITATION-{}---\n", x);
|
|
|
|
- print_stats_test_results(
|
|
|
|
- red_req_size,
|
|
|
|
- red_req_time,
|
|
|
|
- red_resp_size,
|
|
|
|
- red_resp_time,
|
|
|
|
- red_resp_handle_time,
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- println!("\n----WEIRD-BLOCKING-{}---\n", x);
|
|
|
|
- block_bridges(&mut th, 11, credentials);
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-#[test]
|
|
|
|
-fn stats_test_all() {
|
|
|
|
- let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500];
|
|
|
|
-
|
|
|
|
- for x in buckets {
|
|
|
|
- stats_test_blockage_migration_incremental_and_levels(x);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- println!("\nAll done!\n");
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/// Blocks a percentage of the bridges for the passed Test Harness
|
|
/// Blocks a percentage of the bridges for the passed Test Harness
|
|
/// excluding the hot spare buckets as they will not have been handed out.
|
|
/// excluding the hot spare buckets as they will not have been handed out.
|
|
/// The logic assumes hot spare buckets are appended to the end of the bridge_table
|
|
/// The logic assumes hot spare buckets are appended to the end of the bridge_table
|
|
@@ -1702,10 +1508,6 @@ fn block_bridges(th: &mut TestHarness, percentage: usize, credentials: Vec<cred:
|
|
red_resp_size.push(block_perf_stat.resp_len as f64);
|
|
red_resp_size.push(block_perf_stat.resp_len as f64);
|
|
red_resp_time.push(block_perf_stat.resp_t.as_secs_f64());
|
|
red_resp_time.push(block_perf_stat.resp_t.as_secs_f64());
|
|
red_resp_handle_time.push(block_perf_stat.resp_handle_t.as_secs_f64());
|
|
red_resp_handle_time.push(block_perf_stat.resp_handle_t.as_secs_f64());
|
|
- // println!("CHECK_BLOCKAGE_{}", percentage);
|
|
|
|
- // print_time_test_results(perf_stat);
|
|
|
|
- // println!("BLOCKAGE_MIGRATION_{}", percentage);
|
|
|
|
- // print_time_test_results(block_perf_stat);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|