package test
import "go.opentelemetry.io/otel/sdk/metric/integrator/test"
Index ¶
- Variables
- func CounterAgg(desc *metric.Descriptor, v int64) export.Aggregator
- func LastValueAgg(desc *metric.Descriptor, v int64) export.Aggregator
- func NewAggregationSelector() export.AggregationSelector
- func NewCounterRecord(desc *metric.Descriptor, labels *label.Set, value int64) export.Record
- func NewLastValueRecord(desc *metric.Descriptor, labels *label.Set, value int64) export.Record
- type Encoder
- type Output
Variables ¶
var ( // LastValueADesc and LastValueBDesc group by "G" LastValueADesc = metric.NewDescriptor( "lastvalue.a", metric.ObserverKind, metric.Int64NumberKind) LastValueBDesc = metric.NewDescriptor( "lastvalue.b", metric.ObserverKind, metric.Int64NumberKind) // CounterADesc and CounterBDesc group by "C" CounterADesc = metric.NewDescriptor( "sum.a", metric.CounterKind, metric.Int64NumberKind) CounterBDesc = metric.NewDescriptor( "sum.b", metric.CounterKind, metric.Int64NumberKind) // SdkEncoder uses a non-standard encoder like K1~V1&K2~V2 SdkEncoder = &Encoder{} // GroupEncoder uses the SDK default encoder GroupEncoder = label.DefaultEncoder() // Labels1 has G=H and C=D Labels1 = makeLabels(kv.String("G", "H"), kv.String("C", "D")) // Labels2 has C=D and E=F Labels2 = makeLabels(kv.String("C", "D"), kv.String("E", "F")) // Labels3 is the empty set Labels3 = makeLabels() )
Functions ¶
func CounterAgg ¶
func CounterAgg(desc *metric.Descriptor, v int64) export.Aggregator
CounterAgg returns a checkpointed counter aggregator w/ the specified descriptor and value.
func LastValueAgg ¶
func LastValueAgg(desc *metric.Descriptor, v int64) export.Aggregator
LastValueAgg returns a checkpointed lastValue aggregator w/ the specified descriptor and value.
func NewAggregationSelector ¶
func NewAggregationSelector() export.AggregationSelector
NewAggregationSelector returns a policy that is consistent with the test descriptors above. I.e., it returns sum.New() for counter instruments and lastvalue.New() for lastValue instruments.
func NewCounterRecord ¶
Convenience method for building a test exported counter record.
func NewLastValueRecord ¶
Convenience method for building a test exported lastValue record.
Types ¶
type Encoder ¶
type Encoder struct{}
Encoder is an alternate label encoder to validate grouping logic.
func (Encoder) Encode ¶
func (Encoder) ID ¶
type Output ¶
Output collects distinct metric/label set outputs.
func NewOutput ¶
func (Output) AddTo ¶
AddTo adds a name/label-encoding entry with the lastValue or counter value to the output map.
Source Files ¶
test.go
- Version
- v0.5.0
- Published
- May 14, 2020
- Platform
- linux/amd64
- Imports
- 10 packages
- Last checked
- 8 minutes ago –
Tools for package owners.