Skip to content

Commit 47e52f1

Browse files
authored
Fix Stress Test (#1935)
1 parent 5922205 commit 47e52f1

7 files changed

+22
-23
lines changed

stress/src/logs.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
22
Stress test results:
3-
OS: Ubuntu 22.04.3 LTS (5.15.146.1-microsoft-standard-WSL2)
4-
Hardware: AMD EPYC 7763 64-Core Processor - 2.44 GHz, 16vCPUs,
3+
OS: Ubuntu 22.04.4 LTS (5.15.153.1-microsoft-standard-WSL2)
4+
Hardware: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz, 16vCPUs,
55
RAM: 64.0 GB
6-
69 M/sec
6+
~31 M/sec
77
*/
88

99
use opentelemetry_appender_tracing::layer;

stress/src/metrics_counter.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
22
Stress test results:
3-
OS: Ubuntu 22.04.3 LTS (5.15.146.1-microsoft-standard-WSL2)
4-
Hardware: AMD EPYC 7763 64-Core Processor - 2.44 GHz, 16vCPUs,
3+
OS: Ubuntu 22.04.4 LTS (5.15.153.1-microsoft-standard-WSL2)
4+
Hardware: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz, 16vCPUs,
55
RAM: 64.0 GB
6-
35 M /sec
6+
~9.5 M /sec
77
*/
88

99
use lazy_static::lazy_static;

stress/src/metrics_histogram.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
22
Stress test results:
3-
OS: Ubuntu 22.04.3 LTS (5.15.146.1-microsoft-standard-WSL2)
4-
Hardware: AMD EPYC 7763 64-Core Processor - 2.44 GHz, 16vCPUs,
3+
OS: Ubuntu 22.04.4 LTS (5.15.153.1-microsoft-standard-WSL2)
4+
Hardware: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz, 16vCPUs,
55
RAM: 64.0 GB
6-
4.6M /sec
6+
~1.8 M/sec
77
*/
88

99
use lazy_static::lazy_static;

stress/src/metrics_overflow.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
22
Stress test results:
3-
OS: Ubuntu 22.04.3 LTS (5.15.146.1-microsoft-standard-WSL2)
4-
Hardware: AMD EPYC 7763 64-Core Processor - 2.44 GHz, 16vCPUs,
3+
OS: Ubuntu 22.04.4 LTS (5.15.153.1-microsoft-standard-WSL2)
4+
Hardware: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz, 16vCPUs,
55
RAM: 64.0 GB
6-
4.5M /sec
6+
~1.9 M/sec
77
*/
88

99
use lazy_static::lazy_static;

stress/src/random.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
22
Stress test results:
3-
OS: Ubuntu 22.04.3 LTS (5.15.146.1-microsoft-standard-WSL2)
4-
Hardware: AMD EPYC 7763 64-Core Processor - 2.44 GHz, 16vCPUs,
3+
OS: Ubuntu 22.04.4 LTS (5.15.153.1-microsoft-standard-WSL2)
4+
Hardware: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz, 16vCPUs,
55
RAM: 64.0 GB
6-
1.25 B/sec
6+
~540 M/sec
77
*/
88

99
use rand::{

stress/src/throughput.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ where
6969
let worker_stats_shared_monitor = Arc::clone(&worker_stats_shared);
7070

7171
let handle_main_thread = thread::spawn(move || {
72-
let mut start_time = Instant::now();
73-
let mut end_time = start_time;
72+
let mut last_collect_time = Instant::now();
7473
let mut total_count_old: u64 = 0;
7574

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

8180
loop {
82-
let elapsed = end_time.duration_since(start_time).as_secs();
81+
let current_time = Instant::now();
82+
let elapsed = current_time.duration_since(last_collect_time).as_secs();
8383
if elapsed >= SLIDING_WINDOW_SIZE {
8484
let total_count_u64: u64 = worker_stats_shared_monitor
8585
.iter()
8686
.map(|worker_stat| worker_stat.count.load(Ordering::Relaxed))
8787
.sum();
88+
last_collect_time = Instant::now();
8889
let current_count = total_count_u64 - total_count_old;
8990
total_count_old = total_count_u64;
9091
let throughput = current_count / elapsed;
@@ -112,14 +113,12 @@ where
112113
}
113114

114115
println!("\n");
115-
start_time = Instant::now();
116116
}
117117

118118
if STOP.load(Ordering::SeqCst) {
119119
break;
120120
}
121121

122-
end_time = Instant::now();
123122
thread::sleep(Duration::from_millis(5000));
124123
}
125124
});

stress/src/traces.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
22
Stress test results:
3-
OS: Ubuntu 22.04.3 LTS (5.15.146.1-microsoft-standard-WSL2)
4-
Hardware: AMD EPYC 7763 64-Core Processor - 2.44 GHz, 16vCPUs,
3+
OS: Ubuntu 22.04.4 LTS (5.15.153.1-microsoft-standard-WSL2)
4+
Hardware: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz, 16vCPUs,
55
RAM: 64.0 GB
6-
9 M/sec
6+
~6.5 M/sec
77
*/
88

99
use lazy_static::lazy_static;

0 commit comments

Comments
 (0)