Skip to content

Commit 974da01

Browse files
authored
[chore] Skip more benchmarks when reporting to codspeed (#14220)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This: - Renames the `benchmark` target to `timebenchmark` and passes the `MEMBENCH` env variable on the original `benchmark` target (it was duplicated) - Adds `testutil.SkipMemoryBench` to a bunch of tests that are not there for measuring time but rather for measuring allocations - Bumps number of iterations on one queue benchmark to bump total time taken by the test <!-- Issue number if applicable --> #### Link to tracking issue Fixes #14216, updates #14111
1 parent 10f119c commit 974da01

File tree

43 files changed

+97
-9
lines changed

Some content is hidden

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

43 files changed

+97
-9
lines changed

.github/workflows/go-benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ jobs:
3232
uses: CodSpeedHQ/action@346a2d8a8d9d38909abd0bc3d23f773110f076ad # v4.4.1
3333
with:
3434
mode: walltime
35-
run: make for-all-target TARGET="benchmark"
35+
run: make for-all-target TARGET="timebenchmark"
3636
cache-instruments: false

Makefile.Common

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test-with-junit:
4343

4444
.PHONY: benchmark
4545
benchmark:
46-
$(GO_TOOL) gotestsum \
46+
MEMBENCH=yes $(GO_TOOL) gotestsum \
4747
--packages="$(ALL_PKGS)" -- \
4848
-bench=. -run=notests ./... | tee benchmark.txt
4949

@@ -100,5 +100,5 @@ impi:
100100
moddownload:
101101
$(GOCMD) mod download
102102

103-
benchmark:
103+
timebenchmark:
104104
go test -bench=. -benchtime=1s ./...

client/go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ replace go.opentelemetry.io/collector/consumer => ../consumer
2626
replace go.opentelemetry.io/collector/pdata => ../pdata
2727

2828
replace go.opentelemetry.io/collector/featuregate => ../featuregate
29+
30+
replace go.opentelemetry.io/collector/internal/testutil => ../internal/testutil

component/componentstatus/go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ replace go.opentelemetry.io/collector/pdata => ../../pdata
3232
replace go.opentelemetry.io/collector/pipeline => ../../pipeline
3333

3434
replace go.opentelemetry.io/collector/featuregate => ../../featuregate
35+
36+
replace go.opentelemetry.io/collector/internal/testutil => ../../internal/testutil

component/componenttest/go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ replace go.opentelemetry.io/collector/component => ../
3737
replace go.opentelemetry.io/collector/pdata => ../../pdata
3838

3939
replace go.opentelemetry.io/collector/featuregate => ../../featuregate
40+
41+
replace go.opentelemetry.io/collector/internal/testutil => ../../internal/testutil

component/go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ retract (
3333
)
3434

3535
replace go.opentelemetry.io/collector/featuregate => ../featuregate
36+
37+
replace go.opentelemetry.io/collector/internal/testutil => ../internal/testutil

config/configauth/go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,5 @@ replace go.opentelemetry.io/collector/extension/extensionauth => ../../extension
4141
replace go.opentelemetry.io/collector/extension/extensionauth/extensionauthtest => ../../extension/extensionauth/extensionauthtest
4242

4343
replace go.opentelemetry.io/collector/featuregate => ../../featuregate
44+
45+
replace go.opentelemetry.io/collector/internal/testutil => ../../internal/testutil

config/configmiddleware/go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,5 @@ replace go.opentelemetry.io/collector/pdata => ../../pdata
4444
replace go.opentelemetry.io/collector/featuregate => ../../featuregate
4545

4646
replace go.opentelemetry.io/collector/extension => ../../extension
47+
48+
replace go.opentelemetry.io/collector/internal/testutil => ../../internal/testutil

consumer/consumererror/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ require (
1515
github.com/davecgh/go-spew v1.1.1 // indirect
1616
github.com/hashicorp/go-version v1.7.0 // indirect
1717
github.com/json-iterator/go v1.1.12 // indirect
18+
github.com/kr/text v0.2.0 // indirect
1819
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
1920
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
2021
github.com/pmezard/go-difflib v1.0.0 // indirect

consumer/consumererror/go.sum

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)