asyncstate

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Observe added in v1.13.0

func Observe[N number.Any, Traits number.Traits[N]](inst metric.Observable, cs *callbackState, value N, options []metric.ObserveOption)

Types

type Callback

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

Callback is the implementation object associated with one asynchronous callback.

func NewCallback

func NewCallback(instruments []metric.Observable, opaque interface{}, function metric.Callback) (*Callback, error)

NewCallback returns a new Callback; this checks that each of the provided instruments belongs to the same meter provider.

func (*Callback) Run

func (c *Callback) Run(ctx context.Context, state *State)

Run executes the callback after setting up the appropriate context for a specific reader.

type Observer

type Observer struct {
	metric.Observable
	// contains filtered or unexported fields
}

Observer is the implementation object associated with one asynchronous instrument.

func New added in v1.13.0

func New(desc sdkinstrument.Descriptor, perf sdkinstrument.Performance, opaque interface{}, compiled pipeline.Register[viewstate.Instrument]) *Observer

New returns a new Observer; this compiles individual instruments for each reader.

func (*Observer) SnapshotAndProcess added in v1.13.0

func (obs *Observer) SnapshotAndProcess(state *State)

SnapshotAndProcess calls SnapshotAndProcess() on each of the pending aggregations for a given reader.

type State

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

State is the object used to maintain independent collection state for each asynchronous meter.

func NewState

func NewState(pipe int) *State

Jump to

Keyboard shortcuts

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