Skip to content

Commit

Permalink
Add benchmark.
Browse files Browse the repository at this point in the history
  • Loading branch information
clin-stripe committed Nov 23, 2018
1 parent a9ee9de commit b5404ab
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions metricingester/aggworker_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package metricingester

import "testing"

func BenchmarkWorkerIngest(b *testing.B) {
w := newAggWorker()
w.Start()
// we don't want slice allocation to be part of the benchmark since this is normally done
// outside of creating a metric.
tags := []string{"c:d", "f:g", "a:b"}
b.ResetTimer()
for i := 0; i < b.N; i++ {
w.Ingest(NewCounter("mycounter", 100, tags, 1.0, "myhost"))
}
}

0 comments on commit b5404ab

Please sign in to comment.