You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-11-27 22:49:15 +02:00
Refactor Pipeline (#3233)
* Add views field to pipeline Redundant maps tracking readers to views and readers to pipelines exist in the pipelineRegistry. Unify these maps by tracing views in pipelines. * Rename newPipelineRegistries->newPipelineRegistry * Add Reader as field to pipeline * Replace createAggregators with resolver facilitator * Replace create agg funcs with inserter facilitator * Correct documentation * Replace pipelineRegistry with []pipeline type * Rename newPipelineRegistry->newPipelines * Fix pipeline_registry_test * Flatten isMonotonic into only use * Update FIXME into TODO * Rename instrument provider resolver field to resolve * Fix comment English * Fix drop aggregator detection
This commit is contained in:
@@ -61,7 +61,7 @@ func TestEmptyPipeline(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestNewPipeline(t *testing.T) {
|
||||
pipe := newPipeline(nil)
|
||||
pipe := newPipeline(nil, nil, nil)
|
||||
|
||||
output, err := pipe.produce(context.Background())
|
||||
require.NoError(t, err)
|
||||
@@ -158,7 +158,7 @@ func TestPipelineDuplicateRegistration(t *testing.T) {
|
||||
}
|
||||
for _, tt := range testCases {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
pipe := newPipeline(nil)
|
||||
pipe := newPipeline(nil, nil, nil)
|
||||
err := pipe.addAggregator(instrumentation.Scope{}, "name", "desc", unit.Dimensionless, testSumAggregator{})
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -177,7 +177,7 @@ func TestPipelineDuplicateRegistration(t *testing.T) {
|
||||
|
||||
func TestPipelineUsesResource(t *testing.T) {
|
||||
res := resource.NewWithAttributes("noSchema", attribute.String("test", "resource"))
|
||||
pipe := newPipeline(res)
|
||||
pipe := newPipeline(res, nil, nil)
|
||||
|
||||
output, err := pipe.produce(context.Background())
|
||||
assert.NoError(t, err)
|
||||
@@ -185,7 +185,7 @@ func TestPipelineUsesResource(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPipelineConcurrency(t *testing.T) {
|
||||
pipe := newPipeline(nil)
|
||||
pipe := newPipeline(nil, nil, nil)
|
||||
ctx := context.Background()
|
||||
|
||||
var wg sync.WaitGroup
|
||||
|
||||
Reference in New Issue
Block a user