(b *testing.B, numberOfPorts uint16)
| 428 | } |
| 429 | |
| 430 | func commonBenchmarkHTTPEncoder(b *testing.B, numberOfPorts uint16) { |
| 431 | payload := generateBenchMarkPayload(numberOfPorts, numberOfPorts) |
| 432 | b.ResetTimer() |
| 433 | b.ReportAllocs() |
| 434 | var h *httpEncoder |
| 435 | for i := 0; i < b.N; i++ { |
| 436 | h = newHTTPEncoder(payload.HTTP) |
| 437 | } |
| 438 | runtime.KeepAlive(h) |
| 439 | } |
| 440 | |
| 441 | func BenchmarkHTTPEncoder100Requests(b *testing.B) { |
| 442 | commonBenchmarkHTTPEncoder(b, 10) |
no test coverage detected
searching dependent graphs…