1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2026-06-03 18:35:08 +02:00
Files
opentelemetry-go/internal/global/benchmark_test.go
T
Oleksandr Redko 3264bf171b refactor: modernize code (#7850)
Enable the
[`modernize`](https://golangci-lint.run/docs/linters/configuration/#modernize)
linter in the golangci-lint configuration and fix the reported issues by
running `golangci-lint run --enable-only modernize --fix`. The
`modernize` linter is internally the same as [gopls
modernize](https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/modernize).

Similar to #7089.
2026-01-30 18:15:17 +01:00

22 lines
411 B
Go

// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package global
import (
"testing"
)
func BenchmarkStartEndSpanNoSDK(b *testing.B) {
// Compare with BenchmarkStartEndSpan() in
// ../../sdk/trace/benchmark_test.go.
ResetForTest(b)
t := TracerProvider().Tracer("Benchmark StartEndSpan")
ctx := b.Context()
for b.Loop() {
_, span := t.Start(ctx, "/foo")
span.End()
}
}