@@ -20,9 +20,9 @@ import (
20
20
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/intervalprocessor/internal/metrics"
21
21
)
22
22
23
- var _ processor.Metrics = (* Processor )(nil )
23
+ var _ processor.Metrics = (* intervalProcessor )(nil )
24
24
25
- type Processor struct {
25
+ type intervalProcessor struct {
26
26
ctx context.Context
27
27
cancel context.CancelFunc
28
28
logger * zap.Logger
@@ -43,10 +43,10 @@ type Processor struct {
43
43
nextConsumer consumer.Metrics
44
44
}
45
45
46
- func newProcessor (config * Config , log * zap.Logger , nextConsumer consumer.Metrics ) * Processor {
46
+ func newProcessor (config * Config , log * zap.Logger , nextConsumer consumer.Metrics ) * intervalProcessor {
47
47
ctx , cancel := context .WithCancel (context .Background ())
48
48
49
- return & Processor {
49
+ return & intervalProcessor {
50
50
ctx : ctx ,
51
51
cancel : cancel ,
52
52
logger : log ,
@@ -68,7 +68,7 @@ func newProcessor(config *Config, log *zap.Logger, nextConsumer consumer.Metrics
68
68
}
69
69
}
70
70
71
- func (p * Processor ) Start (_ context.Context , _ component.Host ) error {
71
+ func (p * intervalProcessor ) Start (_ context.Context , _ component.Host ) error {
72
72
exportTicker := time .NewTicker (p .config .Interval )
73
73
go func () {
74
74
for {
@@ -85,16 +85,16 @@ func (p *Processor) Start(_ context.Context, _ component.Host) error {
85
85
return nil
86
86
}
87
87
88
- func (p * Processor ) Shutdown (_ context.Context ) error {
88
+ func (p * intervalProcessor ) Shutdown (_ context.Context ) error {
89
89
p .cancel ()
90
90
return nil
91
91
}
92
92
93
- func (p * Processor ) Capabilities () consumer.Capabilities {
93
+ func (p * intervalProcessor ) Capabilities () consumer.Capabilities {
94
94
return consumer.Capabilities {MutatesData : true }
95
95
}
96
96
97
- func (p * Processor ) ConsumeMetrics (ctx context.Context , md pmetric.Metrics ) error {
97
+ func (p * intervalProcessor ) ConsumeMetrics (ctx context.Context , md pmetric.Metrics ) error {
98
98
var errs error
99
99
100
100
p .stateLock .Lock ()
@@ -201,7 +201,7 @@ func aggregateDataPoints[DPS metrics.DataPointSlice[DP], DP metrics.DataPoint[DP
201
201
}
202
202
}
203
203
204
- func (p * Processor ) exportMetrics () {
204
+ func (p * intervalProcessor ) exportMetrics () {
205
205
md := func () pmetric.Metrics {
206
206
p .stateLock .Lock ()
207
207
defer p .stateLock .Unlock ()
@@ -228,7 +228,7 @@ func (p *Processor) exportMetrics() {
228
228
}
229
229
}
230
230
231
- func (p * Processor ) getOrCloneMetric (rm pmetric.ResourceMetrics , sm pmetric.ScopeMetrics , m pmetric.Metric ) (pmetric.Metric , identity.Metric ) {
231
+ func (p * intervalProcessor ) getOrCloneMetric (rm pmetric.ResourceMetrics , sm pmetric.ScopeMetrics , m pmetric.Metric ) (pmetric.Metric , identity.Metric ) {
232
232
// Find the ResourceMetrics
233
233
resID := identity .OfResource (rm .Resource ())
234
234
rmClone , ok := p .rmLookup [resID ]
0 commit comments