Skip to content

Commit

Permalink
chore: Add GroupConsumer Stats()
Browse files Browse the repository at this point in the history
  • Loading branch information
dranikpg committed Apr 27, 2024
1 parent d8a7916 commit 6780f2f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions group_consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,14 @@ func (gc *GroupConsumer[T]) Close() []InnerAck {
return gc.lostAcks
}

// Fetch basic stats about buffers:
// 1. Number of fetched entries
// 2. Number of pending acks
// 3. Number of unprocessed ack errors
func (gc *GroupConsumer[T]) Stats() (int, int, int) {
return len(gc.fetchChan), len(gc.ackChan), len(gc.ackErrChan)
}

// consumeLoop fills the consumeChan with new messages from all sources.
// It is the last goroutine to exit and does remaing ack message recovery.
func (gc *GroupConsumer[T]) consumeLoop() {
Expand Down

0 comments on commit 6780f2f

Please sign in to comment.