package aggregatortest
import "go.opentelemetry.io/otel/sdk/metric/aggregator/aggregatortest"
Index ¶
- Constants
- func CheckedMerge(t *testing.T, aggInto, aggFrom aggregator.Aggregator, descriptor *sdkapi.Descriptor)
- func CheckedUpdate(t *testing.T, agg aggregator.Aggregator, n number.Number, descriptor *sdkapi.Descriptor)
- func NewAggregatorTest(mkind sdkapi.InstrumentKind, nkind number.Kind) *sdkapi.Descriptor
- func RunProfiles(t *testing.T, f func(*testing.T, Profile))
- func SynchronizedMoveResetTest(t *testing.T, mkind sdkapi.InstrumentKind, nf func(*sdkapi.Descriptor) aggregator.Aggregator)
- func TestMain(m *testing.M)
- type NoopAggregation
- type NoopAggregator
- func (NoopAggregator) Aggregation() aggregation.Aggregation
- func (NoopAggregator) Merge(aggregator.Aggregator, *sdkapi.Descriptor) error
- func (NoopAggregator) SynchronizedMove(aggregator.Aggregator, *sdkapi.Descriptor) error
- func (NoopAggregator) Update(context.Context, number.Number, *sdkapi.Descriptor) error
- type Numbers
- func NewNumbers(kind number.Kind) Numbers
- func (n *Numbers) Append(v number.Number)
- func (n *Numbers) Count() uint64
- func (n *Numbers) Len() int
- func (n *Numbers) Less(i, j int) bool
- func (n *Numbers) Max() number.Number
- func (n *Numbers) Min() number.Number
- func (n *Numbers) Points() []number.Number
- func (n *Numbers) Sort()
- func (n *Numbers) Sum() number.Number
- func (n *Numbers) Swap(i, j int)
- type Profile
Constants ¶
const Magnitude = 1000
Magnitude is the upper-bound of random numbers used in profile tests.
Functions ¶
func CheckedMerge ¶
func CheckedMerge(t *testing.T, aggInto, aggFrom aggregator.Aggregator, descriptor *sdkapi.Descriptor)
CheckedMerge verifies aggFrom merges into aggInto with the scope of descriptor.
func CheckedUpdate ¶
func CheckedUpdate(t *testing.T, agg aggregator.Aggregator, n number.Number, descriptor *sdkapi.Descriptor)
CheckedUpdate performs the same range test the SDK does on behalf of the aggregator.
func NewAggregatorTest ¶
func NewAggregatorTest(mkind sdkapi.InstrumentKind, nkind number.Kind) *sdkapi.Descriptor
NewAggregatorTest returns a descriptor for mkind and nkind.
func RunProfiles ¶
RunProfiles runs all test profile against the factory function f.
func SynchronizedMoveResetTest ¶
func SynchronizedMoveResetTest(t *testing.T, mkind sdkapi.InstrumentKind, nf func(*sdkapi.Descriptor) aggregator.Aggregator)
SynchronizedMoveResetTest tests SynchronizedMove behavior for an aggregator during resets.
func TestMain ¶
TestMain ensures local struct alignment prior to running tests.
Types ¶
type NoopAggregation ¶
type NoopAggregation struct{}
NoopAggregation is an aggregation that performs no operations.
func (NoopAggregation) Kind ¶
func (NoopAggregation) Kind() aggregation.Kind
Kind returns a Noop aggregation Kind.
type NoopAggregator ¶
type NoopAggregator struct{}
NoopAggregator is an aggregator that performs no operations.
func (NoopAggregator) Aggregation ¶
func (NoopAggregator) Aggregation() aggregation.Aggregation
Aggregation returns a NoopAggregation.
func (NoopAggregator) Merge ¶
func (NoopAggregator) Merge(aggregator.Aggregator, *sdkapi.Descriptor) error
Merge performs no operation.
func (NoopAggregator) SynchronizedMove ¶
func (NoopAggregator) SynchronizedMove(aggregator.Aggregator, *sdkapi.Descriptor) error
SynchronizedMove performs no operation.
func (NoopAggregator) Update ¶
func (NoopAggregator) Update(context.Context, number.Number, *sdkapi.Descriptor) error
Update performs no operation.
type Numbers ¶
type Numbers struct {
// contains filtered or unexported fields
}
Numbers are a collection of measured data point values.
func NewNumbers ¶
NewNumbers returns a new Numbers for the passed kind.
func (*Numbers) Append ¶
Append appends v to the numbers n.
func (*Numbers) Count ¶
Count returns the number of data points Numbers contains.
func (*Numbers) Len ¶
Len returns number of data points Numbers contains.
func (*Numbers) Less ¶
Less returns if the number at index i is less than the number at index j.
func (*Numbers) Max ¶
Max returns the max number.
func (*Numbers) Min ¶
Min returns the min number.
func (*Numbers) Points ¶
Points returns the slice of number for all data points.
func (*Numbers) Sort ¶
func (n *Numbers) Sort()
Sort sorts all the numbers contained in n.
func (*Numbers) Sum ¶
Sum returns the sum of all data points.
func (*Numbers) Swap ¶
Swap swaps the location of the numbers at index i and j.
type Profile ¶
Profile is an aggregator test profile.
Source Files ¶
test.go
- Version
- v0.31.0
- Published
- Jul 8, 2022
- Platform
- linux/amd64
- Imports
- 13 packages
- Last checked
- 9 minutes ago –
Tools for package owners.