Skip to content

Commit

Permalink
Merge pull request birdayz#45 from sergiosalvatore/consumer-behind
Browse files Browse the repository at this point in the history
Additional Consumer Stat
  • Loading branch information
birdayz authored Mar 26, 2019
2 parents ffd4fdc + d523f33 commit 4206b97
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/kaf/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ var groupDescribeCmd = &cobra.Command{
}

topics := make([]string, 0, len(topicsDedup))
for topic, _ := range topicsDedup {
for topic := range topicsDedup {
topics = append(topics, topic)
}

Expand Down Expand Up @@ -172,8 +172,8 @@ var groupDescribeCmd = &cobra.Command{
offsetAndMetadata, _ := admin.ListConsumerGroupOffsets(args[0], topicPartitions)
for topic, partitions := range topicPartitions {
fmt.Fprintf(w, "\t%v:\n", topic)
fmt.Fprintf(w, "\t\tPartition\tGroup Offset\tHigh Watermark\t\n")
fmt.Fprintf(w, "\t\t---------\t------------\t--------------\t\n")
fmt.Fprintf(w, "\t\tPartition\tGroup Offset\tHigh Watermark\tLag\t\n")
fmt.Fprintf(w, "\t\t---------\t------------\t--------------\t---\t\n")

existingOffsets := make(map[int32]int64)
for partition, groupOffset := range offsetAndMetadata.Blocks[topic] {
Expand All @@ -187,7 +187,7 @@ var groupDescribeCmd = &cobra.Command{
if blockOff := offsetAndMetadata.GetBlock(topic, partition).Offset; blockOff != -1 {
offset = blockOff
}
fmt.Fprintf(w, "\t\t%v\t%v\t%v\t\n", partition, offset, wm)
fmt.Fprintf(w, "\t\t%v\t%v\t%v\t%v\t\n", partition, offset, wm, (wm - offset))
}

}
Expand Down Expand Up @@ -305,6 +305,7 @@ func getHighWatermarks(topic string, partitions []int32) (watermarks map[int32]i
return
}

// IsASCIIPrintable returns true if the string is ASCII printable.
func IsASCIIPrintable(s string) bool {
for _, r := range s {
if r > unicode.MaxASCII || !unicode.IsPrint(r) {
Expand Down

0 comments on commit 4206b97

Please sign in to comment.