Documentation
¶
Index ¶
- func FormatGroupCoordinators(groupCoordinators []GroupCoordinator) string
- func FormatGroupMembers(members []MemberInfo, full bool) string
- func FormatMemberLags(memberLags []MemberPartitionLag, full bool) string
- func FormatMemberPartitionCounts(members []MemberInfo) string
- func FormatPartitionOffsets(partitionOffsets map[int]int64) string
- type Client
- func (c *Client) GetGroupDetails(ctx context.Context, groupID string) (*GroupDetails, error)
- func (c *Client) GetGroups(ctx context.Context) ([]GroupCoordinator, error)
- func (c *Client) GetMemberLags(ctx context.Context, topic string, groupID string) ([]MemberPartitionLag, error)
- func (c *Client) ResetOffsets(ctx context.Context, topic string, groupID string, ...) error
- type GroupCoordinator
- type GroupDetails
- type MemberInfo
- type MemberPartitionLag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatGroupCoordinators ¶
func FormatGroupCoordinators(groupCoordinators []GroupCoordinator) string
FormatGroupCoordinators generates a pretty table from the results of a call to GetGroups.
func FormatGroupMembers ¶
func FormatGroupMembers(members []MemberInfo, full bool) string
FormatGroupMembers generates a pretty table from a slice of MemberInfo details.
func FormatMemberLags ¶
func FormatMemberLags(memberLags []MemberPartitionLag, full bool) string
FormatMemberLags generates a pretty table from the results of GetMemberLags.
func FormatMemberPartitionCounts ¶
func FormatMemberPartitionCounts(members []MemberInfo) string
FormatMemberPartitionCounts generates a pretty table with the details on how many partitions group members are consuming from.
func FormatPartitionOffsets ¶
FormatPartitionOffsets generates a pretty table that shows the proposed offsets for each partition in a reset.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a struct for getting information about consumer groups from a cluster.
func (*Client) GetGroupDetails ¶
GetGroupDetails returns the details (membership, etc.) for a single consumer group.
func (*Client) GetGroups ¶
func (c *Client) GetGroups( ctx context.Context, ) ([]GroupCoordinator, error)
GetGroups fetches and returns information about all consumer groups in the cluster.
func (*Client) GetMemberLags ¶
func (c *Client) GetMemberLags( ctx context.Context, topic string, groupID string, ) ([]MemberPartitionLag, error)
GetMemberLags returns the lag for each partition being consumed by the argument group in the argument topic.
type GroupCoordinator ¶
GroupCoordinator stores the coordinator broker for a single consumer group.
type GroupDetails ¶
type GroupDetails struct { GroupID string State string Members []MemberInfo }
GroupDetails stores the state and members for a consumer group.
func (GroupDetails) PartitionMembers ¶
func (g GroupDetails) PartitionMembers(topic string) map[int]MemberInfo
PartitionMembers returns the members for each partition in the argument topic.
func (GroupDetails) TopicsMap ¶
func (g GroupDetails) TopicsMap() map[string]struct{}
TopicsMap returns a map of all the topics consumed by the current group.
type MemberInfo ¶
type MemberInfo struct { MemberID string ClientID string ClientHost string TopicPartitions map[string][]int }
MemberInfo stores information about a single consumer group member.
func (MemberInfo) Topics ¶
func (m MemberInfo) Topics() []string
Topics returns a slice of all topics that the current MemberInfo is consuming from.
type MemberPartitionLag ¶
type MemberPartitionLag struct { Topic string Partition int MemberID string NewestOffset int64 NewestTime time.Time MemberOffset int64 MemberTime time.Time }
MemberPartitionLag information about the lag for a single topic / partition / group member combination.
func (MemberPartitionLag) OffsetLag ¶
func (m MemberPartitionLag) OffsetLag() int64
OffsetLag returns the difference between the latest offset in the partition and the latest one committed by the group member.
func (MemberPartitionLag) TimeLag ¶
func (m MemberPartitionLag) TimeLag() time.Duration
TimeLag returns the time difference between the latest timestamp in the the partition and the timestamp in the latest message committed by the group member.