1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
package aproxy_test
import (
"context"
"keybase/sketchground/aproxygo/aproxy"
"net/http"
"testing"
)
func BenchmarkTracker(b *testing.B) {
ctx := context.Background()
t := aproxy.NewTracker()
req, err := http.NewRequest("GET", "http://localhost/", nil)
if err != nil {
b.Fatal(err)
}
for n := 0; n < 500000; n++ {
t.Track(ctx, req)
}
t.Shutdown()
}