kafka

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2016 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AckSource

type AckSource struct {
	Converter Converter
	// contains filtered or unexported fields
}

AckSource represents an object that processes SampleGroups received from the Kafka message bus.

func NewAckSource

func NewAckSource(config *AckSourceConfig) (*AckSource, error)

NewAckSource creates an instance of AckSource.

func (*AckSource) Chan

func (as *AckSource) Chan() <-chan bus.AckPayload

Chan implements the bus.AckSource interface. Returns the channel that feeds the message payload.

func (*AckSource) Collect

func (as *AckSource) Collect(ch chan<- prometheus.Metric)

Collect implements Collector. Sends metrics collected by sourceDurations and errorsTotal to the parameter ch.

func (*AckSource) Describe

func (as *AckSource) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector. Sends decriptors of the instance's sourceDurations and errorsTotal to the parameter ch.

func (*AckSource) Err

func (as *AckSource) Err() error

Err implements the bus.AckSource interface. Caller must call Err after the channel has been closed. Will return the first error encountered.

func (*AckSource) Stop

func (as *AckSource) Stop()

Stop implements the bus.AckSource interface. Closes the channel for payload processing.

type AckSourceConfig

type AckSourceConfig struct {
	Addrs     []string
	ClientID  string
	Converter Converter
	Topic     string
}

AckSourceConfig represents the configuration of an AckSource object.

type Converter

type Converter interface {
	// Convert converts a Kafka consumer message to be processed by ingesters
	// and indexers.
	Convert(*sarama.ConsumerMessage) (bus.SampleGroup, error)
}

Converter is an interface that wraps the Convert method.

type DefaultConverter

type DefaultConverter struct{}

DefaultConverter represents an oject has encapsulates the default Convert method.

func (DefaultConverter) Convert

Convert implements Converter.

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer represents an object that encapsulates the behavior of a Kafka producter.

func NewWriter

func NewWriter(config *WriterConfig) (*Writer, error)

NewWriter creates a new instance of Writer.

func (*Writer) Write

func (w *Writer) Write(key string, fams []*dto.MetricFamily) error

Write sends metrics to the Kafka message bus.

type WriterConfig

type WriterConfig struct {
	ClientID string
	Addrs    []string
	Topic    string
}

WriterConfig represents the configuration of a Writer object.

Jump to

Keyboard shortcuts

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