Commit 55dade9
authored
Performance improvements for the metricstarttime processor (open-telemetry#40998)
#### Description
The existing implementation copied everything from the previous
resourcemetrics to a completely new resourcemetrics. However, the
component is marked as mutating data, so this PR just changes it to
mutate the batch of metrics in-place. This avoids a lot of copying.
From previous experience caching start times and values, storing
attributes and exemplars in a cache is very expensive unless you need
them. The second commit adds "minimal copy to" methods to avoid storing
attributes and exemplars.
#### Link to tracking issue
Fixes
open-telemetry#39400
#### Testing
Passes all existing unit tests.1 parent 7850ce5 commit 55dade9
File tree
3 files changed
+158
-188
lines changed- processor/metricstarttimeprocessor
- internal
- subtractinitial
- testhelper
3 files changed
+158
-188
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
0 commit comments