~jzs/aproxy

ref: 385e0957d78566cdbf2ced486c9253bbcfc0a5ef aproxy/aproxy/tracker_test.go -rw-r--r-- 370 bytes
385e0957 — Jens Zeilund Sørensen Made aproxygo configurable only 2 years ago
                                                                                
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()
}