package metric

import "go.opentelemetry.io/otel/internal/metric"

Index

Types

type Batch

type Batch struct {
	// Measurement needs to be aligned for 64-bit atomic operations.
	Measurements []Measurement
	Ctx          context.Context
	LabelSet     *LabelSet
}

type Handle

type Handle struct {
	Instrument *Instrument
	LabelSet   *LabelSet
}

func (*Handle) RecordOne

func (h *Handle) RecordOne(ctx context.Context, number core.Number)

func (*Handle) Unbind

func (h *Handle) Unbind()

type Instrument

type Instrument struct {
	Name       string
	Kind       Kind
	NumberKind core.NumberKind
	Opts       apimetric.Options
}

func (*Instrument) Bind

func (*Instrument) RecordOne

func (i *Instrument) RecordOne(ctx context.Context, number core.Number, labels apimetric.LabelSet)

type Kind

type Kind int8
const (
	KindCounter Kind = iota
	KindGauge
	KindMeasure
)

type LabelSet

type LabelSet struct {
	TheMeter *Meter
	Labels   map[core.Key]core.Value
}

func (*LabelSet) Meter

func (s *LabelSet) Meter() apimetric.Meter

type Measurement

type Measurement struct {
	// Number needs to be aligned for 64-bit atomic operations.
	Number     core.Number
	Instrument *Instrument
}

type Meter

type Meter struct {
	MeasurementBatches []Batch
}

func NewMeter

func NewMeter() *Meter

func (*Meter) Labels

func (m *Meter) Labels(labels ...core.KeyValue) apimetric.LabelSet

func (*Meter) NewFloat64Counter

func (m *Meter) NewFloat64Counter(name string, cos ...apimetric.CounterOptionApplier) apimetric.Float64Counter

func (*Meter) NewFloat64Gauge

func (m *Meter) NewFloat64Gauge(name string, gos ...apimetric.GaugeOptionApplier) apimetric.Float64Gauge

func (*Meter) NewFloat64Measure

func (m *Meter) NewFloat64Measure(name string, mos ...apimetric.MeasureOptionApplier) apimetric.Float64Measure

func (*Meter) NewInt64Counter

func (m *Meter) NewInt64Counter(name string, cos ...apimetric.CounterOptionApplier) apimetric.Int64Counter

func (*Meter) NewInt64Gauge

func (m *Meter) NewInt64Gauge(name string, gos ...apimetric.GaugeOptionApplier) apimetric.Int64Gauge

func (*Meter) NewInt64Measure

func (m *Meter) NewInt64Measure(name string, mos ...apimetric.MeasureOptionApplier) apimetric.Int64Measure

func (*Meter) RecordBatch

func (m *Meter) RecordBatch(ctx context.Context, labels apimetric.LabelSet, measurements ...apimetric.Measurement)

type MeterProvider

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

func NewProvider

func NewProvider() *MeterProvider

func (*MeterProvider) Meter

func (p *MeterProvider) Meter(name string) apimetric.Meter

Source Files

mock.go

Version
v0.2.3
Published
Mar 4, 2020
Platform
linux/amd64
Imports
4 packages
Last checked
1 hour ago

Tools for package owners.