Documentation ¶
Index ¶
- Constants
- Variables
- type Buckets
- type Exemplar
- func (ms Exemplar) CopyTo(dest Exemplar)
- func (ms Exemplar) DoubleVal() float64
- func (ms Exemplar) FilteredAttributes() pcommon.Map
- func (ms Exemplar) IntVal() int64
- func (ms Exemplar) MoveTo(dest Exemplar)
- func (ms Exemplar) SetDoubleVal(v float64)
- func (ms Exemplar) SetIntVal(v int64)
- func (ms Exemplar) SetSpanID(v pcommon.SpanID)
- func (ms Exemplar) SetTimestamp(v pcommon.Timestamp)
- func (ms Exemplar) SetTraceID(v pcommon.TraceID)
- func (ms Exemplar) SpanID() pcommon.SpanID
- func (ms Exemplar) Timestamp() pcommon.Timestamp
- func (ms Exemplar) TraceID() pcommon.TraceID
- func (ms Exemplar) ValueType() ExemplarValueType
- type ExemplarSlice
- func (es ExemplarSlice) AppendEmpty() Exemplar
- func (es ExemplarSlice) At(ix int) Exemplar
- func (es ExemplarSlice) CopyTo(dest ExemplarSlice)
- func (es ExemplarSlice) EnsureCapacity(newCap int)
- func (es ExemplarSlice) Len() int
- func (es ExemplarSlice) MoveAndAppendTo(dest ExemplarSlice)
- func (es ExemplarSlice) RemoveIf(f func(Exemplar) bool)
- type ExemplarValueType
- type ExponentialHistogram
- func (ms ExponentialHistogram) AggregationTemporality() MetricAggregationTemporality
- func (ms ExponentialHistogram) CopyTo(dest ExponentialHistogram)
- func (ms ExponentialHistogram) DataPoints() ExponentialHistogramDataPointSlice
- func (ms ExponentialHistogram) MoveTo(dest ExponentialHistogram)
- func (ms ExponentialHistogram) SetAggregationTemporality(v MetricAggregationTemporality)
- type ExponentialHistogramDataPoint
- func (ms ExponentialHistogramDataPoint) Attributes() pcommon.Map
- func (ms ExponentialHistogramDataPoint) CopyTo(dest ExponentialHistogramDataPoint)
- func (ms ExponentialHistogramDataPoint) Count() uint64
- func (ms ExponentialHistogramDataPoint) Exemplars() ExemplarSlice
- func (ms ExponentialHistogramDataPoint) Flags() MetricDataPointFlags
- func (ms ExponentialHistogramDataPoint) FlagsImmutable() MetricDataPointFlagsdeprecated
- func (ms ExponentialHistogramDataPoint) HasMax() bool
- func (ms ExponentialHistogramDataPoint) HasMin() bool
- func (ms ExponentialHistogramDataPoint) HasSum() bool
- func (ms ExponentialHistogramDataPoint) Max() float64
- func (ms ExponentialHistogramDataPoint) Min() float64
- func (ms ExponentialHistogramDataPoint) MoveTo(dest ExponentialHistogramDataPoint)
- func (ms ExponentialHistogramDataPoint) Negative() Buckets
- func (ms ExponentialHistogramDataPoint) Positive() Buckets
- func (ms ExponentialHistogramDataPoint) Scale() int32
- func (ms ExponentialHistogramDataPoint) SetCount(v uint64)
- func (ms ExponentialHistogramDataPoint) SetFlags(v MetricDataPointFlags)
- func (ms ExponentialHistogramDataPoint) SetFlagsImmutable(v MetricDataPointFlags)deprecated
- func (ms ExponentialHistogramDataPoint) SetMax(v float64)
- func (ms ExponentialHistogramDataPoint) SetMin(v float64)
- func (ms ExponentialHistogramDataPoint) SetScale(v int32)
- func (ms ExponentialHistogramDataPoint) SetStartTimestamp(v pcommon.Timestamp)
- func (ms ExponentialHistogramDataPoint) SetSum(v float64)
- func (ms ExponentialHistogramDataPoint) SetTimestamp(v pcommon.Timestamp)
- func (ms ExponentialHistogramDataPoint) SetZeroCount(v uint64)
- func (ms ExponentialHistogramDataPoint) StartTimestamp() pcommon.Timestamp
- func (ms ExponentialHistogramDataPoint) Sum() float64
- func (ms ExponentialHistogramDataPoint) Timestamp() pcommon.Timestamp
- func (ms ExponentialHistogramDataPoint) ZeroCount() uint64
- type ExponentialHistogramDataPointSlice
- func (es ExponentialHistogramDataPointSlice) AppendEmpty() ExponentialHistogramDataPoint
- func (es ExponentialHistogramDataPointSlice) At(ix int) ExponentialHistogramDataPoint
- func (es ExponentialHistogramDataPointSlice) CopyTo(dest ExponentialHistogramDataPointSlice)
- func (es ExponentialHistogramDataPointSlice) EnsureCapacity(newCap int)
- func (es ExponentialHistogramDataPointSlice) Len() int
- func (es ExponentialHistogramDataPointSlice) MoveAndAppendTo(dest ExponentialHistogramDataPointSlice)
- func (es ExponentialHistogramDataPointSlice) RemoveIf(f func(ExponentialHistogramDataPoint) bool)
- func (es ExponentialHistogramDataPointSlice) Sort(less func(a, b ExponentialHistogramDataPoint) bool) ExponentialHistogramDataPointSlice
- type Gauge
- type Histogram
- type HistogramDataPoint
- func (ms HistogramDataPoint) Attributes() pcommon.Map
- func (ms HistogramDataPoint) BucketCounts() pcommon.UInt64Slice
- func (ms HistogramDataPoint) CopyTo(dest HistogramDataPoint)
- func (ms HistogramDataPoint) Count() uint64
- func (ms HistogramDataPoint) Exemplars() ExemplarSlice
- func (ms HistogramDataPoint) ExplicitBounds() pcommon.Float64Slice
- func (ms HistogramDataPoint) Flags() MetricDataPointFlags
- func (ms HistogramDataPoint) FlagsImmutable() MetricDataPointFlagsdeprecated
- func (ms HistogramDataPoint) HasMax() bool
- func (ms HistogramDataPoint) HasMin() bool
- func (ms HistogramDataPoint) HasSum() bool
- func (ms HistogramDataPoint) Max() float64
- func (ms HistogramDataPoint) Min() float64
- func (ms HistogramDataPoint) MoveTo(dest HistogramDataPoint)
- func (ms HistogramDataPoint) SetBucketCounts(v pcommon.UInt64Slice)
- func (ms HistogramDataPoint) SetCount(v uint64)
- func (ms HistogramDataPoint) SetExplicitBounds(v pcommon.Float64Slice)
- func (ms HistogramDataPoint) SetFlags(v MetricDataPointFlags)
- func (ms HistogramDataPoint) SetFlagsImmutable(v MetricDataPointFlags)deprecated
- func (ms HistogramDataPoint) SetMax(v float64)
- func (ms HistogramDataPoint) SetMin(v float64)
- func (ms HistogramDataPoint) SetStartTimestamp(v pcommon.Timestamp)
- func (ms HistogramDataPoint) SetSum(v float64)
- func (ms HistogramDataPoint) SetTimestamp(v pcommon.Timestamp)
- func (ms HistogramDataPoint) StartTimestamp() pcommon.Timestamp
- func (ms HistogramDataPoint) Sum() float64
- func (ms HistogramDataPoint) Timestamp() pcommon.Timestamp
- type HistogramDataPointSlice
- func (es HistogramDataPointSlice) AppendEmpty() HistogramDataPoint
- func (es HistogramDataPointSlice) At(ix int) HistogramDataPoint
- func (es HistogramDataPointSlice) CopyTo(dest HistogramDataPointSlice)
- func (es HistogramDataPointSlice) EnsureCapacity(newCap int)
- func (es HistogramDataPointSlice) Len() int
- func (es HistogramDataPointSlice) MoveAndAppendTo(dest HistogramDataPointSlice)
- func (es HistogramDataPointSlice) RemoveIf(f func(HistogramDataPoint) bool)
- func (es HistogramDataPointSlice) Sort(less func(a, b HistogramDataPoint) bool) HistogramDataPointSlice
- type MarshalSizer
- type Marshaler
- type MarshalerSizerdeprecated
- type Metric
- func (ms Metric) CopyTo(dest Metric)
- func (ms Metric) DataType() MetricDataType
- func (ms Metric) Description() string
- func (ms Metric) ExponentialHistogram() ExponentialHistogram
- func (ms Metric) Gauge() Gauge
- func (ms Metric) Histogram() Histogram
- func (ms Metric) MoveTo(dest Metric)
- func (ms Metric) Name() string
- func (ms Metric) SetDataType(ty MetricDataType)deprecated
- func (ms Metric) SetDescription(v string)
- func (ms Metric) SetEmptyExponentialHistogram() ExponentialHistogram
- func (ms Metric) SetEmptyGauge() Gauge
- func (ms Metric) SetEmptyHistogram() Histogram
- func (ms Metric) SetEmptySum() Sum
- func (ms Metric) SetEmptySummary() Summary
- func (ms Metric) SetName(v string)
- func (ms Metric) SetUnit(v string)
- func (ms Metric) Sum() Sum
- func (ms Metric) Summary() Summary
- func (ms Metric) Unit() string
- type MetricAggregationTemporality
- type MetricDataPointFlags
- type MetricDataPointFlagsImmutabledeprecated
- type MetricDataType
- type MetricSlice
- func (es MetricSlice) AppendEmpty() Metric
- func (es MetricSlice) At(ix int) Metric
- func (es MetricSlice) CopyTo(dest MetricSlice)
- func (es MetricSlice) EnsureCapacity(newCap int)
- func (es MetricSlice) Len() int
- func (es MetricSlice) MoveAndAppendTo(dest MetricSlice)
- func (es MetricSlice) RemoveIf(f func(Metric) bool)
- func (es MetricSlice) Sort(less func(a, b Metric) bool) MetricSlice
- type Metrics
- type NumberDataPoint
- func (ms NumberDataPoint) Attributes() pcommon.Map
- func (ms NumberDataPoint) CopyTo(dest NumberDataPoint)
- func (ms NumberDataPoint) DoubleVal() float64
- func (ms NumberDataPoint) Exemplars() ExemplarSlice
- func (ms NumberDataPoint) Flags() MetricDataPointFlags
- func (ms NumberDataPoint) FlagsImmutable() MetricDataPointFlagsdeprecated
- func (ms NumberDataPoint) IntVal() int64
- func (ms NumberDataPoint) MoveTo(dest NumberDataPoint)
- func (ms NumberDataPoint) SetDoubleVal(v float64)
- func (ms NumberDataPoint) SetFlags(v MetricDataPointFlags)
- func (ms NumberDataPoint) SetFlagsImmutable(v MetricDataPointFlags)deprecated
- func (ms NumberDataPoint) SetIntVal(v int64)
- func (ms NumberDataPoint) SetStartTimestamp(v pcommon.Timestamp)
- func (ms NumberDataPoint) SetTimestamp(v pcommon.Timestamp)
- func (ms NumberDataPoint) StartTimestamp() pcommon.Timestamp
- func (ms NumberDataPoint) Timestamp() pcommon.Timestamp
- func (ms NumberDataPoint) ValueType() NumberDataPointValueType
- type NumberDataPointSlice
- func (es NumberDataPointSlice) AppendEmpty() NumberDataPoint
- func (es NumberDataPointSlice) At(ix int) NumberDataPoint
- func (es NumberDataPointSlice) CopyTo(dest NumberDataPointSlice)
- func (es NumberDataPointSlice) EnsureCapacity(newCap int)
- func (es NumberDataPointSlice) Len() int
- func (es NumberDataPointSlice) MoveAndAppendTo(dest NumberDataPointSlice)
- func (es NumberDataPointSlice) RemoveIf(f func(NumberDataPoint) bool)
- func (es NumberDataPointSlice) Sort(less func(a, b NumberDataPoint) bool) NumberDataPointSlice
- type NumberDataPointValueType
- type OptionalType
- type ResourceMetrics
- func (ms ResourceMetrics) CopyTo(dest ResourceMetrics)
- func (ms ResourceMetrics) MoveTo(dest ResourceMetrics)
- func (ms ResourceMetrics) Resource() pcommon.Resource
- func (ms ResourceMetrics) SchemaUrl() string
- func (ms ResourceMetrics) ScopeMetrics() ScopeMetricsSlice
- func (ms ResourceMetrics) SetSchemaUrl(v string)
- type ResourceMetricsSlice
- func (es ResourceMetricsSlice) AppendEmpty() ResourceMetrics
- func (es ResourceMetricsSlice) At(ix int) ResourceMetrics
- func (es ResourceMetricsSlice) CopyTo(dest ResourceMetricsSlice)
- func (es ResourceMetricsSlice) EnsureCapacity(newCap int)
- func (es ResourceMetricsSlice) Len() int
- func (es ResourceMetricsSlice) MoveAndAppendTo(dest ResourceMetricsSlice)
- func (es ResourceMetricsSlice) RemoveIf(f func(ResourceMetrics) bool)
- func (es ResourceMetricsSlice) Sort(less func(a, b ResourceMetrics) bool) ResourceMetricsSlice
- type ScopeMetrics
- type ScopeMetricsSlice
- func (es ScopeMetricsSlice) AppendEmpty() ScopeMetrics
- func (es ScopeMetricsSlice) At(ix int) ScopeMetrics
- func (es ScopeMetricsSlice) CopyTo(dest ScopeMetricsSlice)
- func (es ScopeMetricsSlice) EnsureCapacity(newCap int)
- func (es ScopeMetricsSlice) Len() int
- func (es ScopeMetricsSlice) MoveAndAppendTo(dest ScopeMetricsSlice)
- func (es ScopeMetricsSlice) RemoveIf(f func(ScopeMetrics) bool)
- func (es ScopeMetricsSlice) Sort(less func(a, b ScopeMetrics) bool) ScopeMetricsSlice
- type Sizer
- type Sum
- func (ms Sum) AggregationTemporality() MetricAggregationTemporality
- func (ms Sum) CopyTo(dest Sum)
- func (ms Sum) DataPoints() NumberDataPointSlice
- func (ms Sum) IsMonotonic() bool
- func (ms Sum) MoveTo(dest Sum)
- func (ms Sum) SetAggregationTemporality(v MetricAggregationTemporality)
- func (ms Sum) SetIsMonotonic(v bool)
- type Summary
- type SummaryDataPoint
- func (ms SummaryDataPoint) Attributes() pcommon.Map
- func (ms SummaryDataPoint) CopyTo(dest SummaryDataPoint)
- func (ms SummaryDataPoint) Count() uint64
- func (ms SummaryDataPoint) Flags() MetricDataPointFlags
- func (ms SummaryDataPoint) FlagsImmutable() MetricDataPointFlagsdeprecated
- func (ms SummaryDataPoint) MoveTo(dest SummaryDataPoint)
- func (ms SummaryDataPoint) QuantileValues() ValueAtQuantileSlice
- func (ms SummaryDataPoint) SetCount(v uint64)
- func (ms SummaryDataPoint) SetFlags(v MetricDataPointFlags)
- func (ms SummaryDataPoint) SetFlagsImmutable(v MetricDataPointFlags)deprecated
- func (ms SummaryDataPoint) SetStartTimestamp(v pcommon.Timestamp)
- func (ms SummaryDataPoint) SetSum(v float64)
- func (ms SummaryDataPoint) SetTimestamp(v pcommon.Timestamp)
- func (ms SummaryDataPoint) StartTimestamp() pcommon.Timestamp
- func (ms SummaryDataPoint) Sum() float64
- func (ms SummaryDataPoint) Timestamp() pcommon.Timestamp
- type SummaryDataPointSlice
- func (es SummaryDataPointSlice) AppendEmpty() SummaryDataPoint
- func (es SummaryDataPointSlice) At(ix int) SummaryDataPoint
- func (es SummaryDataPointSlice) CopyTo(dest SummaryDataPointSlice)
- func (es SummaryDataPointSlice) EnsureCapacity(newCap int)
- func (es SummaryDataPointSlice) Len() int
- func (es SummaryDataPointSlice) MoveAndAppendTo(dest SummaryDataPointSlice)
- func (es SummaryDataPointSlice) RemoveIf(f func(SummaryDataPoint) bool)
- func (es SummaryDataPointSlice) Sort(less func(a, b SummaryDataPoint) bool) SummaryDataPointSlice
- type Unmarshaler
- type ValueAtQuantile
- type ValueAtQuantileSlice
- func (es ValueAtQuantileSlice) AppendEmpty() ValueAtQuantile
- func (es ValueAtQuantileSlice) At(ix int) ValueAtQuantile
- func (es ValueAtQuantileSlice) CopyTo(dest ValueAtQuantileSlice)
- func (es ValueAtQuantileSlice) EnsureCapacity(newCap int)
- func (es ValueAtQuantileSlice) Len() int
- func (es ValueAtQuantileSlice) MoveAndAppendTo(dest ValueAtQuantileSlice)
- func (es ValueAtQuantileSlice) RemoveIf(f func(ValueAtQuantile) bool)
- func (es ValueAtQuantileSlice) Sort(less func(a, b ValueAtQuantile) bool) ValueAtQuantileSlice
Constants ¶
const ( // MetricAggregationTemporalityUnspecified is the default MetricAggregationTemporality, it MUST NOT be used. MetricAggregationTemporalityUnspecified = MetricAggregationTemporality(otlpmetrics.AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED) // MetricAggregationTemporalityDelta is a MetricAggregationTemporality for a metric aggregator which reports changes since last report time. MetricAggregationTemporalityDelta = MetricAggregationTemporality(otlpmetrics.AggregationTemporality_AGGREGATION_TEMPORALITY_DELTA) // MetricAggregationTemporalityCumulative is a MetricAggregationTemporality for a metric aggregator which reports changes since a fixed start time. MetricAggregationTemporalityCumulative = MetricAggregationTemporality(otlpmetrics.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE) )
Variables ¶
var DefaultMetricDataPointFlags = MetricDataPointFlags(0)
Functions ¶
This section is empty.
Types ¶
type Buckets ¶
func NewBuckets ¶
func NewBuckets() Buckets
NewBuckets creates a new empty Buckets.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (Buckets) BucketCounts ¶ added in v0.59.0
func (ms Buckets) BucketCounts() pcommon.UInt64Slice
BucketCounts returns the bucketcounts associated with this Buckets.
func (Buckets) CopyTo ¶ added in v0.59.0
CopyTo copies all properties from the current struct to the dest.
func (Buckets) MoveTo ¶ added in v0.59.0
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (Buckets) SetBucketCounts ¶ added in v0.59.0
func (ms Buckets) SetBucketCounts(v pcommon.UInt64Slice)
SetBucketCounts replaces the bucketcounts associated with this Buckets. Deprecated: [0.60.0] Use BucketCounts().FromRaw() instead
type Exemplar ¶
func NewExemplar ¶
func NewExemplar() Exemplar
NewExemplar creates a new empty Exemplar.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (Exemplar) CopyTo ¶ added in v0.59.0
CopyTo copies all properties from the current struct to the dest.
func (Exemplar) DoubleVal ¶ added in v0.59.0
DoubleVal returns the doubleval associated with this Exemplar.
func (Exemplar) FilteredAttributes ¶ added in v0.59.0
FilteredAttributes returns the FilteredAttributes associated with this Exemplar.
func (Exemplar) MoveTo ¶ added in v0.59.0
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (Exemplar) SetDoubleVal ¶ added in v0.59.0
SetDoubleVal replaces the doubleval associated with this Exemplar.
func (Exemplar) SetIntVal ¶ added in v0.59.0
SetIntVal replaces the intval associated with this Exemplar.
func (Exemplar) SetSpanID ¶ added in v0.59.0
SetSpanID replaces the spanid associated with this Exemplar.
func (Exemplar) SetTimestamp ¶ added in v0.59.0
SetTimestamp replaces the timestamp associated with this Exemplar.
func (Exemplar) SetTraceID ¶ added in v0.59.0
SetTraceID replaces the traceid associated with this Exemplar.
func (Exemplar) Timestamp ¶ added in v0.59.0
Timestamp returns the timestamp associated with this Exemplar.
func (Exemplar) TraceID ¶ added in v0.59.0
TraceID returns the traceid associated with this Exemplar.
func (Exemplar) ValueType ¶ added in v0.59.0
func (ms Exemplar) ValueType() ExemplarValueType
ValueType returns the type of the value for this Exemplar. Calling this function on zero-initialized Exemplar will cause a panic.
type ExemplarSlice ¶
type ExemplarSlice internal.ExemplarSlice
ExemplarSlice logically represents a slice of Exemplar.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewExemplarSlice function to create new instances. Important: zero-initialized instance is not valid for use.
func NewExemplarSlice ¶
func NewExemplarSlice() ExemplarSlice
NewExemplarSlice creates a ExemplarSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
func (ExemplarSlice) AppendEmpty ¶ added in v0.59.0
func (es ExemplarSlice) AppendEmpty() Exemplar
AppendEmpty will append to the end of the slice an empty Exemplar. It returns the newly added Exemplar.
func (ExemplarSlice) At ¶ added in v0.59.0
func (es ExemplarSlice) At(ix int) Exemplar
At returns the element at the given index.
This function is used mostly for iterating over all the values in the slice:
for i := 0; i < es.Len(); i++ { e := es.At(i) ... // Do something with the element }
func (ExemplarSlice) CopyTo ¶ added in v0.59.0
func (es ExemplarSlice) CopyTo(dest ExemplarSlice)
CopyTo copies all elements from the current slice to the dest.
func (ExemplarSlice) EnsureCapacity ¶ added in v0.59.0
func (es ExemplarSlice) EnsureCapacity(newCap int)
EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.
Here is how a new ExemplarSlice can be initialized:
es := NewExemplarSlice() es.EnsureCapacity(4) for i := 0; i < 4; i++ { e := es.AppendEmpty() // Here should set all the values for e. }
func (ExemplarSlice) Len ¶ added in v0.59.0
func (es ExemplarSlice) Len() int
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewExemplarSlice()".
func (ExemplarSlice) MoveAndAppendTo ¶ added in v0.59.0
func (es ExemplarSlice) MoveAndAppendTo(dest ExemplarSlice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (ExemplarSlice) RemoveIf ¶ added in v0.59.0
func (es ExemplarSlice) RemoveIf(f func(Exemplar) bool)
RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.
type ExemplarValueType ¶ added in v0.50.0
type ExemplarValueType int32
ExemplarValueType specifies the type of Exemplar measurement value.
const ( ExemplarValueTypeNone ExemplarValueType = iota ExemplarValueTypeInt ExemplarValueTypeDouble )
func (ExemplarValueType) String ¶ added in v0.59.0
func (nt ExemplarValueType) String() string
String returns the string representation of the ExemplarValueType.
type ExponentialHistogram ¶
type ExponentialHistogram internal.ExponentialHistogram
func NewExponentialHistogram ¶
func NewExponentialHistogram() ExponentialHistogram
NewExponentialHistogram creates a new empty ExponentialHistogram.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (ExponentialHistogram) AggregationTemporality ¶ added in v0.59.0
func (ms ExponentialHistogram) AggregationTemporality() MetricAggregationTemporality
AggregationTemporality returns the aggregationtemporality associated with this ExponentialHistogram.
func (ExponentialHistogram) CopyTo ¶ added in v0.59.0
func (ms ExponentialHistogram) CopyTo(dest ExponentialHistogram)
CopyTo copies all properties from the current struct to the dest.
func (ExponentialHistogram) DataPoints ¶ added in v0.59.0
func (ms ExponentialHistogram) DataPoints() ExponentialHistogramDataPointSlice
DataPoints returns the DataPoints associated with this ExponentialHistogram.
func (ExponentialHistogram) MoveTo ¶ added in v0.59.0
func (ms ExponentialHistogram) MoveTo(dest ExponentialHistogram)
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (ExponentialHistogram) SetAggregationTemporality ¶ added in v0.59.0
func (ms ExponentialHistogram) SetAggregationTemporality(v MetricAggregationTemporality)
SetAggregationTemporality replaces the aggregationtemporality associated with this ExponentialHistogram.
type ExponentialHistogramDataPoint ¶
type ExponentialHistogramDataPoint internal.ExponentialHistogramDataPoint
func NewExponentialHistogramDataPoint ¶
func NewExponentialHistogramDataPoint() ExponentialHistogramDataPoint
NewExponentialHistogramDataPoint creates a new empty ExponentialHistogramDataPoint.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (ExponentialHistogramDataPoint) Attributes ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) Attributes() pcommon.Map
Attributes returns the Attributes associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) CopyTo ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) CopyTo(dest ExponentialHistogramDataPoint)
CopyTo copies all properties from the current struct to the dest.
func (ExponentialHistogramDataPoint) Count ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) Count() uint64
Count returns the count associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) Exemplars ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) Exemplars() ExemplarSlice
Exemplars returns the Exemplars associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) Flags ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) Flags() MetricDataPointFlags
Flags returns the flags associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) FlagsImmutable
deprecated
added in
v0.59.0
func (ms ExponentialHistogramDataPoint) FlagsImmutable() MetricDataPointFlags
Deprecated: [v0.60.0] use Flags.
func (ExponentialHistogramDataPoint) HasMax ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) HasMax() bool
HasMax returns true if the ExponentialHistogramDataPoint contains a Max value, false otherwise.
func (ExponentialHistogramDataPoint) HasMin ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) HasMin() bool
HasMin returns true if the ExponentialHistogramDataPoint contains a Min value, false otherwise.
func (ExponentialHistogramDataPoint) HasSum ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) HasSum() bool
HasSum returns true if the ExponentialHistogramDataPoint contains a Sum value, false otherwise.
func (ExponentialHistogramDataPoint) Max ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) Max() float64
Max returns the max associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) Min ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) Min() float64
Min returns the min associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) MoveTo ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) MoveTo(dest ExponentialHistogramDataPoint)
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (ExponentialHistogramDataPoint) Negative ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) Negative() Buckets
Negative returns the negative associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) Positive ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) Positive() Buckets
Positive returns the positive associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) Scale ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) Scale() int32
Scale returns the scale associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) SetCount ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) SetCount(v uint64)
SetCount replaces the count associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) SetFlags ¶ added in v0.60.0
func (ms ExponentialHistogramDataPoint) SetFlags(v MetricDataPointFlags)
SetFlags replaces the flags associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) SetFlagsImmutable
deprecated
added in
v0.59.0
func (ms ExponentialHistogramDataPoint) SetFlagsImmutable(v MetricDataPointFlags)
Deprecated: [v0.60.0] use SetFlags.
func (ExponentialHistogramDataPoint) SetMax ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) SetMax(v float64)
SetMax replaces the max associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) SetMin ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) SetMin(v float64)
SetMin replaces the min associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) SetScale ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) SetScale(v int32)
SetScale replaces the scale associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) SetStartTimestamp ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) SetStartTimestamp(v pcommon.Timestamp)
SetStartTimestamp replaces the starttimestamp associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) SetSum ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) SetSum(v float64)
SetSum replaces the sum associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) SetTimestamp ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) SetTimestamp(v pcommon.Timestamp)
SetTimestamp replaces the timestamp associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) SetZeroCount ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) SetZeroCount(v uint64)
SetZeroCount replaces the zerocount associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) StartTimestamp ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) StartTimestamp() pcommon.Timestamp
StartTimestamp returns the starttimestamp associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) Sum ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) Sum() float64
Sum returns the sum associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) Timestamp ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) Timestamp() pcommon.Timestamp
Timestamp returns the timestamp associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) ZeroCount ¶ added in v0.59.0
func (ms ExponentialHistogramDataPoint) ZeroCount() uint64
ZeroCount returns the zerocount associated with this ExponentialHistogramDataPoint.
type ExponentialHistogramDataPointSlice ¶
type ExponentialHistogramDataPointSlice internal.ExponentialHistogramDataPointSlice
ExponentialHistogramDataPointSlice logically represents a slice of ExponentialHistogramDataPoint.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewExponentialHistogramDataPointSlice function to create new instances. Important: zero-initialized instance is not valid for use.
func NewExponentialHistogramDataPointSlice ¶
func NewExponentialHistogramDataPointSlice() ExponentialHistogramDataPointSlice
NewExponentialHistogramDataPointSlice creates a ExponentialHistogramDataPointSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
func (ExponentialHistogramDataPointSlice) AppendEmpty ¶ added in v0.59.0
func (es ExponentialHistogramDataPointSlice) AppendEmpty() ExponentialHistogramDataPoint
AppendEmpty will append to the end of the slice an empty ExponentialHistogramDataPoint. It returns the newly added ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPointSlice) At ¶ added in v0.59.0
func (es ExponentialHistogramDataPointSlice) At(ix int) ExponentialHistogramDataPoint
At returns the element at the given index.
This function is used mostly for iterating over all the values in the slice:
for i := 0; i < es.Len(); i++ { e := es.At(i) ... // Do something with the element }
func (ExponentialHistogramDataPointSlice) CopyTo ¶ added in v0.59.0
func (es ExponentialHistogramDataPointSlice) CopyTo(dest ExponentialHistogramDataPointSlice)
CopyTo copies all elements from the current slice to the dest.
func (ExponentialHistogramDataPointSlice) EnsureCapacity ¶ added in v0.59.0
func (es ExponentialHistogramDataPointSlice) EnsureCapacity(newCap int)
EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.
Here is how a new ExponentialHistogramDataPointSlice can be initialized:
es := NewExponentialHistogramDataPointSlice() es.EnsureCapacity(4) for i := 0; i < 4; i++ { e := es.AppendEmpty() // Here should set all the values for e. }
func (ExponentialHistogramDataPointSlice) Len ¶ added in v0.59.0
func (es ExponentialHistogramDataPointSlice) Len() int
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewExponentialHistogramDataPointSlice()".
func (ExponentialHistogramDataPointSlice) MoveAndAppendTo ¶ added in v0.59.0
func (es ExponentialHistogramDataPointSlice) MoveAndAppendTo(dest ExponentialHistogramDataPointSlice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (ExponentialHistogramDataPointSlice) RemoveIf ¶ added in v0.59.0
func (es ExponentialHistogramDataPointSlice) RemoveIf(f func(ExponentialHistogramDataPoint) bool)
RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.
func (ExponentialHistogramDataPointSlice) Sort ¶ added in v0.59.0
func (es ExponentialHistogramDataPointSlice) Sort(less func(a, b ExponentialHistogramDataPoint) bool) ExponentialHistogramDataPointSlice
Sort sorts the ExponentialHistogramDataPoint elements within ExponentialHistogramDataPointSlice given the provided less function so that two instances of ExponentialHistogramDataPointSlice can be compared.
Returns the same instance to allow nicer code like:
lessFunc := func(a, b ExponentialHistogramDataPoint) bool { return a.Name() < b.Name() // choose any comparison here } assert.Equal(t, expected.Sort(lessFunc), actual.Sort(lessFunc))
type Gauge ¶
func NewGauge ¶
func NewGauge() Gauge
NewGauge creates a new empty Gauge.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (Gauge) CopyTo ¶ added in v0.59.0
CopyTo copies all properties from the current struct to the dest.
func (Gauge) DataPoints ¶ added in v0.59.0
func (ms Gauge) DataPoints() NumberDataPointSlice
DataPoints returns the DataPoints associated with this Gauge.
type Histogram ¶
func NewHistogram ¶
func NewHistogram() Histogram
NewHistogram creates a new empty Histogram.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (Histogram) AggregationTemporality ¶ added in v0.59.0
func (ms Histogram) AggregationTemporality() MetricAggregationTemporality
AggregationTemporality returns the aggregationtemporality associated with this Histogram.
func (Histogram) CopyTo ¶ added in v0.59.0
CopyTo copies all properties from the current struct to the dest.
func (Histogram) DataPoints ¶ added in v0.59.0
func (ms Histogram) DataPoints() HistogramDataPointSlice
DataPoints returns the DataPoints associated with this Histogram.
func (Histogram) MoveTo ¶ added in v0.59.0
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (Histogram) SetAggregationTemporality ¶ added in v0.59.0
func (ms Histogram) SetAggregationTemporality(v MetricAggregationTemporality)
SetAggregationTemporality replaces the aggregationtemporality associated with this Histogram.
type HistogramDataPoint ¶
type HistogramDataPoint internal.HistogramDataPoint
func NewHistogramDataPoint ¶
func NewHistogramDataPoint() HistogramDataPoint
NewHistogramDataPoint creates a new empty HistogramDataPoint.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (HistogramDataPoint) Attributes ¶ added in v0.59.0
func (ms HistogramDataPoint) Attributes() pcommon.Map
Attributes returns the Attributes associated with this HistogramDataPoint.
func (HistogramDataPoint) BucketCounts ¶ added in v0.59.0
func (ms HistogramDataPoint) BucketCounts() pcommon.UInt64Slice
BucketCounts returns the bucketcounts associated with this HistogramDataPoint.
func (HistogramDataPoint) CopyTo ¶ added in v0.59.0
func (ms HistogramDataPoint) CopyTo(dest HistogramDataPoint)
CopyTo copies all properties from the current struct to the dest.
func (HistogramDataPoint) Count ¶ added in v0.59.0
func (ms HistogramDataPoint) Count() uint64
Count returns the count associated with this HistogramDataPoint.
func (HistogramDataPoint) Exemplars ¶ added in v0.59.0
func (ms HistogramDataPoint) Exemplars() ExemplarSlice
Exemplars returns the Exemplars associated with this HistogramDataPoint.
func (HistogramDataPoint) ExplicitBounds ¶ added in v0.59.0
func (ms HistogramDataPoint) ExplicitBounds() pcommon.Float64Slice
ExplicitBounds returns the explicitbounds associated with this HistogramDataPoint.
func (HistogramDataPoint) Flags ¶ added in v0.59.0
func (ms HistogramDataPoint) Flags() MetricDataPointFlags
Flags returns the flags associated with this HistogramDataPoint.
func (HistogramDataPoint) FlagsImmutable
deprecated
added in
v0.59.0
func (ms HistogramDataPoint) FlagsImmutable() MetricDataPointFlags
Deprecated: [v0.60.0] use Flags.
func (HistogramDataPoint) HasMax ¶ added in v0.59.0
func (ms HistogramDataPoint) HasMax() bool
HasMax returns true if the HistogramDataPoint contains a Max value, false otherwise.
func (HistogramDataPoint) HasMin ¶ added in v0.59.0
func (ms HistogramDataPoint) HasMin() bool
HasMin returns true if the HistogramDataPoint contains a Min value, false otherwise.
func (HistogramDataPoint) HasSum ¶ added in v0.59.0
func (ms HistogramDataPoint) HasSum() bool
HasSum returns true if the HistogramDataPoint contains a Sum value, false otherwise.
func (HistogramDataPoint) Max ¶ added in v0.59.0
func (ms HistogramDataPoint) Max() float64
Max returns the max associated with this HistogramDataPoint.
func (HistogramDataPoint) Min ¶ added in v0.59.0
func (ms HistogramDataPoint) Min() float64
Min returns the min associated with this HistogramDataPoint.
func (HistogramDataPoint) MoveTo ¶ added in v0.59.0
func (ms HistogramDataPoint) MoveTo(dest HistogramDataPoint)
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (HistogramDataPoint) SetBucketCounts ¶ added in v0.59.0
func (ms HistogramDataPoint) SetBucketCounts(v pcommon.UInt64Slice)
SetBucketCounts replaces the bucketcounts associated with this HistogramDataPoint. Deprecated: [0.60.0] Use BucketCounts().FromRaw() instead
func (HistogramDataPoint) SetCount ¶ added in v0.59.0
func (ms HistogramDataPoint) SetCount(v uint64)
SetCount replaces the count associated with this HistogramDataPoint.
func (HistogramDataPoint) SetExplicitBounds ¶ added in v0.59.0
func (ms HistogramDataPoint) SetExplicitBounds(v pcommon.Float64Slice)
SetExplicitBounds replaces the explicitbounds associated with this HistogramDataPoint. Deprecated: [0.60.0] Use ExplicitBounds().FromRaw() instead
func (HistogramDataPoint) SetFlags ¶ added in v0.60.0
func (ms HistogramDataPoint) SetFlags(v MetricDataPointFlags)
SetFlags replaces the flags associated with this HistogramDataPoint.
func (HistogramDataPoint) SetFlagsImmutable
deprecated
added in
v0.59.0
func (ms HistogramDataPoint) SetFlagsImmutable(v MetricDataPointFlags)
Deprecated: [v0.60.0] use SetFlags.
func (HistogramDataPoint) SetMax ¶ added in v0.59.0
func (ms HistogramDataPoint) SetMax(v float64)
SetMax replaces the max associated with this HistogramDataPoint.
func (HistogramDataPoint) SetMin ¶ added in v0.59.0
func (ms HistogramDataPoint) SetMin(v float64)
SetMin replaces the min associated with this HistogramDataPoint.
func (HistogramDataPoint) SetStartTimestamp ¶ added in v0.59.0
func (ms HistogramDataPoint) SetStartTimestamp(v pcommon.Timestamp)
SetStartTimestamp replaces the starttimestamp associated with this HistogramDataPoint.
func (HistogramDataPoint) SetSum ¶ added in v0.59.0
func (ms HistogramDataPoint) SetSum(v float64)
SetSum replaces the sum associated with this HistogramDataPoint.
func (HistogramDataPoint) SetTimestamp ¶ added in v0.59.0
func (ms HistogramDataPoint) SetTimestamp(v pcommon.Timestamp)
SetTimestamp replaces the timestamp associated with this HistogramDataPoint.
func (HistogramDataPoint) StartTimestamp ¶ added in v0.59.0
func (ms HistogramDataPoint) StartTimestamp() pcommon.Timestamp
StartTimestamp returns the starttimestamp associated with this HistogramDataPoint.
func (HistogramDataPoint) Sum ¶ added in v0.59.0
func (ms HistogramDataPoint) Sum() float64
Sum returns the sum associated with this HistogramDataPoint.
func (HistogramDataPoint) Timestamp ¶ added in v0.59.0
func (ms HistogramDataPoint) Timestamp() pcommon.Timestamp
Timestamp returns the timestamp associated with this HistogramDataPoint.
type HistogramDataPointSlice ¶
type HistogramDataPointSlice internal.HistogramDataPointSlice
HistogramDataPointSlice logically represents a slice of HistogramDataPoint.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewHistogramDataPointSlice function to create new instances. Important: zero-initialized instance is not valid for use.
func NewHistogramDataPointSlice ¶
func NewHistogramDataPointSlice() HistogramDataPointSlice
NewHistogramDataPointSlice creates a HistogramDataPointSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
func (HistogramDataPointSlice) AppendEmpty ¶ added in v0.59.0
func (es HistogramDataPointSlice) AppendEmpty() HistogramDataPoint
AppendEmpty will append to the end of the slice an empty HistogramDataPoint. It returns the newly added HistogramDataPoint.
func (HistogramDataPointSlice) At ¶ added in v0.59.0
func (es HistogramDataPointSlice) At(ix int) HistogramDataPoint
At returns the element at the given index.
This function is used mostly for iterating over all the values in the slice:
for i := 0; i < es.Len(); i++ { e := es.At(i) ... // Do something with the element }
func (HistogramDataPointSlice) CopyTo ¶ added in v0.59.0
func (es HistogramDataPointSlice) CopyTo(dest HistogramDataPointSlice)
CopyTo copies all elements from the current slice to the dest.
func (HistogramDataPointSlice) EnsureCapacity ¶ added in v0.59.0
func (es HistogramDataPointSlice) EnsureCapacity(newCap int)
EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.
Here is how a new HistogramDataPointSlice can be initialized:
es := NewHistogramDataPointSlice() es.EnsureCapacity(4) for i := 0; i < 4; i++ { e := es.AppendEmpty() // Here should set all the values for e. }
func (HistogramDataPointSlice) Len ¶ added in v0.59.0
func (es HistogramDataPointSlice) Len() int
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewHistogramDataPointSlice()".
func (HistogramDataPointSlice) MoveAndAppendTo ¶ added in v0.59.0
func (es HistogramDataPointSlice) MoveAndAppendTo(dest HistogramDataPointSlice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (HistogramDataPointSlice) RemoveIf ¶ added in v0.59.0
func (es HistogramDataPointSlice) RemoveIf(f func(HistogramDataPoint) bool)
RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.
func (HistogramDataPointSlice) Sort ¶ added in v0.59.0
func (es HistogramDataPointSlice) Sort(less func(a, b HistogramDataPoint) bool) HistogramDataPointSlice
Sort sorts the HistogramDataPoint elements within HistogramDataPointSlice given the provided less function so that two instances of HistogramDataPointSlice can be compared.
Returns the same instance to allow nicer code like:
lessFunc := func(a, b HistogramDataPoint) bool { return a.Name() < b.Name() // choose any comparison here } assert.Equal(t, expected.Sort(lessFunc), actual.Sort(lessFunc))
type MarshalSizer ¶ added in v0.60.0
MarshalSizer is the interface that groups the basic Marshal and Size methods
func NewProtoMarshaler ¶
func NewProtoMarshaler() MarshalSizer
NewProtoMarshaler returns a MarshalSizer. Marshals to OTLP binary protobuf bytes and calculates the size of the marshaled Metrics.
type Marshaler ¶
type Marshaler interface { // MarshalMetrics the given pmetric.Metrics into bytes. // If the error is not nil, the returned bytes slice cannot be used. MarshalMetrics(md Metrics) ([]byte, error) }
Marshaler marshals pmetric.Metrics into bytes.
func NewJSONMarshaler ¶
func NewJSONMarshaler() Marshaler
NewJSONMarshaler returns a model.Marshaler. Marshals to OTLP json bytes.
type MarshalerSizer
deprecated
added in
v0.59.0
type MarshalerSizer = MarshalSizer
Deprecated: [v0.60.0] use MarshalSizer.
type Metric ¶
func NewMetric ¶
func NewMetric() Metric
NewMetric creates a new empty Metric.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (Metric) CopyTo ¶ added in v0.59.0
CopyTo copies all properties from the current struct to the dest.
func (Metric) DataType ¶ added in v0.59.0
func (ms Metric) DataType() MetricDataType
DataType returns the type of the data for this Metric. Calling this function on zero-initialized Metric will cause a panic.
func (Metric) Description ¶ added in v0.59.0
Description returns the description associated with this Metric.
func (Metric) ExponentialHistogram ¶ added in v0.59.0
func (ms Metric) ExponentialHistogram() ExponentialHistogram
ExponentialHistogram returns the exponentialhistogram associated with this Metric.
Calling this function when DataType() != MetricDataTypeExponentialHistogram returns an invalid zero-initialized instance of ExponentialHistogram. Note that using such ExponentialHistogram instance can cause panic.
Calling this function on zero-initialized Metric will cause a panic.
func (Metric) Gauge ¶ added in v0.59.0
Gauge returns the gauge associated with this Metric.
Calling this function when DataType() != MetricDataTypeGauge returns an invalid zero-initialized instance of Gauge. Note that using such Gauge instance can cause panic.
Calling this function on zero-initialized Metric will cause a panic.
func (Metric) Histogram ¶ added in v0.59.0
Histogram returns the histogram associated with this Metric.
Calling this function when DataType() != MetricDataTypeHistogram returns an invalid zero-initialized instance of Histogram. Note that using such Histogram instance can cause panic.
Calling this function on zero-initialized Metric will cause a panic.
func (Metric) MoveTo ¶ added in v0.59.0
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (Metric) SetDataType
deprecated
added in
v0.59.0
func (ms Metric) SetDataType(ty MetricDataType)
Deprecated: [v0.60.0] use one of SetEmptyGauge, SetEmptySum, SetEmptyHistogram, SetEmptyExponentialHistogram, or SetEmptySummary.
func (Metric) SetDescription ¶ added in v0.59.0
SetDescription replaces the description associated with this Metric.
func (Metric) SetEmptyExponentialHistogram ¶ added in v0.60.0
func (ms Metric) SetEmptyExponentialHistogram() ExponentialHistogram
SetEmptyExponentialHistogram sets an empty exponentialhistogram to this Metric.
After this, DataType() function will return MetricDataTypeExponentialHistogram".
Calling this function on zero-initialized Metric will cause a panic.
func (Metric) SetEmptyGauge ¶ added in v0.60.0
SetEmptyGauge sets an empty gauge to this Metric.
After this, DataType() function will return MetricDataTypeGauge".
Calling this function on zero-initialized Metric will cause a panic.
func (Metric) SetEmptyHistogram ¶ added in v0.60.0
SetEmptyHistogram sets an empty histogram to this Metric.
After this, DataType() function will return MetricDataTypeHistogram".
Calling this function on zero-initialized Metric will cause a panic.
func (Metric) SetEmptySum ¶ added in v0.60.0
SetEmptySum sets an empty sum to this Metric.
After this, DataType() function will return MetricDataTypeSum".
Calling this function on zero-initialized Metric will cause a panic.
func (Metric) SetEmptySummary ¶ added in v0.60.0
SetEmptySummary sets an empty summary to this Metric.
After this, DataType() function will return MetricDataTypeSummary".
Calling this function on zero-initialized Metric will cause a panic.
func (Metric) Sum ¶ added in v0.59.0
Sum returns the sum associated with this Metric.
Calling this function when DataType() != MetricDataTypeSum returns an invalid zero-initialized instance of Sum. Note that using such Sum instance can cause panic.
Calling this function on zero-initialized Metric will cause a panic.
func (Metric) Summary ¶ added in v0.59.0
Summary returns the summary associated with this Metric.
Calling this function when DataType() != MetricDataTypeSummary returns an invalid zero-initialized instance of Summary. Note that using such Summary instance can cause panic.
Calling this function on zero-initialized Metric will cause a panic.
type MetricAggregationTemporality ¶
type MetricAggregationTemporality int32
MetricAggregationTemporality defines how a metric aggregator reports aggregated values. It describes how those values relate to the time interval over which they are aggregated.
func (MetricAggregationTemporality) String ¶ added in v0.59.0
func (at MetricAggregationTemporality) String() string
String returns the string representation of the MetricAggregationTemporality.
type MetricDataPointFlags ¶
type MetricDataPointFlags uint32
MetricDataPointFlags defines how a metric aggregator reports aggregated values. It describes how those values relate to the time interval over which they are aggregated.
This is a temporary name, until the current MetricDataPointFlags is deprecated and removed.
func (MetricDataPointFlags) NoRecordedValue ¶ added in v0.59.0
func (ms MetricDataPointFlags) NoRecordedValue() bool
NoRecordedValue returns true if the MetricDataPointFlags contains the NoRecordedValue flag.
func (MetricDataPointFlags) WithNoRecordedValue ¶ added in v0.60.0
func (ms MetricDataPointFlags) WithNoRecordedValue(b bool) MetricDataPointFlags
WithNoRecordedValue returns a new MetricDataPointFlags, with the NoRecordedValue flag set to the given value.
type MetricDataPointFlagsImmutable
deprecated
added in
v0.59.0
type MetricDataPointFlagsImmutable = MetricDataPointFlags
Deprecated: [v0.60.0] Use MetricDataPointFlags.
type MetricDataType ¶
type MetricDataType int32
MetricDataType specifies the type of data in a Metric.
const ( MetricDataTypeNone MetricDataType = iota MetricDataTypeGauge MetricDataTypeSum MetricDataTypeHistogram MetricDataTypeExponentialHistogram MetricDataTypeSummary )
func (MetricDataType) String ¶ added in v0.59.0
func (mdt MetricDataType) String() string
String returns the string representation of the MetricDataType.
type MetricSlice ¶
type MetricSlice internal.MetricSlice
MetricSlice logically represents a slice of Metric.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewMetricSlice function to create new instances. Important: zero-initialized instance is not valid for use.
func NewMetricSlice ¶
func NewMetricSlice() MetricSlice
NewMetricSlice creates a MetricSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
func (MetricSlice) AppendEmpty ¶ added in v0.59.0
func (es MetricSlice) AppendEmpty() Metric
AppendEmpty will append to the end of the slice an empty Metric. It returns the newly added Metric.
func (MetricSlice) At ¶ added in v0.59.0
func (es MetricSlice) At(ix int) Metric
At returns the element at the given index.
This function is used mostly for iterating over all the values in the slice:
for i := 0; i < es.Len(); i++ { e := es.At(i) ... // Do something with the element }
func (MetricSlice) CopyTo ¶ added in v0.59.0
func (es MetricSlice) CopyTo(dest MetricSlice)
CopyTo copies all elements from the current slice to the dest.
func (MetricSlice) EnsureCapacity ¶ added in v0.59.0
func (es MetricSlice) EnsureCapacity(newCap int)
EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.
Here is how a new MetricSlice can be initialized:
es := NewMetricSlice() es.EnsureCapacity(4) for i := 0; i < 4; i++ { e := es.AppendEmpty() // Here should set all the values for e. }
func (MetricSlice) Len ¶ added in v0.59.0
func (es MetricSlice) Len() int
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewMetricSlice()".
func (MetricSlice) MoveAndAppendTo ¶ added in v0.59.0
func (es MetricSlice) MoveAndAppendTo(dest MetricSlice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (MetricSlice) RemoveIf ¶ added in v0.59.0
func (es MetricSlice) RemoveIf(f func(Metric) bool)
RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.
func (MetricSlice) Sort ¶ added in v0.59.0
func (es MetricSlice) Sort(less func(a, b Metric) bool) MetricSlice
Sort sorts the Metric elements within MetricSlice given the provided less function so that two instances of MetricSlice can be compared.
Returns the same instance to allow nicer code like:
lessFunc := func(a, b Metric) bool { return a.Name() < b.Name() // choose any comparison here } assert.Equal(t, expected.Sort(lessFunc), actual.Sort(lessFunc))
type Metrics ¶
Metrics is the top-level struct that is propagated through the metrics pipeline. Use NewMetrics to create new instance, zero-initialized instance is not valid for use.
func (Metrics) DataPointCount ¶ added in v0.59.0
DataPointCount calculates the total number of data points.
func (Metrics) MetricCount ¶ added in v0.59.0
MetricCount calculates the total number of metrics.
func (Metrics) MoveTo ¶ added in v0.59.0
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value.
func (Metrics) ResourceMetrics ¶ added in v0.59.0
func (ms Metrics) ResourceMetrics() ResourceMetricsSlice
ResourceMetrics returns the ResourceMetricsSlice associated with this Metrics.
type NumberDataPoint ¶
type NumberDataPoint internal.NumberDataPoint
func NewNumberDataPoint ¶
func NewNumberDataPoint() NumberDataPoint
NewNumberDataPoint creates a new empty NumberDataPoint.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (NumberDataPoint) Attributes ¶ added in v0.59.0
func (ms NumberDataPoint) Attributes() pcommon.Map
Attributes returns the Attributes associated with this NumberDataPoint.
func (NumberDataPoint) CopyTo ¶ added in v0.59.0
func (ms NumberDataPoint) CopyTo(dest NumberDataPoint)
CopyTo copies all properties from the current struct to the dest.
func (NumberDataPoint) DoubleVal ¶ added in v0.59.0
func (ms NumberDataPoint) DoubleVal() float64
DoubleVal returns the doubleval associated with this NumberDataPoint.
func (NumberDataPoint) Exemplars ¶ added in v0.59.0
func (ms NumberDataPoint) Exemplars() ExemplarSlice
Exemplars returns the Exemplars associated with this NumberDataPoint.
func (NumberDataPoint) Flags ¶ added in v0.59.0
func (ms NumberDataPoint) Flags() MetricDataPointFlags
Flags returns the flags associated with this NumberDataPoint.
func (NumberDataPoint) FlagsImmutable
deprecated
added in
v0.59.0
func (ms NumberDataPoint) FlagsImmutable() MetricDataPointFlags
Deprecated: [v0.60.0] use Flags.
func (NumberDataPoint) IntVal ¶ added in v0.59.0
func (ms NumberDataPoint) IntVal() int64
IntVal returns the intval associated with this NumberDataPoint.
func (NumberDataPoint) MoveTo ¶ added in v0.59.0
func (ms NumberDataPoint) MoveTo(dest NumberDataPoint)
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (NumberDataPoint) SetDoubleVal ¶ added in v0.59.0
func (ms NumberDataPoint) SetDoubleVal(v float64)
SetDoubleVal replaces the doubleval associated with this NumberDataPoint.
func (NumberDataPoint) SetFlags ¶ added in v0.60.0
func (ms NumberDataPoint) SetFlags(v MetricDataPointFlags)
SetFlags replaces the flags associated with this NumberDataPoint.
func (NumberDataPoint) SetFlagsImmutable
deprecated
added in
v0.59.0
func (ms NumberDataPoint) SetFlagsImmutable(v MetricDataPointFlags)
Deprecated: [v0.60.0] use SetFlags.
func (NumberDataPoint) SetIntVal ¶ added in v0.59.0
func (ms NumberDataPoint) SetIntVal(v int64)
SetIntVal replaces the intval associated with this NumberDataPoint.
func (NumberDataPoint) SetStartTimestamp ¶ added in v0.59.0
func (ms NumberDataPoint) SetStartTimestamp(v pcommon.Timestamp)
SetStartTimestamp replaces the starttimestamp associated with this NumberDataPoint.
func (NumberDataPoint) SetTimestamp ¶ added in v0.59.0
func (ms NumberDataPoint) SetTimestamp(v pcommon.Timestamp)
SetTimestamp replaces the timestamp associated with this NumberDataPoint.
func (NumberDataPoint) StartTimestamp ¶ added in v0.59.0
func (ms NumberDataPoint) StartTimestamp() pcommon.Timestamp
StartTimestamp returns the starttimestamp associated with this NumberDataPoint.
func (NumberDataPoint) Timestamp ¶ added in v0.59.0
func (ms NumberDataPoint) Timestamp() pcommon.Timestamp
Timestamp returns the timestamp associated with this NumberDataPoint.
func (NumberDataPoint) ValueType ¶ added in v0.59.0
func (ms NumberDataPoint) ValueType() NumberDataPointValueType
ValueType returns the type of the value for this NumberDataPoint. Calling this function on zero-initialized NumberDataPoint will cause a panic.
type NumberDataPointSlice ¶
type NumberDataPointSlice internal.NumberDataPointSlice
NumberDataPointSlice logically represents a slice of NumberDataPoint.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewNumberDataPointSlice function to create new instances. Important: zero-initialized instance is not valid for use.
func NewNumberDataPointSlice ¶
func NewNumberDataPointSlice() NumberDataPointSlice
NewNumberDataPointSlice creates a NumberDataPointSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
func (NumberDataPointSlice) AppendEmpty ¶ added in v0.59.0
func (es NumberDataPointSlice) AppendEmpty() NumberDataPoint
AppendEmpty will append to the end of the slice an empty NumberDataPoint. It returns the newly added NumberDataPoint.
func (NumberDataPointSlice) At ¶ added in v0.59.0
func (es NumberDataPointSlice) At(ix int) NumberDataPoint
At returns the element at the given index.
This function is used mostly for iterating over all the values in the slice:
for i := 0; i < es.Len(); i++ { e := es.At(i) ... // Do something with the element }
func (NumberDataPointSlice) CopyTo ¶ added in v0.59.0
func (es NumberDataPointSlice) CopyTo(dest NumberDataPointSlice)
CopyTo copies all elements from the current slice to the dest.
func (NumberDataPointSlice) EnsureCapacity ¶ added in v0.59.0
func (es NumberDataPointSlice) EnsureCapacity(newCap int)
EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.
Here is how a new NumberDataPointSlice can be initialized:
es := NewNumberDataPointSlice() es.EnsureCapacity(4) for i := 0; i < 4; i++ { e := es.AppendEmpty() // Here should set all the values for e. }
func (NumberDataPointSlice) Len ¶ added in v0.59.0
func (es NumberDataPointSlice) Len() int
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewNumberDataPointSlice()".
func (NumberDataPointSlice) MoveAndAppendTo ¶ added in v0.59.0
func (es NumberDataPointSlice) MoveAndAppendTo(dest NumberDataPointSlice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (NumberDataPointSlice) RemoveIf ¶ added in v0.59.0
func (es NumberDataPointSlice) RemoveIf(f func(NumberDataPoint) bool)
RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.
func (NumberDataPointSlice) Sort ¶ added in v0.59.0
func (es NumberDataPointSlice) Sort(less func(a, b NumberDataPoint) bool) NumberDataPointSlice
Sort sorts the NumberDataPoint elements within NumberDataPointSlice given the provided less function so that two instances of NumberDataPointSlice can be compared.
Returns the same instance to allow nicer code like:
lessFunc := func(a, b NumberDataPoint) bool { return a.Name() < b.Name() // choose any comparison here } assert.Equal(t, expected.Sort(lessFunc), actual.Sort(lessFunc))
type NumberDataPointValueType ¶ added in v0.50.0
type NumberDataPointValueType int32
NumberDataPointValueType specifies the type of NumberDataPoint value.
const ( NumberDataPointValueTypeNone NumberDataPointValueType = iota NumberDataPointValueTypeInt NumberDataPointValueTypeDouble )
func (NumberDataPointValueType) String ¶ added in v0.59.0
func (nt NumberDataPointValueType) String() string
String returns the string representation of the NumberDataPointValueType.
type OptionalType ¶ added in v0.59.0
type OptionalType int32
OptionalType wraps optional fields into oneof fields
const ( OptionalTypeNone OptionalType = iota OptionalTypeDouble )
func (OptionalType) String ¶ added in v0.59.0
func (ot OptionalType) String() string
String returns the string representation of the OptionalType.
type ResourceMetrics ¶
type ResourceMetrics internal.ResourceMetrics
func NewResourceMetrics ¶
func NewResourceMetrics() ResourceMetrics
NewResourceMetrics creates a new empty ResourceMetrics.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (ResourceMetrics) CopyTo ¶ added in v0.59.0
func (ms ResourceMetrics) CopyTo(dest ResourceMetrics)
CopyTo copies all properties from the current struct to the dest.
func (ResourceMetrics) MoveTo ¶ added in v0.59.0
func (ms ResourceMetrics) MoveTo(dest ResourceMetrics)
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (ResourceMetrics) Resource ¶ added in v0.59.0
func (ms ResourceMetrics) Resource() pcommon.Resource
Resource returns the resource associated with this ResourceMetrics.
func (ResourceMetrics) SchemaUrl ¶ added in v0.59.0
func (ms ResourceMetrics) SchemaUrl() string
SchemaUrl returns the schemaurl associated with this ResourceMetrics.
func (ResourceMetrics) ScopeMetrics ¶ added in v0.59.0
func (ms ResourceMetrics) ScopeMetrics() ScopeMetricsSlice
ScopeMetrics returns the ScopeMetrics associated with this ResourceMetrics.
func (ResourceMetrics) SetSchemaUrl ¶ added in v0.59.0
func (ms ResourceMetrics) SetSchemaUrl(v string)
SetSchemaUrl replaces the schemaurl associated with this ResourceMetrics.
type ResourceMetricsSlice ¶
type ResourceMetricsSlice internal.ResourceMetricsSlice
ResourceMetricsSlice logically represents a slice of ResourceMetrics.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewResourceMetricsSlice function to create new instances. Important: zero-initialized instance is not valid for use.
func NewResourceMetricsSlice ¶
func NewResourceMetricsSlice() ResourceMetricsSlice
NewResourceMetricsSlice creates a ResourceMetricsSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
func (ResourceMetricsSlice) AppendEmpty ¶ added in v0.59.0
func (es ResourceMetricsSlice) AppendEmpty() ResourceMetrics
AppendEmpty will append to the end of the slice an empty ResourceMetrics. It returns the newly added ResourceMetrics.
func (ResourceMetricsSlice) At ¶ added in v0.59.0
func (es ResourceMetricsSlice) At(ix int) ResourceMetrics
At returns the element at the given index.
This function is used mostly for iterating over all the values in the slice:
for i := 0; i < es.Len(); i++ { e := es.At(i) ... // Do something with the element }
func (ResourceMetricsSlice) CopyTo ¶ added in v0.59.0
func (es ResourceMetricsSlice) CopyTo(dest ResourceMetricsSlice)
CopyTo copies all elements from the current slice to the dest.
func (ResourceMetricsSlice) EnsureCapacity ¶ added in v0.59.0
func (es ResourceMetricsSlice) EnsureCapacity(newCap int)
EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.
Here is how a new ResourceMetricsSlice can be initialized:
es := NewResourceMetricsSlice() es.EnsureCapacity(4) for i := 0; i < 4; i++ { e := es.AppendEmpty() // Here should set all the values for e. }
func (ResourceMetricsSlice) Len ¶ added in v0.59.0
func (es ResourceMetricsSlice) Len() int
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewResourceMetricsSlice()".
func (ResourceMetricsSlice) MoveAndAppendTo ¶ added in v0.59.0
func (es ResourceMetricsSlice) MoveAndAppendTo(dest ResourceMetricsSlice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (ResourceMetricsSlice) RemoveIf ¶ added in v0.59.0
func (es ResourceMetricsSlice) RemoveIf(f func(ResourceMetrics) bool)
RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.
func (ResourceMetricsSlice) Sort ¶ added in v0.59.0
func (es ResourceMetricsSlice) Sort(less func(a, b ResourceMetrics) bool) ResourceMetricsSlice
Sort sorts the ResourceMetrics elements within ResourceMetricsSlice given the provided less function so that two instances of ResourceMetricsSlice can be compared.
Returns the same instance to allow nicer code like:
lessFunc := func(a, b ResourceMetrics) bool { return a.Name() < b.Name() // choose any comparison here } assert.Equal(t, expected.Sort(lessFunc), actual.Sort(lessFunc))
type ScopeMetrics ¶
type ScopeMetrics internal.ScopeMetrics
func NewScopeMetrics ¶
func NewScopeMetrics() ScopeMetrics
NewScopeMetrics creates a new empty ScopeMetrics.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (ScopeMetrics) CopyTo ¶ added in v0.59.0
func (ms ScopeMetrics) CopyTo(dest ScopeMetrics)
CopyTo copies all properties from the current struct to the dest.
func (ScopeMetrics) Metrics ¶ added in v0.59.0
func (ms ScopeMetrics) Metrics() MetricSlice
Metrics returns the Metrics associated with this ScopeMetrics.
func (ScopeMetrics) MoveTo ¶ added in v0.59.0
func (ms ScopeMetrics) MoveTo(dest ScopeMetrics)
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (ScopeMetrics) SchemaUrl ¶ added in v0.59.0
func (ms ScopeMetrics) SchemaUrl() string
SchemaUrl returns the schemaurl associated with this ScopeMetrics.
func (ScopeMetrics) Scope ¶ added in v0.59.0
func (ms ScopeMetrics) Scope() pcommon.InstrumentationScope
Scope returns the scope associated with this ScopeMetrics.
func (ScopeMetrics) SetSchemaUrl ¶ added in v0.59.0
func (ms ScopeMetrics) SetSchemaUrl(v string)
SetSchemaUrl replaces the schemaurl associated with this ScopeMetrics.
type ScopeMetricsSlice ¶
type ScopeMetricsSlice internal.ScopeMetricsSlice
ScopeMetricsSlice logically represents a slice of ScopeMetrics.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewScopeMetricsSlice function to create new instances. Important: zero-initialized instance is not valid for use.
func NewScopeMetricsSlice ¶
func NewScopeMetricsSlice() ScopeMetricsSlice
NewScopeMetricsSlice creates a ScopeMetricsSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
func (ScopeMetricsSlice) AppendEmpty ¶ added in v0.59.0
func (es ScopeMetricsSlice) AppendEmpty() ScopeMetrics
AppendEmpty will append to the end of the slice an empty ScopeMetrics. It returns the newly added ScopeMetrics.
func (ScopeMetricsSlice) At ¶ added in v0.59.0
func (es ScopeMetricsSlice) At(ix int) ScopeMetrics
At returns the element at the given index.
This function is used mostly for iterating over all the values in the slice:
for i := 0; i < es.Len(); i++ { e := es.At(i) ... // Do something with the element }
func (ScopeMetricsSlice) CopyTo ¶ added in v0.59.0
func (es ScopeMetricsSlice) CopyTo(dest ScopeMetricsSlice)
CopyTo copies all elements from the current slice to the dest.
func (ScopeMetricsSlice) EnsureCapacity ¶ added in v0.59.0
func (es ScopeMetricsSlice) EnsureCapacity(newCap int)
EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.
Here is how a new ScopeMetricsSlice can be initialized:
es := NewScopeMetricsSlice() es.EnsureCapacity(4) for i := 0; i < 4; i++ { e := es.AppendEmpty() // Here should set all the values for e. }
func (ScopeMetricsSlice) Len ¶ added in v0.59.0
func (es ScopeMetricsSlice) Len() int
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewScopeMetricsSlice()".
func (ScopeMetricsSlice) MoveAndAppendTo ¶ added in v0.59.0
func (es ScopeMetricsSlice) MoveAndAppendTo(dest ScopeMetricsSlice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (ScopeMetricsSlice) RemoveIf ¶ added in v0.59.0
func (es ScopeMetricsSlice) RemoveIf(f func(ScopeMetrics) bool)
RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.
func (ScopeMetricsSlice) Sort ¶ added in v0.59.0
func (es ScopeMetricsSlice) Sort(less func(a, b ScopeMetrics) bool) ScopeMetricsSlice
Sort sorts the ScopeMetrics elements within ScopeMetricsSlice given the provided less function so that two instances of ScopeMetricsSlice can be compared.
Returns the same instance to allow nicer code like:
lessFunc := func(a, b ScopeMetrics) bool { return a.Name() < b.Name() // choose any comparison here } assert.Equal(t, expected.Sort(lessFunc), actual.Sort(lessFunc))
type Sizer ¶
type Sizer interface { // MetricsSize returns the size in bytes of a marshaled Metrics. MetricsSize(md Metrics) int }
Sizer is an optional interface implemented by the Marshaler, that calculates the size of a marshaled Metrics.
type Sum ¶
func NewSum ¶
func NewSum() Sum
NewSum creates a new empty Sum.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (Sum) AggregationTemporality ¶ added in v0.59.0
func (ms Sum) AggregationTemporality() MetricAggregationTemporality
AggregationTemporality returns the aggregationtemporality associated with this Sum.
func (Sum) CopyTo ¶ added in v0.59.0
CopyTo copies all properties from the current struct to the dest.
func (Sum) DataPoints ¶ added in v0.59.0
func (ms Sum) DataPoints() NumberDataPointSlice
DataPoints returns the DataPoints associated with this Sum.
func (Sum) IsMonotonic ¶ added in v0.59.0
IsMonotonic returns the ismonotonic associated with this Sum.
func (Sum) MoveTo ¶ added in v0.59.0
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (Sum) SetAggregationTemporality ¶ added in v0.59.0
func (ms Sum) SetAggregationTemporality(v MetricAggregationTemporality)
SetAggregationTemporality replaces the aggregationtemporality associated with this Sum.
func (Sum) SetIsMonotonic ¶ added in v0.59.0
SetIsMonotonic replaces the ismonotonic associated with this Sum.
type Summary ¶
func NewSummary ¶
func NewSummary() Summary
NewSummary creates a new empty Summary.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (Summary) CopyTo ¶ added in v0.59.0
CopyTo copies all properties from the current struct to the dest.
func (Summary) DataPoints ¶ added in v0.59.0
func (ms Summary) DataPoints() SummaryDataPointSlice
DataPoints returns the DataPoints associated with this Summary.
type SummaryDataPoint ¶
type SummaryDataPoint internal.SummaryDataPoint
func NewSummaryDataPoint ¶
func NewSummaryDataPoint() SummaryDataPoint
NewSummaryDataPoint creates a new empty SummaryDataPoint.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (SummaryDataPoint) Attributes ¶ added in v0.59.0
func (ms SummaryDataPoint) Attributes() pcommon.Map
Attributes returns the Attributes associated with this SummaryDataPoint.
func (SummaryDataPoint) CopyTo ¶ added in v0.59.0
func (ms SummaryDataPoint) CopyTo(dest SummaryDataPoint)
CopyTo copies all properties from the current struct to the dest.
func (SummaryDataPoint) Count ¶ added in v0.59.0
func (ms SummaryDataPoint) Count() uint64
Count returns the count associated with this SummaryDataPoint.
func (SummaryDataPoint) Flags ¶ added in v0.59.0
func (ms SummaryDataPoint) Flags() MetricDataPointFlags
Flags returns the flags associated with this SummaryDataPoint.
func (SummaryDataPoint) FlagsImmutable
deprecated
added in
v0.59.0
func (ms SummaryDataPoint) FlagsImmutable() MetricDataPointFlags
Deprecated: [v0.60.0] use Flags.
func (SummaryDataPoint) MoveTo ¶ added in v0.59.0
func (ms SummaryDataPoint) MoveTo(dest SummaryDataPoint)
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (SummaryDataPoint) QuantileValues ¶ added in v0.59.0
func (ms SummaryDataPoint) QuantileValues() ValueAtQuantileSlice
QuantileValues returns the QuantileValues associated with this SummaryDataPoint.
func (SummaryDataPoint) SetCount ¶ added in v0.59.0
func (ms SummaryDataPoint) SetCount(v uint64)
SetCount replaces the count associated with this SummaryDataPoint.
func (SummaryDataPoint) SetFlags ¶ added in v0.60.0
func (ms SummaryDataPoint) SetFlags(v MetricDataPointFlags)
SetFlags replaces the flags associated with this SummaryDataPoint.
func (SummaryDataPoint) SetFlagsImmutable
deprecated
added in
v0.59.0
func (ms SummaryDataPoint) SetFlagsImmutable(v MetricDataPointFlags)
Deprecated: [v0.60.0] use SetFlags.
func (SummaryDataPoint) SetStartTimestamp ¶ added in v0.59.0
func (ms SummaryDataPoint) SetStartTimestamp(v pcommon.Timestamp)
SetStartTimestamp replaces the starttimestamp associated with this SummaryDataPoint.
func (SummaryDataPoint) SetSum ¶ added in v0.59.0
func (ms SummaryDataPoint) SetSum(v float64)
SetSum replaces the sum associated with this SummaryDataPoint.
func (SummaryDataPoint) SetTimestamp ¶ added in v0.59.0
func (ms SummaryDataPoint) SetTimestamp(v pcommon.Timestamp)
SetTimestamp replaces the timestamp associated with this SummaryDataPoint.
func (SummaryDataPoint) StartTimestamp ¶ added in v0.59.0
func (ms SummaryDataPoint) StartTimestamp() pcommon.Timestamp
StartTimestamp returns the starttimestamp associated with this SummaryDataPoint.
func (SummaryDataPoint) Sum ¶ added in v0.59.0
func (ms SummaryDataPoint) Sum() float64
Sum returns the sum associated with this SummaryDataPoint.
func (SummaryDataPoint) Timestamp ¶ added in v0.59.0
func (ms SummaryDataPoint) Timestamp() pcommon.Timestamp
Timestamp returns the timestamp associated with this SummaryDataPoint.
type SummaryDataPointSlice ¶
type SummaryDataPointSlice internal.SummaryDataPointSlice
SummaryDataPointSlice logically represents a slice of SummaryDataPoint.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewSummaryDataPointSlice function to create new instances. Important: zero-initialized instance is not valid for use.
func NewSummaryDataPointSlice ¶
func NewSummaryDataPointSlice() SummaryDataPointSlice
NewSummaryDataPointSlice creates a SummaryDataPointSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
func (SummaryDataPointSlice) AppendEmpty ¶ added in v0.59.0
func (es SummaryDataPointSlice) AppendEmpty() SummaryDataPoint
AppendEmpty will append to the end of the slice an empty SummaryDataPoint. It returns the newly added SummaryDataPoint.
func (SummaryDataPointSlice) At ¶ added in v0.59.0
func (es SummaryDataPointSlice) At(ix int) SummaryDataPoint
At returns the element at the given index.
This function is used mostly for iterating over all the values in the slice:
for i := 0; i < es.Len(); i++ { e := es.At(i) ... // Do something with the element }
func (SummaryDataPointSlice) CopyTo ¶ added in v0.59.0
func (es SummaryDataPointSlice) CopyTo(dest SummaryDataPointSlice)
CopyTo copies all elements from the current slice to the dest.
func (SummaryDataPointSlice) EnsureCapacity ¶ added in v0.59.0
func (es SummaryDataPointSlice) EnsureCapacity(newCap int)
EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.
Here is how a new SummaryDataPointSlice can be initialized:
es := NewSummaryDataPointSlice() es.EnsureCapacity(4) for i := 0; i < 4; i++ { e := es.AppendEmpty() // Here should set all the values for e. }
func (SummaryDataPointSlice) Len ¶ added in v0.59.0
func (es SummaryDataPointSlice) Len() int
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewSummaryDataPointSlice()".
func (SummaryDataPointSlice) MoveAndAppendTo ¶ added in v0.59.0
func (es SummaryDataPointSlice) MoveAndAppendTo(dest SummaryDataPointSlice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (SummaryDataPointSlice) RemoveIf ¶ added in v0.59.0
func (es SummaryDataPointSlice) RemoveIf(f func(SummaryDataPoint) bool)
RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.
func (SummaryDataPointSlice) Sort ¶ added in v0.59.0
func (es SummaryDataPointSlice) Sort(less func(a, b SummaryDataPoint) bool) SummaryDataPointSlice
Sort sorts the SummaryDataPoint elements within SummaryDataPointSlice given the provided less function so that two instances of SummaryDataPointSlice can be compared.
Returns the same instance to allow nicer code like:
lessFunc := func(a, b SummaryDataPoint) bool { return a.Name() < b.Name() // choose any comparison here } assert.Equal(t, expected.Sort(lessFunc), actual.Sort(lessFunc))
type Unmarshaler ¶
type Unmarshaler interface { // UnmarshalMetrics the given bytes into pmetric.Metrics. // If the error is not nil, the returned pmetric.Metrics cannot be used. UnmarshalMetrics(buf []byte) (Metrics, error) }
Unmarshaler unmarshalls bytes into pmetric.Metrics.
func NewJSONUnmarshaler ¶
func NewJSONUnmarshaler() Unmarshaler
NewJSONUnmarshaler returns a model.Unmarshaler. Unmarshals from OTLP json bytes.
func NewProtoUnmarshaler ¶
func NewProtoUnmarshaler() Unmarshaler
NewProtoUnmarshaler returns a model.Unmarshaler. Unmarshals from OTLP binary protobuf bytes.
type ValueAtQuantile ¶
type ValueAtQuantile internal.ValueAtQuantile
func NewValueAtQuantile ¶
func NewValueAtQuantile() ValueAtQuantile
NewValueAtQuantile creates a new empty ValueAtQuantile.
This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.
func (ValueAtQuantile) CopyTo ¶ added in v0.59.0
func (ms ValueAtQuantile) CopyTo(dest ValueAtQuantile)
CopyTo copies all properties from the current struct to the dest.
func (ValueAtQuantile) MoveTo ¶ added in v0.59.0
func (ms ValueAtQuantile) MoveTo(dest ValueAtQuantile)
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (ValueAtQuantile) Quantile ¶ added in v0.59.0
func (ms ValueAtQuantile) Quantile() float64
Quantile returns the quantile associated with this ValueAtQuantile.
func (ValueAtQuantile) SetQuantile ¶ added in v0.59.0
func (ms ValueAtQuantile) SetQuantile(v float64)
SetQuantile replaces the quantile associated with this ValueAtQuantile.
func (ValueAtQuantile) SetValue ¶ added in v0.59.0
func (ms ValueAtQuantile) SetValue(v float64)
SetValue replaces the value associated with this ValueAtQuantile.
func (ValueAtQuantile) Value ¶ added in v0.59.0
func (ms ValueAtQuantile) Value() float64
Value returns the value associated with this ValueAtQuantile.
type ValueAtQuantileSlice ¶
type ValueAtQuantileSlice internal.ValueAtQuantileSlice
ValueAtQuantileSlice logically represents a slice of ValueAtQuantile.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewValueAtQuantileSlice function to create new instances. Important: zero-initialized instance is not valid for use.
func NewValueAtQuantileSlice ¶
func NewValueAtQuantileSlice() ValueAtQuantileSlice
NewValueAtQuantileSlice creates a ValueAtQuantileSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
func (ValueAtQuantileSlice) AppendEmpty ¶ added in v0.59.0
func (es ValueAtQuantileSlice) AppendEmpty() ValueAtQuantile
AppendEmpty will append to the end of the slice an empty ValueAtQuantile. It returns the newly added ValueAtQuantile.
func (ValueAtQuantileSlice) At ¶ added in v0.59.0
func (es ValueAtQuantileSlice) At(ix int) ValueAtQuantile
At returns the element at the given index.
This function is used mostly for iterating over all the values in the slice:
for i := 0; i < es.Len(); i++ { e := es.At(i) ... // Do something with the element }
func (ValueAtQuantileSlice) CopyTo ¶ added in v0.59.0
func (es ValueAtQuantileSlice) CopyTo(dest ValueAtQuantileSlice)
CopyTo copies all elements from the current slice to the dest.
func (ValueAtQuantileSlice) EnsureCapacity ¶ added in v0.59.0
func (es ValueAtQuantileSlice) EnsureCapacity(newCap int)
EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.
Here is how a new ValueAtQuantileSlice can be initialized:
es := NewValueAtQuantileSlice() es.EnsureCapacity(4) for i := 0; i < 4; i++ { e := es.AppendEmpty() // Here should set all the values for e. }
func (ValueAtQuantileSlice) Len ¶ added in v0.59.0
func (es ValueAtQuantileSlice) Len() int
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewValueAtQuantileSlice()".
func (ValueAtQuantileSlice) MoveAndAppendTo ¶ added in v0.59.0
func (es ValueAtQuantileSlice) MoveAndAppendTo(dest ValueAtQuantileSlice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (ValueAtQuantileSlice) RemoveIf ¶ added in v0.59.0
func (es ValueAtQuantileSlice) RemoveIf(f func(ValueAtQuantile) bool)
RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.
func (ValueAtQuantileSlice) Sort ¶ added in v0.59.0
func (es ValueAtQuantileSlice) Sort(less func(a, b ValueAtQuantile) bool) ValueAtQuantileSlice
Sort sorts the ValueAtQuantile elements within ValueAtQuantileSlice given the provided less function so that two instances of ValueAtQuantileSlice can be compared.
Returns the same instance to allow nicer code like:
lessFunc := func(a, b ValueAtQuantile) bool { return a.Name() < b.Name() // choose any comparison here } assert.Equal(t, expected.Sort(lessFunc), actual.Sort(lessFunc))