syncstate

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 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]](ctx context.Context, inst *Observer, num N, cfg OpConfig)

Observe performs a generic update for any synchronous instrument.

Types

type Observer added in v1.13.0

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

Instrument maintains a mapping from attribute.Set to an internal record type for a single API-level instrument. This type is organized so that a single attribute.Set lookup is performed regardless of the number of reader and instrument-view behaviors. Entries in the map have their accumulator's SnapshotAndProcess() method called whenever they are removed from the map, which can happen when any reader collects the instrument.

func New added in v1.13.0

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

New builds a new synchronous instrument *Observer given the per-pipeline instrument-views compiled. Note that the unused third parameter is an opaque value used in the asyncstate package, passed here to make these two packages generalize.

func (*Observer) ObserveFloat64 added in v1.13.0

func (inst *Observer) ObserveFloat64(ctx context.Context, num float64, cfg OpConfig)

func (*Observer) ObserveInt64 added in v1.13.0

func (inst *Observer) ObserveInt64(ctx context.Context, num int64, cfg OpConfig)

func (*Observer) SnapshotAndProcess added in v1.13.0

func (inst *Observer) SnapshotAndProcess()

SnapshotAndProcess calls SnapshotAndProcess() for all live accumulators of this instrument. Inactive accumulators will be subsequently removed from the map.

type OpConfig added in v1.17.0

type OpConfig struct {
	Attributes attribute.Set
	KeyValues  []attribute.KeyValue
}

interface conversion.

Jump to

Keyboard shortcuts

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