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: 4

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