|
@@ -11,6 +11,20 @@ use std::collections::HashSet;
|
|
|
use std::thread;
|
|
|
use std::time::{Duration, Instant};
|
|
|
|
|
|
+#[cfg(feature = "fast")]
|
|
|
+const USERS: usize = 100;
|
|
|
+#[cfg(not(feature = "fast"))]
|
|
|
+const USERS: usize = 10000;
|
|
|
+
|
|
|
+/*cfg_if::cfg_if! {
|
|
|
+ if #[cfg(feature = "fast")]{
|
|
|
+ const USERS: usize = 10;
|
|
|
+ } else {
|
|
|
+ const USERS: usize = 10000;
|
|
|
+ }
|
|
|
+}
|
|
|
+*/
|
|
|
+
|
|
|
struct PerfStat {
|
|
|
// Report performance metrics for each test
|
|
|
req_len: usize,
|
|
@@ -751,7 +765,7 @@ fn stats_test_trust_levels() {
|
|
|
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();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -874,7 +888,7 @@ fn stats_test_invitations() {
|
|
|
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();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
@@ -921,11 +935,12 @@ fn stats_test_invitations() {
|
|
|
#[test]
|
|
|
fn stats_test_percent_blockage_migration_05() {
|
|
|
let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500];
|
|
|
+ println!("USERS:{}",USERS);
|
|
|
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -958,7 +973,7 @@ fn stats_test_percent_blockage_migration_010() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -991,7 +1006,7 @@ fn stats_test_percent_blockage_migration_15() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -1024,7 +1039,7 @@ fn stats_test_percent_blockage_migration_20() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -1057,7 +1072,7 @@ fn stats_test_percent_blockage_migration_25() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -1090,7 +1105,7 @@ fn stats_test_percent_blockage_migration_30() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -1123,7 +1138,7 @@ fn stats_test_percent_blockage_migration_35() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -1156,7 +1171,7 @@ fn stats_test_percent_blockage_migration_40() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -1189,7 +1204,7 @@ fn stats_test_percent_blockage_migration_45() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -1222,7 +1237,7 @@ fn stats_test_percent_blockage_migration_50() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -1255,7 +1270,7 @@ fn stats_test_percent_blockage_migration_55() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -1288,7 +1303,7 @@ fn stats_test_percent_blockage_migration_60() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -1321,7 +1336,7 @@ fn stats_test_percent_blockage_migration_65() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -1354,7 +1369,7 @@ fn stats_test_percent_blockage_migration_70() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -1387,7 +1402,7 @@ fn stats_test_percent_blockage_migration_75() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -1420,7 +1435,7 @@ fn stats_test_percent_blockage_migration_80() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -1453,7 +1468,7 @@ fn stats_test_percent_blockage_migration_85() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -1486,7 +1501,7 @@ fn stats_test_percent_blockage_migration_90() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -1519,7 +1534,7 @@ fn stats_test_percent_blockage_migration_95() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|
|
@@ -1552,7 +1567,7 @@ fn stats_test_percent_blockage_migration_100() {
|
|
|
for x in buckets {
|
|
|
let mut th = TestHarness::new_buckets(x, x);
|
|
|
let mut credentials: Vec<cred::Lox> = Vec::new();
|
|
|
- for _ in 0..10000 {
|
|
|
+ for _ in 0..USERS {
|
|
|
let h: NaiveTime = DateTime::time(&Utc::now());
|
|
|
if h.hour() == 23 && h.minute() == 59 {
|
|
|
println!("Wait for UTC 00:00");
|