runtimeemitter

package
v7.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 7, 2019 License: Apache-2.0 Imports: 3 Imported by: 8 modules, 7 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Emitter

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

Emitter will emit a gauge with runtime stats via the sender on the given interval. default interval is 15 seconds.

func New

func New(sender Sender, opts ...RuntimeEmitterOption) *Emitter

New returns an Emitter that is configured with the given sender and RuntimeEmitterOptions.

func NewV1

func NewV1(sender V1Sender, opts ...RuntimeEmitterOption) *Emitter

NewV1 returns an Emitter that is configured with the given v1 sender and RuntimeEmitterOptions.

func (*Emitter) Run

func (e *Emitter) Run()

Run starts the ticker with the configured interval and emits a gauge on that interval. This method will block but the user may run in a go routine.

type RuntimeEmitterOption

type RuntimeEmitterOption func(e *Emitter)

RuntimeEmitterOption is the option provides configuration for an Emitter.

func WithInterval

func WithInterval(d time.Duration) RuntimeEmitterOption

WithInterval returns a RuntimeEmitterOption to configure the interval at which the runtime emitter emits gauges.

type Sender

type Sender interface {
	EmitGauge(opts ...loggregator.EmitGaugeOption)
}

Sender is the interface of the client that can be used to emit gauge metrics.

type V1Sender

type V1Sender interface {
	SendComponentMetric(name string, value float64, unit string) error
}

V1Sender is the interface of the v1 client that can be used to emit value metrics.

Jump to

Keyboard shortcuts

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