Commit 8fbdc86
Reuse TagMap.Entry objects in BaseDecorator (#10501)
Updating tests to account for API changes
Adding tagIterator and valueIterator
Adding checks for EntryIterator
Removing EntryIterator and EntryChangeIterator
EntryIterator and EntryChangeIterator are arguably redundant
spotless
Merge branch 'master' into dougqh/tagmap-entryreader
Refining handling of primitive types
Fixed bug TagValueConversions.toBoolean
Could cause LegacyTagMap.EntryReader to produce incorrect answers to some queries
For simplicity, now treating Byte and Short as Integer. That will make calling code doing primitive handling simpler.
Fleshing out tests -- more tests to come
Refining comment in toBoolean
Adding more TagValueConversionTest-s
Coverage for byte, short, float, and double
Adding Entry tests for byte and short boxes
spotless
Merge branch 'master' into dougqh/tagmap-entryreader
Merge branch 'master' into dougqh/tagmap-entryreader
Direct TagMap.Entry support in AgentSpan / DDSpan
Adding methods to AgentSpan / DDSpan that take TagMap.Entry/Reader objects directly
This will enable TagMap.Entry reuse which can reduce memory allocation/GC pressure
Adding public create methods to TagMap.Entry
Methods are intended to be used to create TagMap.Entry objects for repeatedly used values
Overloads are provided for all the supported types to be easier for developers not familiar with TagMap internals. Internally, TagMap still uses the more explicit new<X>Entry methods.
spotless
Merge branch 'master' into dougqh/fdirect-apis-for-tagmap-entry
Fixed merge
Removing statics that were previously moved to TagValueConversions
Clarifying comments
Adding tests for TagMap.Entry.create
- tests exposed missing TagMap.Entry.create for boolean
- added explanatory strings to some asserts
spotless
Comments
Merge branch 'master' into dougqh/fdirect-apis-for-tagmap-entry
Adding test for TagMap.Entry setters
Merge branch 'dougqh/fdirect-apis-for-tagmap-entry' of github.com:DataDog/dd-trace-java into dougqh/fdirect-apis-for-tagmap-entry
Adding missing import
spotless
Groovy codeNarc
Merge branch 'master' into dougqh/fdirect-apis-for-tagmap-entry
Reusing entries for analytics sample rate & component
spotless
For clarity, adding an explicit initial set to null
Reduced visibility of cachedComponentEntry
Doesn't need to be visible to children
If any child needs the componentEntry, they can call the method instead
Merge branch 'master' into dougqh/basedecorator-entry-reuse
Taking advantage of null handling in setMetric to simplify code
Merge branch 'dougqh/basedecorator-entry-reuse' of github.com:DataDog/dd-trace-java into dougqh/basedecorator-entry-reuse
Clarifying comment & spotless
Simplifying approach - just use final field in constructor
Merge branch 'master' into dougqh/basedecorator-entry-reuse
Merge branch 'master' into dougqh/basedecorator-entry-reuse
spotless
Merge branch 'dougqh/basedecorator-entry-reuse' of github.com:DataDog/dd-trace-java into dougqh/basedecorator-entry-reuse
Merge branch 'master' into dougqh/basedecorator-entry-reuse
Fixing tests
Code is now calling setTag(TagMap.Entry) or setMetric(TagMap.Entry)
Since these tests use mocks rather than checking span contents, I had to update them to account for the change
Merge branch 'dougqh/basedecorator-entry-reuse' of github.com:DataDog/dd-trace-java into dougqh/basedecorator-entry-reuse
Fixing ordering issue introduced by moving setting into constructor
spotless
Reverting to the lazy caching approach
Adding comment to explain the approach taken
Reverting field order
This file no longer needs to change with the caching approach, and this serves as a useful test that the behavior hasn't been altered
Merge branch 'master' into dougqh/basedecorator-entry-reuse
Co-authored-by: devflow.devflow-routing-intake <devflow.devflow-routing-intake@kubernetes.us1.ddbuild.io>1 parent 19de0d9 commit 8fbdc86
6 files changed
Lines changed: 69 additions & 15 deletions
File tree
- dd-java-agent/agent-bootstrap/src
- main/java/datadog/trace/bootstrap/instrumentation/decorator
- test/groovy/datadog/trace/bootstrap/instrumentation/decorator
- internal-api/src/test/java/datadog/trace/api
Lines changed: 37 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
47 | 53 | | |
| 54 | + | |
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
| 59 | + | |
52 | 60 | | |
53 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
54 | 67 | | |
55 | 68 | | |
56 | 69 | | |
| |||
59 | 72 | | |
60 | 73 | | |
61 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
62 | 89 | | |
63 | 90 | | |
64 | 91 | | |
| |||
67 | 94 | | |
68 | 95 | | |
69 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
70 | 102 | | |
71 | | - | |
72 | 103 | | |
73 | | - | |
74 | | - | |
75 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
76 | 108 | | |
77 | 109 | | |
78 | 110 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
501 | 516 | | |
502 | 517 | | |
503 | 518 | | |
| |||
0 commit comments