MCPcopy
hub / github.com/segmentio/kafka-go / benchmarkConnWrite

Function benchmarkConnWrite

conn_test.go:1305–1321  ·  view source on GitHub ↗
(b *testing.B, conn *Conn, _ []byte)

Source from the content-addressed store, hash-verified

1303}
1304
1305func benchmarkConnWrite(b *testing.B, conn *Conn, _ []byte) {
1306 a := make([]byte, 10e3) // 10 KB
1307 n := 0
1308 i := 0
1309
1310 for i != b.N {
1311 c, err := conn.Write(a)
1312 if err != nil {
1313 b.Error(err)
1314 return
1315 }
1316 n += c
1317 i++
1318 }
1319
1320 b.SetBytes(int64(n / i))
1321}
1322
1323func TestEmptyToNullableReturnsNil(t *testing.T) {
1324 if emptyToNullable("") != nil {

Callers

nothing calls this directly

Calls 2

WriteMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected