Skip to content

Commit

Permalink
Merge pull request #44 from njhartwell/master
Browse files Browse the repository at this point in the history
Adding consumer-lag
  • Loading branch information
fgeller authored Mar 9, 2017
2 parents d3e8974 + dcab6be commit 1cab06d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions offset.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type offsets struct {
Partition int32 `json:"partition"`
PartitionOffset int64 `json:"partition-offset"`
ConsumerOffset *int64 `json:"consumer-offset,omitempty"`
ConsumerLag *int64 `json:"consumer-lag,omitempty"`
}

func (cmd *offsetCmd) parseFlags(as []string) offsetArgs {
Expand Down Expand Up @@ -182,6 +183,10 @@ func (cmd *offsetCmd) do(q chan struct{}) {
if cmd.group != "" {
off.ConsumerGroup = cmd.group
off.ConsumerOffset = &co
if co > 0 {
cl := po - co
off.ConsumerLag = &cl
}
}
cmd.printOffset(off)
select {
Expand Down

0 comments on commit 1cab06d

Please sign in to comment.