(b *testing.B)
| 137 | } |
| 138 | |
| 139 | func BenchmarkNextParallel(b *testing.B) { |
| 140 | servers := []*proxy.Proxy{ |
| 141 | proxy.NewProxy("s1", &url.URL{Host: "192.168.1.10"}), |
| 142 | proxy.NewProxy("s2", &url.URL{Host: "192.168.1.11"}), |
| 143 | proxy.NewProxy("s3", &url.URL{Host: "192.168.1.12"}), |
| 144 | proxy.NewProxy("s4", &url.URL{Host: "192.168.1.13"}), |
| 145 | } |
| 146 | r, _ := New(servers...) |
| 147 | b.ReportAllocs() |
| 148 | b.ResetTimer() |
| 149 | b.RunParallel(func(pb *testing.PB) { |
| 150 | for pb.Next() { |
| 151 | r.NextServer() |
| 152 | } |
| 153 | }) |
| 154 | } |
| 155 | |
| 156 | func BenchmarkAddServers(b *testing.B) { |
| 157 | r, _ := New() |
nothing calls this directly
no test coverage detected