metrics

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcknowledgedMessage

func AcknowledgedMessage(msg creator.Message, topic string)

func Address

func Address(host string, port int) string

func Close

func Close() error

func ConsumerChannelLength

func ConsumerChannelLength(count int)

func ConsumerCount

func ConsumerCount()

func ConsumerLatency

func ConsumerLatency(dur time.Duration)

func ConsumerMessageProcessingTime

func ConsumerMessageProcessingTime(dur time.Duration)

func ConsumerMessageReadTime

func ConsumerMessageReadTime(dur time.Duration)

func Count

func Count(name string, value int64, tags []string)

func Gauge

func Gauge(name string, value float64, tags []string)

func Incr

func Incr(metric string, tags []string)

func ProduceLatency

func ProduceLatency(dur time.Duration)

func ProducerChannelLength

func ProducerChannelLength(count int)

func ProducerCount

func ProducerCount()

func ReportTime

func ReportTime(startTime time.Time, tags []string, metricName string)

func ReporterType

func ReporterType() string

func SentMessage

func SentMessage(msg creator.Message)

func SetReporter

func SetReporter(reporter StatsdReporter)

func Setup

func Setup(cfg config.Prometheus, producerCfg config.Producer)

func SetupPProf

func SetupPProf(cfg config.PProf)

func SetupStatsD

func SetupStatsD(cfg config.Statsd)

Types

type NopReporter

type NopReporter struct{}

func (*NopReporter) Close

func (m *NopReporter) Close() error

func (*NopReporter) Count

func (m *NopReporter) Count(name string, value int64, tags []string, rate float64) error

func (*NopReporter) Gauge

func (m *NopReporter) Gauge(name string, value float64, tags []string, rate float64) error

func (*NopReporter) Incr

func (m *NopReporter) Incr(name string, tags []string, rate float64) error

func (*NopReporter) Timing

func (m *NopReporter) Timing(name string, value time.Duration, tags []string, rate float64) error

type StatsdConfig

type StatsdConfig struct {
	Host    string
	Port    int
	Enabled bool
	Service string
	Tags    []string
}

type StatsdReporter

type StatsdReporter interface {
	Timing(name string, value time.Duration, tags []string, rate float64) error
	Incr(name string, tags []string, rate float64) error
	Count(name string, value int64, tags []string, rate float64) error
	Gauge(name string, value float64, tags []string, rate float64) error
	Close() error
}

Jump to

Keyboard shortcuts

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