Skip to content

Commit

Permalink
Add bench test on context input query
Browse files Browse the repository at this point in the history
  • Loading branch information
playHing committed Jul 15, 2020
1 parent 1c07144 commit b50fb44
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions context/input_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,13 @@ func TestParams(t *testing.T) {
}

}
func BenchmarkQuery(b *testing.B) {
beegoInput := NewInput()
beegoInput.Context = NewContext()
beegoInput.Context.Request, _ = http.NewRequest("POST", "http://www.example.com/?q=foo", nil)
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
beegoInput.Query("q")
}
})
}

0 comments on commit b50fb44

Please sign in to comment.