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

Function recordSize

recordbatch.go:98–108  ·  view source on GitHub ↗
(msg *Message, timestampDelta time.Duration, offsetDelta int64)

Source from the content-addressed store, hash-verified

96}
97
98func recordSize(msg *Message, timestampDelta time.Duration, offsetDelta int64) int {
99 return 1 + // attributes
100 varIntLen(int64(milliseconds(timestampDelta))) +
101 varIntLen(offsetDelta) +
102 varBytesLen(msg.Key) +
103 varBytesLen(msg.Value) +
104 varArrayLen(len(msg.Headers), func(i int) int {
105 h := &msg.Headers[i]
106 return varStringLen(h.Key) + varBytesLen(h.Value)
107 })
108}

Callers 2

recordBatchSizeFunction · 0.85
writeRecordMethod · 0.85

Calls 5

varIntLenFunction · 0.85
millisecondsFunction · 0.85
varBytesLenFunction · 0.85
varArrayLenFunction · 0.85
varStringLenFunction · 0.85

Tested by

no test coverage detected