kafka

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandOutput

type CommandOutput struct {
	Stdout string
	Stderr string
}

CommandOutput is the output from a DescribeGroupParser.

type ConsumerGroupsCommandClient

type ConsumerGroupsCommandClient struct {
	Parser                   DescribeGroupParser
	BootstrapServers         string
	ConsumerGroupCommandPath string
}

ConsumerGroupsCommandClient queries Kafka for consumer groups and their current log and offset states.

func (*ConsumerGroupsCommandClient) DescribeGroup

func (col *ConsumerGroupsCommandClient) DescribeGroup(ctx context.Context, group string) ([]exporter.PartitionInfo, error)

DescribeGroup returns current state of all partitions subscribed to by a consumer group.

func (*ConsumerGroupsCommandClient) Groups

func (col *ConsumerGroupsCommandClient) Groups(ctx context.Context) ([]string, error)

Groups returns a list of the Kafka consumer groups.

type DelegatingParser

type DelegatingParser struct {
	Parsers []DescribeGroupParser
}

DelegatingParser is a parser that tries multiple parser returning the first succesful parsed result.

func DefaultDescribeGroupParser

func DefaultDescribeGroupParser() *DelegatingParser

DefaultDescribeGroupParser returns a DelegatingParser consisting of all formats known.

func (*DelegatingParser) Parse

Parse parses the output. It tries each Parser in order, returning an error if all fails.

func (*DelegatingParser) String

func (p *DelegatingParser) String() string

type DescribeGroupParser

type DescribeGroupParser interface {
	// Parses the output from `kafka-consumer-group.sh --describe`
	Parse(output CommandOutput) ([]exporter.PartitionInfo, error)
}

DescribeGroupParser parses the output from `kafka-consumer-group.sh --describe`.

Source Files

  • collector.go
  • parsing.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL