internal/testutil/benchmarks.go
raw| 1 | // Copyright The OpenTelemetry Authors |
| 2 | // SPDX-License-Identifier: Apache-2.0 |
| 3 | |
| 4 | package testutil // import "go.opentelemetry.io/collector/internal/testutil" |
| 5 | |
| 6 | import ( |
| 7 | "os" |
| 8 | "testing" |
| 9 | ) |
| 10 | |
| 11 | // SkipMemoryBench will skip memory benchmarks on CI, as we currently only |
| 12 | // monitor duration. |
| 13 | func SkipMemoryBench(b *testing.B) { |
| 14 | if os.Getenv("MEMBENCH") == "" { |
| 15 | b.Skip("Skipping since the 'MEMBENCH' environment variable was not set") |
| 16 | } |
| 17 | } |