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

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

    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

      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

        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

          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

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

              Run executes the complete set of observer callbacks.

              Source Files