Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes broken sdk/metric benchmarks #2459

Merged
merged 2 commits into from Dec 16, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 4 additions & 14 deletions sdk/metric/benchmark_test.go
Expand Up @@ -230,11 +230,11 @@ func BenchmarkFloat64LastValueAdd(b *testing.B) {

// Histograms

func benchmarkInt64HistogramAdd(b *testing.B, name string) {
func BenchmarkInt64HistogramAdd(b *testing.B) {
ctx := context.Background()
fix := newFixture(b)
labs := makeLabels(1)
mea := fix.meterMust().NewInt64Histogram(name)
mea := fix.meterMust().NewInt64Histogram("int64.histogram")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the name suffix hardcode something? Not clear how changing the name fixes this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


b.ResetTimer()

Expand All @@ -243,11 +243,11 @@ func benchmarkInt64HistogramAdd(b *testing.B, name string) {
}
}

func benchmarkFloat64HistogramAdd(b *testing.B, name string) {
func BenchmarkFloat64HistogramAdd(b *testing.B) {
ctx := context.Background()
fix := newFixture(b)
labs := makeLabels(1)
mea := fix.meterMust().NewFloat64Histogram(name)
mea := fix.meterMust().NewFloat64Histogram("float64.histogram")

b.ResetTimer()

Expand Down Expand Up @@ -303,16 +303,6 @@ func BenchmarkGaugeObserverObservationFloat64(b *testing.B) {
fix.accumulator.Collect(ctx)
}

// Exact

func BenchmarkInt64ExactAdd(b *testing.B) {
benchmarkInt64HistogramAdd(b, "int64.exact")
}

func BenchmarkFloat64ExactAdd(b *testing.B) {
benchmarkFloat64HistogramAdd(b, "float64.exact")
}

// BatchRecord

func benchmarkBatchRecord8Labels(b *testing.B, numInst int) {
Expand Down