MCPcopy Create free account
hub / github.com/DataDog/datadog-agent / commonBenchmarkHTTPEncoder

Function commonBenchmarkHTTPEncoder

pkg/network/encoding/http_test.go:430–439  ·  view source on GitHub ↗
(b *testing.B, numberOfPorts uint16)

Source from the content-addressed store, hash-verified

428}
429
430func 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
441func BenchmarkHTTPEncoder100Requests(b *testing.B) {
442 commonBenchmarkHTTPEncoder(b, 10)

Calls 2

generateBenchMarkPayloadFunction · 0.85
newHTTPEncoderFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…