Documentation ¶
Index ¶
- Variables
- type Async
- type AsyncCollector
- type AsyncInstrumentState
- type Batch
- type Handle
- type Instrument
- type Measurement
- type MeterImpl
- func (m *MeterImpl) CollectAsync(labels []kv.KeyValue, obs ...metric.Observation)
- func (m *MeterImpl) NewAsyncInstrument(descriptor metric.Descriptor, runner metric.AsyncRunner) (apimetric.AsyncImpl, error)
- func (m *MeterImpl) NewSyncInstrument(descriptor metric.Descriptor) (apimetric.SyncImpl, error)
- func (m *MeterImpl) RecordBatch(ctx context.Context, labels []kv.KeyValue, ...)
- func (m *MeterImpl) RunAsyncInstruments()
- type Sync
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidAsyncRunner = errors.New("unknown async runner type")
Functions ¶
This section is empty.
Types ¶
type Async ¶ added in v0.3.0
type Async struct { Instrument // contains filtered or unexported fields }
func (*Async) Implementation ¶ added in v0.3.0
func (a *Async) Implementation() interface{}
type AsyncCollector ¶ added in v0.5.0
type AsyncCollector interface { // CollectAsync passes a batch of observations to the MeterImpl. CollectAsync([]kv.KeyValue, ...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.
type Instrument ¶
type Instrument struct {
// contains filtered or unexported fields
}
func (Instrument) Descriptor ¶ added in v0.3.0
func (i Instrument) Descriptor() apimetric.Descriptor
type Measurement ¶
type Measurement struct { // Number needs to be aligned for 64-bit atomic operations. Number apimetric.Number Instrument apimetric.InstrumentImpl }
type MeterImpl ¶ added in v0.4.0
type MeterImpl struct { MeasurementBatches []Batch // contains filtered or unexported fields }
func NewProvider ¶ added in v0.2.1
func (*MeterImpl) CollectAsync ¶ added in v0.5.0
func (m *MeterImpl) CollectAsync(labels []kv.KeyValue, obs ...metric.Observation)
func (*MeterImpl) NewAsyncInstrument ¶ added in v0.4.0
func (m *MeterImpl) NewAsyncInstrument(descriptor metric.Descriptor, runner metric.AsyncRunner) (apimetric.AsyncImpl, error)
func (*MeterImpl) NewSyncInstrument ¶ added in v0.4.0
func (*MeterImpl) RecordBatch ¶ added in v0.4.0
func (*MeterImpl) RunAsyncInstruments ¶ added in v0.4.0
func (m *MeterImpl) RunAsyncInstruments()
type Sync ¶ added in v0.3.0
type Sync struct {
Instrument
}
func (*Sync) Bind ¶ added in v0.3.0
func (s *Sync) Bind(labels []kv.KeyValue) apimetric.BoundSyncImpl
func (*Sync) Implementation ¶ added in v0.3.0
func (s *Sync) Implementation() interface{}