metrics

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: Apache-2.0 Imports: 5 Imported by: 39

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Db

type Db interface {
	OpenConnections() int
}

type MetricSource

type MetricSource struct {
	Name   string
	Unit   string
	Getter func() (float64, error)
}

func NewDBMonitorSource

func NewDBMonitorSource(Db Db, monitor monitor.Monitor) []MetricSource

func NewUptimeSource

func NewUptimeSource() MetricSource

type MetricsEmitter

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

func NewMetricsEmitter

func NewMetricsEmitter(logger lager.Logger, interval time.Duration, metrics ...MetricSource) *MetricsEmitter

func (*MetricsEmitter) EmitMetrics

func (m *MetricsEmitter) EmitMetrics()

func (*MetricsEmitter) Run

func (m *MetricsEmitter) Run(signals <-chan os.Signal, ready chan<- struct{}) error

type MetricsSender

type MetricsSender struct {
	Logger lager.Logger
}

func (*MetricsSender) IncrementCounter

func (ms *MetricsSender) IncrementCounter(name string)

func (*MetricsSender) SendDuration

func (ms *MetricsSender) SendDuration(name string, duration time.Duration)

func (*MetricsSender) SendValue

func (ms *MetricsSender) SendValue(name string, value float64, units string)

type NoOpMetricsSender

type NoOpMetricsSender struct{}

func (*NoOpMetricsSender) IncrementCounter

func (s *NoOpMetricsSender) IncrementCounter(string)

func (*NoOpMetricsSender) SendDuration

func (s *NoOpMetricsSender) SendDuration(string, time.Duration)

Jump to

Keyboard shortcuts

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