Add benchmark test for single metric

This commit is contained in:
Daniel Nelson 2017-12-07 15:11:04 -08:00
parent 574034c301
commit 4f42d8a298
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
1 changed files with 11 additions and 0 deletions

View File

@ -241,6 +241,17 @@ func TestParseInvalidInflux(t *testing.T) {
}
func BenchmarkSingle(b *testing.B) {
parser := InfluxParser{}
b.ResetTimer()
for n := 0; n < b.N; n++ {
_, err := parser.Parse([]byte("cpu value=42\n"))
if err != nil {
panic(err)
}
}
}
func BenchmarkParse(b *testing.B) {
var err error
parser := InfluxParser{}