77 "net/http"
88 "sort"
99
10- "github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/consumergroup/groupcmdutil"
1110 kafkacmdutil "github.com/redhat-developer/app-services-cli/pkg/shared/kafkautil"
1211
1312 "github.com/redhat-developer/app-services-cli/pkg/core/cmdutil/flagutil"
@@ -39,9 +38,9 @@ type consumerRow struct {
3938 MemberID string `json:"memberId,omitempty" header:"Consumer ID"`
4039 Partition int `json:"partition,omitempty" header:"Partition"`
4140 Topic string `json:"topic,omitempty" header:"Topic"`
42- LogEndOffset int `json:"logEndOffset,omitempty" header:"Log end offset"`
43- CurrentOffset int `json:"offset,omitempty" header:"Current offset"`
44- OffsetLag int `json:"lag,omitempty" header:"Offset lag"`
41+ LogEndOffset int64 `json:"logEndOffset,omitempty" header:"Log end offset"`
42+ CurrentOffset int64 `json:"offset,omitempty" header:"Current offset"`
43+ OffsetLag int64 `json:"lag,omitempty" header:"Offset lag"`
4544}
4645
4746// NewDescribeConsumerGroupCommand gets a new command for describing a consumer group.
@@ -164,9 +163,9 @@ func mapConsumerGroupDescribeToTableFormat(consumers []kafkainstanceclient.Consu
164163 Partition : int (consumer .GetPartition ()),
165164 Topic : consumer .GetTopic (),
166165 MemberID : consumer .GetMemberId (),
167- LogEndOffset : int ( consumer .GetLogEndOffset () ),
168- CurrentOffset : int ( consumer .GetOffset () ),
169- OffsetLag : int ( consumer .GetLag () ),
166+ LogEndOffset : consumer .GetLogEndOffset (),
167+ CurrentOffset : consumer .GetOffset (),
168+ OffsetLag : consumer .GetLag (),
170169 }
171170
172171 if consumer .GetMemberId () == "" {
@@ -188,10 +187,11 @@ func mapConsumerGroupDescribeToTableFormat(consumers []kafkainstanceclient.Consu
188187func printConsumerGroupDetails (w io.Writer , consumerGroupData kafkainstanceclient.ConsumerGroup , localizer localize.Localizer ) {
189188 fmt .Fprintln (w , "" )
190189 consumers := consumerGroupData .GetConsumers ()
190+ metrics := consumerGroupData .GetMetrics ()
191191
192- activeMembersCount := groupcmdutil . GetActiveConsumersCount ( consumers )
193- partitionsWithLagCount := groupcmdutil . GetPartitionsWithLag ( consumers )
194- unassignedPartitions := groupcmdutil .GetUnassignedPartitions (consumers )
192+ activeMembersCount := metrics . GetActiveConsumers ( )
193+ partitionsWithLagCount := metrics . GetLaggingPartitions ( )
194+ unassignedPartitions := metrics .GetUnassignedPartitions ()
195195
196196 fmt .Fprintln (w , color .Bold (localizer .MustLocalize ("kafka.consumerGroup.describe.output.activeMembers" )), activeMembersCount , "\t " , color .Bold (localizer .MustLocalize ("kafka.consumerGroup.describe.output.partitionsWithLag" )), partitionsWithLagCount , "\t " , color .Bold (localizer .MustLocalize ("kafka.consumerGroup.describe.output.unassignedPartitions" )), unassignedPartitions )
197197 fmt .Fprintln (w , "" )
0 commit comments