Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetricsRegistry ¶
type MetricsRegistry interface {
Each(func(name string, i interface{}))
}
MetricsRegistry is an interface for 'github.com/rcrowley/go-metrics'.Registry which is used for metrics in sarama.
type Options ¶
type Options struct { // PrometheusRegistry is prometheus registry. Default prometheus.DefaultRegisterer. PrometheusRegistry prometheus.Registerer // Namespace and Subsystem form the metric name prefix. // Default Subsystem is "sarama". Namespace string Subsystem string // RefreshInterval specifies interval between updating metrics. Default 1s. RefreshInterval time.Duration }
Options holds optional params for ExportMetrics.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler is used to run jobs in specific intervals.
func StartScheduler ¶
StartScheduler starts goroutine that will run given job in given intervals until Stop() is called.
type StopFunc ¶
type StopFunc func()
StopFunc represents function for stopping scheduled task.
func ExportMetrics ¶
func ExportMetrics(metricsRegistry MetricsRegistry, opt Options) StopFunc
ExportMetrics exports metrics from go-metrics to prometheus by starting background task, which periodically sync sarama metrics to prometheus registry.
Click to show internal directories.
Click to hide internal directories.