metric

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAsyncRunner = errors.New("unknown async runner type")

Functions

This section is empty.

Types

type AsyncCollector added in v0.5.0

type AsyncCollector interface {
	// CollectAsync passes a batch of observations to the MeterImpl.
	CollectAsync(labels []label.KeyValue, observation ...metric.Observation)
}

AsyncCollector is an interface used between the MeterImpl and the AsyncInstrumentState helper below. This interface is implemented by the SDK to provide support for running observer callbacks.

type AsyncInstrumentState added in v0.5.0

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

AsyncInstrumentState manages an ordered set of asynchronous instruments and the distinct runners, taking into account batch observer callbacks.

func NewAsyncInstrumentState added in v0.5.0

func NewAsyncInstrumentState() *AsyncInstrumentState

NewAsyncInstrumentState returns a new *AsyncInstrumentState, for use by MeterImpl to manage running the set of observer callbacks in the correct order.

func (*AsyncInstrumentState) Instruments added in v0.5.0

func (a *AsyncInstrumentState) Instruments() []metric.AsyncImpl

Instruments returns the asynchronous instruments managed by this object, the set that should be checkpointed after observers are run.

func (*AsyncInstrumentState) Register added in v0.5.0

func (a *AsyncInstrumentState) Register(inst metric.AsyncImpl, runner metric.AsyncRunner)

Register adds a new asynchronous instrument to by managed by this object. This should be called during NewAsyncInstrument() and assumes that errors (e.g., duplicate registration) have already been checked.

func (*AsyncInstrumentState) Run added in v0.5.0

func (a *AsyncInstrumentState) Run(ctx context.Context, collector AsyncCollector)

Run executes the complete set of observer callbacks.

Jump to

Keyboard shortcuts

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