Skip to content

Commit

Permalink
Fix Stress Test (#1935)
Browse files Browse the repository at this point in the history
  • Loading branch information
utpilla authored Jul 16, 2024
1 parent 5922205 commit 47e52f1
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 23 deletions.
6 changes: 3 additions & 3 deletions stress/src/logs.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
Stress test results:
OS: Ubuntu 22.04.3 LTS (5.15.146.1-microsoft-standard-WSL2)
Hardware: AMD EPYC 7763 64-Core Processor - 2.44 GHz, 16vCPUs,
OS: Ubuntu 22.04.4 LTS (5.15.153.1-microsoft-standard-WSL2)
Hardware: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz, 16vCPUs,
RAM: 64.0 GB
69 M/sec
~31 M/sec
*/

use opentelemetry_appender_tracing::layer;
Expand Down
6 changes: 3 additions & 3 deletions stress/src/metrics_counter.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
Stress test results:
OS: Ubuntu 22.04.3 LTS (5.15.146.1-microsoft-standard-WSL2)
Hardware: AMD EPYC 7763 64-Core Processor - 2.44 GHz, 16vCPUs,
OS: Ubuntu 22.04.4 LTS (5.15.153.1-microsoft-standard-WSL2)
Hardware: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz, 16vCPUs,
RAM: 64.0 GB
35 M /sec
~9.5 M /sec
*/

use lazy_static::lazy_static;
Expand Down
6 changes: 3 additions & 3 deletions stress/src/metrics_histogram.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
Stress test results:
OS: Ubuntu 22.04.3 LTS (5.15.146.1-microsoft-standard-WSL2)
Hardware: AMD EPYC 7763 64-Core Processor - 2.44 GHz, 16vCPUs,
OS: Ubuntu 22.04.4 LTS (5.15.153.1-microsoft-standard-WSL2)
Hardware: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz, 16vCPUs,
RAM: 64.0 GB
4.6M /sec
~1.8 M/sec
*/

use lazy_static::lazy_static;
Expand Down
6 changes: 3 additions & 3 deletions stress/src/metrics_overflow.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
Stress test results:
OS: Ubuntu 22.04.3 LTS (5.15.146.1-microsoft-standard-WSL2)
Hardware: AMD EPYC 7763 64-Core Processor - 2.44 GHz, 16vCPUs,
OS: Ubuntu 22.04.4 LTS (5.15.153.1-microsoft-standard-WSL2)
Hardware: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz, 16vCPUs,
RAM: 64.0 GB
4.5M /sec
~1.9 M/sec
*/

use lazy_static::lazy_static;
Expand Down
6 changes: 3 additions & 3 deletions stress/src/random.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
Stress test results:
OS: Ubuntu 22.04.3 LTS (5.15.146.1-microsoft-standard-WSL2)
Hardware: AMD EPYC 7763 64-Core Processor - 2.44 GHz, 16vCPUs,
OS: Ubuntu 22.04.4 LTS (5.15.153.1-microsoft-standard-WSL2)
Hardware: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz, 16vCPUs,
RAM: 64.0 GB
1.25 B/sec
~540 M/sec
*/

use rand::{
Expand Down
9 changes: 4 additions & 5 deletions stress/src/throughput.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ where
let worker_stats_shared_monitor = Arc::clone(&worker_stats_shared);

let handle_main_thread = thread::spawn(move || {
let mut start_time = Instant::now();
let mut end_time = start_time;
let mut last_collect_time = Instant::now();
let mut total_count_old: u64 = 0;

#[cfg(feature = "stats")]
Expand All @@ -79,12 +78,14 @@ where
let mut system = System::new_all();

loop {
let elapsed = end_time.duration_since(start_time).as_secs();
let current_time = Instant::now();
let elapsed = current_time.duration_since(last_collect_time).as_secs();
if elapsed >= SLIDING_WINDOW_SIZE {
let total_count_u64: u64 = worker_stats_shared_monitor
.iter()
.map(|worker_stat| worker_stat.count.load(Ordering::Relaxed))
.sum();
last_collect_time = Instant::now();
let current_count = total_count_u64 - total_count_old;
total_count_old = total_count_u64;
let throughput = current_count / elapsed;
Expand Down Expand Up @@ -112,14 +113,12 @@ where
}

println!("\n");
start_time = Instant::now();
}

if STOP.load(Ordering::SeqCst) {
break;
}

end_time = Instant::now();
thread::sleep(Duration::from_millis(5000));
}
});
Expand Down
6 changes: 3 additions & 3 deletions stress/src/traces.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
Stress test results:
OS: Ubuntu 22.04.3 LTS (5.15.146.1-microsoft-standard-WSL2)
Hardware: AMD EPYC 7763 64-Core Processor - 2.44 GHz, 16vCPUs,
OS: Ubuntu 22.04.4 LTS (5.15.153.1-microsoft-standard-WSL2)
Hardware: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz, 16vCPUs,
RAM: 64.0 GB
9 M/sec
~6.5 M/sec
*/

use lazy_static::lazy_static;
Expand Down

0 comments on commit 47e52f1

Please sign in to comment.