You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-07-13 01:00:22 +02:00
Metric Accumulator fix for SumObservers (#1381)
* Let SynchronizedMove(nil) reset and discard * Add common test for SynchronizedMove(nil) * End-to-end test for the Processor and SumObserver * Implement SynchronizedMove(nil) six ways * Lint * Changelog * Test no reset for wrong aggregator type; Fix four Aggregators * Cleanup * imports Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
@ -24,6 +24,7 @@ import (
|
||||
|
||||
"go.opentelemetry.io/otel/metric"
|
||||
"go.opentelemetry.io/otel/metric/number"
|
||||
export "go.opentelemetry.io/otel/sdk/export/metric"
|
||||
"go.opentelemetry.io/otel/sdk/export/metric/aggregation"
|
||||
"go.opentelemetry.io/otel/sdk/metric/aggregator/aggregatortest"
|
||||
)
|
||||
@ -329,3 +330,13 @@ func TestArrayFloat64(t *testing.T) {
|
||||
require.Equal(t, all.Points()[i], po[i], "Wrong point at position %d", i)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSynchronizedMoveReset(t *testing.T) {
|
||||
aggregatortest.SynchronizedMoveResetTest(
|
||||
t,
|
||||
metric.ValueRecorderInstrumentKind,
|
||||
func(desc *metric.Descriptor) export.Aggregator {
|
||||
return &New(1)[0]
|
||||
},
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user