Skip to content

Commit da2029e

Browse files
authored
perf: Run all benchmarks for shorter time (#2870)
1 parent b2de6cc commit da2029e

File tree

42 files changed

+233
-36
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+233
-36
lines changed

.github/workflows/benchmark.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
- uses: actions/checkout@v4
3333
with:
3434
fetch-depth: 10 # Fetch current commit and its parent
35+
- name: "Show change commit"
36+
run: git log -1
3537
- uses: arduino/setup-protoc@v3
3638
with:
3739
repo-token: ${{ secrets.GITHUB_TOKEN }}
@@ -42,11 +44,15 @@ jobs:
4244
with:
4345
cwd: opentelemetry
4446
branchName: ${{ env.BRANCH_NAME }}
47+
- name: "Checkout change commit"
48+
run: git checkout $GITHUB_SHA
4549
- uses: boa-dev/criterion-compare-action@v3
4650
with:
4751
cwd: opentelemetry-appender-tracing
4852
features: spec_unstable_logs_enabled
4953
branchName: ${{ env.BRANCH_NAME }}
54+
- name: "Checkout change commit"
55+
run: git checkout $GITHUB_SHA
5056
- uses: boa-dev/criterion-compare-action@v3
5157
with:
5258
cwd: opentelemetry-sdk

examples/logs-basic/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ version = "0.1.0"
44
edition = "2021"
55
license = "Apache-2.0"
66
publish = false
7+
autobenches = false
8+
9+
[[bin]]
10+
name = "logs-basic"
11+
path = "src/main.rs"
12+
bench = false
713

814
[dependencies]
915
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["logs"] }

examples/metrics-advanced/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ version = "0.1.0"
44
edition = "2021"
55
license = "Apache-2.0"
66
publish = false
7+
autobenches = false
8+
9+
[[bin]]
10+
name = "metrics-advanced"
11+
path = "src/main.rs"
12+
bench = false
713

814
[dependencies]
915
opentelemetry = { path = "../../opentelemetry", features = ["metrics"] }

examples/metrics-basic/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ version = "0.1.0"
44
edition = "2021"
55
license = "Apache-2.0"
66
publish = false
7+
autobenches = false
8+
9+
[[bin]]
10+
name = "metrics-basic"
11+
path = "src/main.rs"
12+
bench = false
713

814
[dependencies]
915
opentelemetry = { path = "../../opentelemetry", features = ["metrics"] }

examples/tracing-grpc/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ version = "0.1.0"
44
edition = "2021"
55
license = "Apache-2.0"
66
publish = false
7+
autobenches = false
78

89
[[bin]] # Bin to run the gRPC server
910
name = "grpc-server"
1011
path = "src/server.rs"
12+
bench = false
1113

1214
[[bin]] # Bin to run the gRPC client
1315
name = "grpc-client"
1416
path = "src/client.rs"
17+
bench = false
1518

1619
[dependencies]
1720
opentelemetry = { path = "../../opentelemetry" }

examples/tracing-http-propagator/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@ version = "0.1.0"
44
edition = "2021"
55
license = "Apache-2.0"
66
publish = false
7+
autobenches = false
78

89
[[bin]] # Bin to run the http server
910
name = "http-server"
1011
path = "src/server.rs"
1112
doc = false
13+
bench = false
1214

1315
[[bin]] # Bin to run the client
1416
name = "http-client"
1517
path = "src/client.rs"
1618
doc = false
19+
bench = false
1720

1821
[dependencies]
1922
http-body-util = { workspace = true }

opentelemetry-appender-log/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ keywords = ["opentelemetry", "log", "logs"]
99
license = "Apache-2.0"
1010
rust-version = "1.75.0"
1111
edition = "2021"
12+
autobenches = false
13+
14+
[lib]
15+
bench = false
1216

1317
[dependencies]
1418
opentelemetry = { version = "0.29", path = "../opentelemetry", features = [

opentelemetry-appender-tracing/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ readme = "README.md"
99
keywords = ["opentelemetry", "log", "logs", "tracing"]
1010
license = "Apache-2.0"
1111
rust-version = "1.75.0"
12+
autobenches = false
1213

1314
[dependencies]
1415
log = { workspace = true, optional = true }

opentelemetry-appender-tracing/benches/log-attributes.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,19 @@ fn criterion_benchmark(c: &mut Criterion) {
258258
#[cfg(not(target_os = "windows"))]
259259
criterion_group! {
260260
name = benches;
261-
config = Criterion::default().with_profiler(PProfProfiler::new(100, Output::Flamegraph(None)));
261+
config = Criterion::default()
262+
.warm_up_time(std::time::Duration::from_secs(1))
263+
.measurement_time(std::time::Duration::from_secs(2))
264+
.with_profiler(PProfProfiler::new(100, Output::Flamegraph(None)));
262265
targets = criterion_benchmark
263266
}
264267

265268
#[cfg(target_os = "windows")]
266269
criterion_group! {
267270
name = benches;
268-
config = Criterion::default();
271+
config = Criterion::default()
272+
.warm_up_time(std::time::Duration::from_secs(1))
273+
.measurement_time(std::time::Duration::from_secs(2));
269274
targets = criterion_benchmark
270275
}
271276

opentelemetry-appender-tracing/benches/logs.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,18 @@ fn criterion_benchmark(c: &mut Criterion) {
168168
#[cfg(not(target_os = "windows"))]
169169
criterion_group! {
170170
name = benches;
171-
config = Criterion::default().with_profiler(PProfProfiler::new(100, Output::Flamegraph(None)));
171+
config = Criterion::default()
172+
.warm_up_time(std::time::Duration::from_secs(1))
173+
.measurement_time(std::time::Duration::from_secs(2))
174+
.with_profiler(PProfProfiler::new(100, Output::Flamegraph(None)));
172175
targets = criterion_benchmark
173176
}
174177
#[cfg(target_os = "windows")]
175178
criterion_group! {
176179
name = benches;
177-
config = Criterion::default();
180+
config = Criterion::default()
181+
.warm_up_time(std::time::Duration::from_secs(1))
182+
.measurement_time(std::time::Duration::from_secs(2));
178183
targets = criterion_benchmark
179184
}
180185
criterion_main!(benches);

0 commit comments

Comments
 (0)