Skip to content

Commit

Permalink
minor: Context refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
lahsivjar committed Jul 12, 2023
1 parent a7b9976 commit 1a953cf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions aggregators/aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1136,13 +1136,12 @@ func BenchmarkAggregateCombinedMetrics(b *testing.B) {
if err != nil {
b.Fatal(err)
}
ctx, cancel := context.WithCancel(context.Background())
b.Cleanup(func() { cancel() })
b.ResetTimer()
for i := 0; i < b.N; i++ {
for _, kv := range kvs {
if err := agg.AggregateCombinedMetrics(
context.Background(),
kv.Key, kv.Value,
); err != nil {
if err := agg.AggregateCombinedMetrics(ctx, kv.Key, kv.Value); err != nil {
b.Fatal(err)
}
}
Expand Down

0 comments on commit 1a953cf

Please sign in to comment.