Added timing

This commit is contained in:
onyinyang 2022-04-03 05:03:35 +00:00
parent cbd5370361
commit fe60fcfc2a
2 changed files with 186 additions and 50 deletions

View File

@ -10,6 +10,7 @@ ed25519-dalek = "1"
# zkp = { version = "0.8", features = ["debug-transcript"] } # zkp = { version = "0.8", features = ["debug-transcript"] }
zkp = "0.8" zkp = "0.8"
bincode = "1" bincode = "1"
chrono = "0.4"
rand = "0.7" rand = "0.7"
serde = "1" serde = "1"
serde_with = "1.9.1" serde_with = "1.9.1"

View File

@ -4,9 +4,11 @@ BridgeLine::random() or private fields */
use super::bridge_table::BridgeLine; use super::bridge_table::BridgeLine;
use super::proto::*; use super::proto::*;
use super::*; use super::*;
use chrono::{Utc, DateTime, NaiveTime, Timelike};
use rand::Rng; use rand::Rng;
use statistical::{mean, standard_deviation}; use statistical::{mean, standard_deviation};
use std::collections::HashSet; use std::collections::HashSet;
use std::thread;
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
struct PerfStat { struct PerfStat {
@ -370,7 +372,7 @@ impl TestHarness {
} }
} }
#[test] //#[test]
fn test_open_invite() { fn test_open_invite() {
let mut th = TestHarness::new(); let mut th = TestHarness::new();
@ -391,7 +393,7 @@ fn test_open_invite() {
assert!(bridgeline == bucket.0[0]); assert!(bridgeline == bucket.0[0]);
} }
#[test] //#[test]
fn test_trust_promotion() { fn test_trust_promotion() {
let mut th = TestHarness::new(); let mut th = TestHarness::new();
@ -415,7 +417,7 @@ fn test_trust_promotion() {
assert!(th.ba.verify_reachability(&bucket.1.unwrap())); assert!(th.ba.verify_reachability(&bucket.1.unwrap()));
} }
#[test] //#[test]
fn test_level0_migration() { fn test_level0_migration() {
let mut th = TestHarness::new(); let mut th = TestHarness::new();
@ -446,7 +448,7 @@ fn test_level0_migration() {
assert!(th.ba.verify_reachability(&bucket.1.unwrap())); assert!(th.ba.verify_reachability(&bucket.1.unwrap()));
} }
#[test] //#[test]
fn test_level_up() { fn test_level_up() {
let mut th = TestHarness::new(); let mut th = TestHarness::new();
@ -501,7 +503,7 @@ fn test_level_up() {
assert!(th.ba.verify_lox(&cred4)); assert!(th.ba.verify_lox(&cred4));
} }
#[test] //#[test]
fn test_issue_invite() { fn test_issue_invite() {
let mut th = TestHarness::new(); let mut th = TestHarness::new();
@ -541,7 +543,7 @@ fn test_issue_invite() {
println!("invite = {:?}", invite); println!("invite = {:?}", invite);
} }
#[test] //#[test]
fn test_redeem_invite() { fn test_redeem_invite() {
let mut th = TestHarness::new(); let mut th = TestHarness::new();
@ -591,7 +593,7 @@ fn test_redeem_invite() {
println!("bob_cred = {:?}", bob_cred); println!("bob_cred = {:?}", bob_cred);
} }
#[test] //#[test]
fn test_mark_unreachable() { fn test_mark_unreachable() {
let mut th = TestHarness::new(); let mut th = TestHarness::new();
@ -641,7 +643,7 @@ fn test_mark_unreachable() {
println!("openinv = {:?}\n", th.bdb.openinv_buckets); println!("openinv = {:?}\n", th.bdb.openinv_buckets);
} }
#[test] //#[test]
fn test_blockage_migration() { fn test_blockage_migration() {
let mut th = TestHarness::new(); let mut th = TestHarness::new();
@ -712,9 +714,9 @@ fn test_blockage_migration() {
assert!(th.ba.verify_lox(&cred4)); assert!(th.ba.verify_lox(&cred4));
} }
#[test] //#[test]
fn stats_test_trust_levels() { fn stats_test_trust_levels() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![900, 1050, 1200, 1350, 1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
@ -750,6 +752,12 @@ fn stats_test_trust_levels() {
let mut open_resp_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 open_resp_handle_time: Vec<f64> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let (open_perf_stat, cred) = th.open_invite(); let (open_perf_stat, cred) = th.open_invite();
th.advance_days(30); th.advance_days(30);
let (tp_perf_stat, migcred) = th.trust_promotion(&cred.0); let (tp_perf_stat, migcred) = th.trust_promotion(&cred.0);
@ -849,9 +857,9 @@ fn stats_test_trust_levels() {
} }
} }
#[test] //#[test]
fn stats_test_invitations() { fn stats_test_invitations() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![1050, 1200, 1350, 1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
@ -867,6 +875,13 @@ fn stats_test_invitations() {
let mut red_resp_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 red_resp_handle_time: Vec<f64> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -903,14 +918,20 @@ fn stats_test_invitations() {
} }
} }
#[test] //#[test]
fn stats_test_blockage_migration_5() { fn stats_test_blockage_migration_5() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![1350, 1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..1000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -930,14 +951,20 @@ fn stats_test_blockage_migration_5() {
} }
} }
#[test] //#[test]
fn stats_test_blockage_migration_10() { fn stats_test_blockage_migration_10() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![1050, 1200, 1350, 1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..1000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -957,14 +984,20 @@ fn stats_test_blockage_migration_10() {
} }
} }
#[test] //#[test]
fn stats_test_blockage_migration_15() { fn stats_test_blockage_migration_15() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![1050, 1200, 1350, 1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -984,14 +1017,20 @@ fn stats_test_blockage_migration_15() {
} }
} }
#[test] //#[test]
fn stats_test_blockage_migration_20() { fn stats_test_blockage_migration_20() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![1350, 1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -1011,14 +1050,20 @@ fn stats_test_blockage_migration_20() {
} }
} }
#[test] //#[test]
fn stats_test_blockage_migration_25() { fn stats_test_blockage_migration_25() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![1350, 1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -1038,14 +1083,20 @@ fn stats_test_blockage_migration_25() {
} }
} }
#[test] //#[test]
fn stats_test_blockage_migration_30() { fn stats_test_blockage_migration_30() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![1050, 1200, 1350, 1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -1065,14 +1116,20 @@ fn stats_test_blockage_migration_30() {
} }
} }
#[test] //#[test]
fn stats_test_blockage_migration_35() { fn stats_test_blockage_migration_35() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![1200, 1350, 1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -1094,12 +1151,18 @@ fn stats_test_blockage_migration_35() {
#[test] #[test]
fn stats_test_blockage_migration_40() { fn stats_test_blockage_migration_40() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![900];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -1121,12 +1184,18 @@ fn stats_test_blockage_migration_40() {
#[test] #[test]
fn stats_test_blockage_migration_45() { fn stats_test_blockage_migration_45() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![900];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -1148,12 +1217,18 @@ fn stats_test_blockage_migration_45() {
#[test] #[test]
fn stats_test_blockage_migration_50() { fn stats_test_blockage_migration_50() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -1175,12 +1250,18 @@ fn stats_test_blockage_migration_50() {
#[test] #[test]
fn stats_test_blockage_migration_55() { fn stats_test_blockage_migration_55() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![900];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -1200,14 +1281,20 @@ fn stats_test_blockage_migration_55() {
} }
} }
#[test] ////#[test]
fn stats_test_blockage_migration_60() { fn stats_test_blockage_migration_60() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![1200, 1350, 1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -1227,14 +1314,20 @@ fn stats_test_blockage_migration_60() {
} }
} }
#[test] //#[test]
fn stats_test_blockage_migration_65() { fn stats_test_blockage_migration_65() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![1200, 1350, 1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -1254,14 +1347,20 @@ fn stats_test_blockage_migration_65() {
} }
} }
#[test] //#[test]
fn stats_test_blockage_migration_70() { fn stats_test_blockage_migration_70() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![1200, 1350, 1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -1281,14 +1380,20 @@ fn stats_test_blockage_migration_70() {
} }
} }
#[test] //#[test]
fn stats_test_blockage_migration_75() { fn stats_test_blockage_migration_75() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![1200, 1350, 1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -1308,14 +1413,20 @@ fn stats_test_blockage_migration_75() {
} }
} }
#[test] //#[test]
fn stats_test_blockage_migration_80() { fn stats_test_blockage_migration_80() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![900, 1050, 1200, 1350, 1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -1335,14 +1446,20 @@ fn stats_test_blockage_migration_80() {
} }
} }
#[test] //#[test]
fn stats_test_blockage_migration_85() { fn stats_test_blockage_migration_85() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![1050, 1200, 1350, 1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -1362,14 +1479,20 @@ fn stats_test_blockage_migration_85() {
} }
} }
#[test] //#[test]
fn stats_test_blockage_migration_90() { fn stats_test_blockage_migration_90() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -1389,14 +1512,20 @@ fn stats_test_blockage_migration_90() {
} }
} }
#[test] //#[test]
fn stats_test_blockage_migration_95() { fn stats_test_blockage_migration_95() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![1050, 1200, 1350, 1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);
@ -1416,14 +1545,20 @@ fn stats_test_blockage_migration_95() {
} }
} }
#[test] //#[test]
fn stats_test_blockage_migration_100() { fn stats_test_blockage_migration_100() {
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; let buckets: Vec<u16> = vec![750, 900, 1050, 1200, 1350, 1500];
for x in buckets { for x in buckets {
let mut th = TestHarness::new_buckets(x, x); let mut th = TestHarness::new_buckets(x, x);
let mut credentials: Vec<cred::Lox> = Vec::new(); let mut credentials: Vec<cred::Lox> = Vec::new();
for _ in 0..10000 { for _ in 0..10000 {
let h: NaiveTime = DateTime::time(&Utc::now());
if h.hour() == 23 && h.minute() == 59 {
println!("Biding my time for a minute");
thread::sleep(Duration::new(60,0));
println!("Ready to work again");
}
let cred = th.open_invite().1 .0; let cred = th.open_invite().1 .0;
th.advance_days(30); th.advance_days(30);
let (_, migcred) = th.trust_promotion(&cred); let (_, migcred) = th.trust_promotion(&cred);