otel: go.opentelemetry.io/otel/sdk/metric/batcher/test Index | Files

package test

import "go.opentelemetry.io/otel/sdk/metric/batcher/test"

Index

Package Files

test.go

Variables

var (
    // GaugeADesc and GaugeBDesc group by "G"
    GaugeADesc = export.NewDescriptor(
        "gauge.a", export.GaugeKind, []core.Key{key.New("G")}, "", "", core.Int64NumberKind, false)
    GaugeBDesc = export.NewDescriptor(
        "gauge.b", export.GaugeKind, []core.Key{key.New("G")}, "", "", core.Int64NumberKind, false)
    // CounterADesc and CounterBDesc group by "C"
    CounterADesc = export.NewDescriptor(
        "counter.a", export.CounterKind, []core.Key{key.New("C")}, "", "", core.Int64NumberKind, false)
    CounterBDesc = export.NewDescriptor(
        "counter.b", export.CounterKind, []core.Key{key.New("C")}, "", "", core.Int64NumberKind, false)

    // SdkEncoder uses a non-standard encoder like K1~V1&K2~V2
    SdkEncoder = &Encoder{}
    // GroupEncoder uses the SDK default encoder
    GroupEncoder = sdk.NewDefaultLabelEncoder()

    // Labels1 has G=H and C=D
    Labels1 = makeLabels(SdkEncoder, key.String("G", "H"), key.String("C", "D"))
    // Labels2 has C=D and E=F
    Labels2 = makeLabels(SdkEncoder, key.String("C", "D"), key.String("E", "F"))
    // Labels3 is the empty set
    Labels3 = makeLabels(SdkEncoder)
)

func CounterAgg Uses

func CounterAgg(desc *export.Descriptor, v int64) export.Aggregator

CounterAgg returns a checkpointed counter aggregator w/ the specified descriptor and value.

func GaugeAgg Uses

func GaugeAgg(desc *export.Descriptor, v int64) export.Aggregator

GaugeAgg returns a checkpointed gauge aggregator w/ the specified descriptor and value.

func NewAggregationSelector Uses

func NewAggregationSelector() export.AggregationSelector

NewAggregationSelector returns a policy that is consistent with the test descriptors above. I.e., it returns counter.New() for counter instruments and gauge.New for gauge instruments.

func NewCounterRecord Uses

func NewCounterRecord(desc *export.Descriptor, labels export.Labels, value int64) export.Record

Convenience method for building a test exported counter record.

func NewGaugeRecord Uses

func NewGaugeRecord(desc *export.Descriptor, labels export.Labels, value int64) export.Record

Convenience method for building a test exported gauge record.

type Encoder Uses

type Encoder struct{}

Encoder is an alternate label encoder to validate grouping logic.

func (Encoder) Encode Uses

func (Encoder) Encode(labels []core.KeyValue) string

type Output Uses

type Output map[string]int64

Output collects distinct metric/label set outputs.

func (Output) AddTo Uses

func (o Output) AddTo(rec export.Record)

AddTo adds a name/label-encoding entry with the gauge or counter value to the output map.

Package test imports 9 packages (graph). Updated 2020-01-07. Refresh now. Tools for package owners.