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

Method activateReadLag

reader.go:1145–1153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1143}
1144
1145func (r *Reader) activateReadLag() {
1146 if r.config.ReadLagInterval > 0 && atomic.CompareAndSwapUint32(&r.once, 0, 1) {
1147 // read lag will only be calculated when not using consumer groups
1148 // todo discuss how capturing read lag should interact with rebalancing
1149 if !r.useConsumerGroup() {
1150 go r.readLag(r.stctx)
1151 }
1152 }
1153}
1154
1155func (r *Reader) readLag(ctx context.Context) {
1156 ticker := time.NewTicker(r.config.ReadLagInterval)

Callers 2

FetchMessageMethod · 0.95
SetOffsetMethod · 0.95

Calls 2

useConsumerGroupMethod · 0.95
readLagMethod · 0.95

Tested by

no test coverage detected