-
Notifications
You must be signed in to change notification settings - Fork 324
Adds methods for setting TagMap.Entry directly on AgentSpan/DDSpan #10472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
EntryIterator and EntryChangeIterator are arguably redundant
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
Coverage for byte, short, float, and double
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
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.
Removing statics that were previously moved to TagValueConversions
| return this; | ||
| } | ||
|
|
||
| @Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to add some tests around the new methods, but feel free to review the design/intent
- tests exposed missing TagMap.Entry.create for boolean - added explanatory strings to some asserts
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 63 metrics, 8 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.59.0-SNAPSHOT~4d0be98df7, baseline=1.59.0-SNAPSHOT~76b5b63bcb
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.058 s) : 0, 1058043
Total [baseline] (8.793 s) : 0, 8792554
Agent [candidate] (1.059 s) : 0, 1058908
Total [candidate] (8.724 s) : 0, 8724202
section iast
Agent [baseline] (1.227 s) : 0, 1227329
Total [baseline] (9.421 s) : 0, 9421283
Agent [candidate] (1.226 s) : 0, 1225556
Total [candidate] (9.377 s) : 0, 9377131
gantt
title insecure-bank - break down per module: candidate=1.59.0-SNAPSHOT~4d0be98df7, baseline=1.59.0-SNAPSHOT~76b5b63bcb
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.205 ms) : 0, 1205
crashtracking [candidate] (1.179 ms) : 0, 1179
BytebuddyAgent [baseline] (625.329 ms) : 0, 625329
BytebuddyAgent [candidate] (624.553 ms) : 0, 624553
AgentMeter [baseline] (28.662 ms) : 0, 28662
AgentMeter [candidate] (28.69 ms) : 0, 28690
GlobalTracer [baseline] (257.42 ms) : 0, 257420
GlobalTracer [candidate] (258.367 ms) : 0, 258367
AppSec [baseline] (33.053 ms) : 0, 33053
AppSec [candidate] (33.059 ms) : 0, 33059
Debugger [baseline] (60.958 ms) : 0, 60958
Debugger [candidate] (61.079 ms) : 0, 61079
Remote Config [baseline] (602.318 µs) : 0, 602
Remote Config [candidate] (615.267 µs) : 0, 615
Telemetry [baseline] (9.137 ms) : 0, 9137
Telemetry [candidate] (11.42 ms) : 0, 11420
Flare Poller [baseline] (6.125 ms) : 0, 6125
Flare Poller [candidate] (4.501 ms) : 0, 4501
section iast
crashtracking [baseline] (1.187 ms) : 0, 1187
crashtracking [candidate] (1.189 ms) : 0, 1189
BytebuddyAgent [baseline] (790.994 ms) : 0, 790994
BytebuddyAgent [candidate] (790.148 ms) : 0, 790148
AgentMeter [baseline] (11.225 ms) : 0, 11225
AgentMeter [candidate] (11.212 ms) : 0, 11212
GlobalTracer [baseline] (248.455 ms) : 0, 248455
GlobalTracer [candidate] (248.578 ms) : 0, 248578
IAST [baseline] (26.838 ms) : 0, 26838
IAST [candidate] (26.778 ms) : 0, 26778
AppSec [baseline] (33.853 ms) : 0, 33853
AppSec [candidate] (33.224 ms) : 0, 33224
Debugger [baseline] (66.622 ms) : 0, 66622
Debugger [candidate] (66.317 ms) : 0, 66317
Remote Config [baseline] (547.81 µs) : 0, 548
Remote Config [candidate] (543.398 µs) : 0, 543
Telemetry [baseline] (8.614 ms) : 0, 8614
Telemetry [candidate] (8.643 ms) : 0, 8643
Flare Poller [baseline] (3.523 ms) : 0, 3523
Flare Poller [candidate] (3.456 ms) : 0, 3456
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.59.0-SNAPSHOT~4d0be98df7, baseline=1.59.0-SNAPSHOT~76b5b63bcb
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.061 s) : 0, 1060830
Total [baseline] (10.992 s) : 0, 10992269
Agent [candidate] (1.059 s) : 0, 1059035
Total [candidate] (11.012 s) : 0, 11012283
section appsec
Agent [baseline] (1.235 s) : 0, 1235151
Total [baseline] (11.011 s) : 0, 11010962
Agent [candidate] (1.232 s) : 0, 1232239
Total [candidate] (10.948 s) : 0, 10947994
section iast
Agent [baseline] (1.228 s) : 0, 1228289
Total [baseline] (11.24 s) : 0, 11239835
Agent [candidate] (1.23 s) : 0, 1230457
Total [candidate] (11.179 s) : 0, 11178991
section profiling
Agent [baseline] (1.186 s) : 0, 1185682
Total [baseline] (10.899 s) : 0, 10898866
Agent [candidate] (1.197 s) : 0, 1197129
Total [candidate] (10.98 s) : 0, 10980103
gantt
title petclinic - break down per module: candidate=1.59.0-SNAPSHOT~4d0be98df7, baseline=1.59.0-SNAPSHOT~76b5b63bcb
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.189 ms) : 0, 1189
crashtracking [candidate] (1.179 ms) : 0, 1179
BytebuddyAgent [baseline] (623.924 ms) : 0, 623924
BytebuddyAgent [candidate] (624.052 ms) : 0, 624052
AgentMeter [baseline] (28.808 ms) : 0, 28808
AgentMeter [candidate] (28.737 ms) : 0, 28737
GlobalTracer [baseline] (257.736 ms) : 0, 257736
GlobalTracer [candidate] (257.711 ms) : 0, 257711
AppSec [baseline] (32.989 ms) : 0, 32989
AppSec [candidate] (32.981 ms) : 0, 32981
Debugger [baseline] (64.016 ms) : 0, 64016
Debugger [candidate] (62.211 ms) : 0, 62211
Remote Config [baseline] (597.597 µs) : 0, 598
Remote Config [candidate] (618.001 µs) : 0, 618
Telemetry [baseline] (10.736 ms) : 0, 10736
Telemetry [candidate] (9.991 ms) : 0, 9991
Flare Poller [baseline] (5.248 ms) : 0, 5248
Flare Poller [candidate] (6.122 ms) : 0, 6122
section appsec
crashtracking [baseline] (1.184 ms) : 0, 1184
crashtracking [candidate] (1.174 ms) : 0, 1174
BytebuddyAgent [baseline] (653.344 ms) : 0, 653344
BytebuddyAgent [candidate] (651.645 ms) : 0, 651645
AgentMeter [baseline] (11.871 ms) : 0, 11871
AgentMeter [candidate] (11.852 ms) : 0, 11852
GlobalTracer [baseline] (258.139 ms) : 0, 258139
GlobalTracer [candidate] (257.804 ms) : 0, 257804
IAST [baseline] (25.527 ms) : 0, 25527
IAST [candidate] (25.429 ms) : 0, 25429
AppSec [baseline] (167.785 ms) : 0, 167785
AppSec [candidate] (167.881 ms) : 0, 167881
Debugger [baseline] (68.242 ms) : 0, 68242
Debugger [candidate] (67.597 ms) : 0, 67597
Remote Config [baseline] (659.605 µs) : 0, 660
Remote Config [candidate] (663.449 µs) : 0, 663
Telemetry [baseline] (9.401 ms) : 0, 9401
Telemetry [candidate] (9.2 ms) : 0, 9200
Flare Poller [baseline] (3.685 ms) : 0, 3685
Flare Poller [candidate] (3.67 ms) : 0, 3670
section iast
crashtracking [baseline] (1.188 ms) : 0, 1188
crashtracking [candidate] (1.178 ms) : 0, 1178
BytebuddyAgent [baseline] (791.201 ms) : 0, 791201
BytebuddyAgent [candidate] (792.757 ms) : 0, 792757
AgentMeter [baseline] (11.237 ms) : 0, 11237
AgentMeter [candidate] (11.287 ms) : 0, 11287
GlobalTracer [baseline] (248.617 ms) : 0, 248617
GlobalTracer [candidate] (249.388 ms) : 0, 249388
IAST [baseline] (26.948 ms) : 0, 26948
IAST [candidate] (26.927 ms) : 0, 26927
AppSec [baseline] (32.932 ms) : 0, 32932
AppSec [candidate] (32.332 ms) : 0, 32332
Debugger [baseline] (68.145 ms) : 0, 68145
Debugger [candidate] (68.691 ms) : 0, 68691
Remote Config [baseline] (553.164 µs) : 0, 553
Remote Config [candidate] (538.242 µs) : 0, 538
Telemetry [baseline] (8.578 ms) : 0, 8578
Telemetry [candidate] (8.502 ms) : 0, 8502
Flare Poller [baseline] (3.486 ms) : 0, 3486
Flare Poller [candidate] (3.472 ms) : 0, 3472
section profiling
crashtracking [baseline] (1.213 ms) : 0, 1213
crashtracking [candidate] (1.217 ms) : 0, 1217
BytebuddyAgent [baseline] (677.56 ms) : 0, 677560
BytebuddyAgent [candidate] (683.976 ms) : 0, 683976
AgentMeter [baseline] (8.686 ms) : 0, 8686
AgentMeter [candidate] (8.716 ms) : 0, 8716
GlobalTracer [baseline] (216.948 ms) : 0, 216948
GlobalTracer [candidate] (219.067 ms) : 0, 219067
AppSec [baseline] (32.197 ms) : 0, 32197
AppSec [candidate] (32.854 ms) : 0, 32854
Debugger [baseline] (67.383 ms) : 0, 67383
Debugger [candidate] (68.275 ms) : 0, 68275
Remote Config [baseline] (587.951 µs) : 0, 588
Remote Config [candidate] (611.276 µs) : 0, 611
Telemetry [baseline] (8.689 ms) : 0, 8689
Telemetry [candidate] (8.832 ms) : 0, 8832
Flare Poller [baseline] (3.732 ms) : 0, 3732
Flare Poller [candidate] (3.799 ms) : 0, 3799
ProfilingAgent [baseline] (98.733 ms) : 0, 98733
ProfilingAgent [candidate] (99.648 ms) : 0, 99648
Profiling [baseline] (99.306 ms) : 0, 99306
Profiling [candidate] (100.25 ms) : 0, 100250
LoadParameters
See matching parameters
SummaryFound 1 performance improvements and 1 performance regressions! Performance is the same for 16 metrics, 18 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~4d0be98df7, baseline=1.59.0-SNAPSHOT~76b5b63bcb
dateFormat X
axisFormat %s
section baseline
no_agent (18.145 ms) : 17964, 18326
. : milestone, 18145,
appsec (18.693 ms) : 18501, 18885
. : milestone, 18693,
code_origins (18.843 ms) : 18649, 19038
. : milestone, 18843,
iast (17.526 ms) : 17351, 17701
. : milestone, 17526,
profiling (18.63 ms) : 18447, 18812
. : milestone, 18630,
tracing (17.896 ms) : 17716, 18076
. : milestone, 17896,
section candidate
no_agent (18.403 ms) : 18215, 18591
. : milestone, 18403,
appsec (18.47 ms) : 18286, 18654
. : milestone, 18470,
code_origins (18.116 ms) : 17939, 18294
. : milestone, 18116,
iast (17.715 ms) : 17540, 17890
. : milestone, 17715,
profiling (18.576 ms) : 18394, 18757
. : milestone, 18576,
tracing (17.716 ms) : 17544, 17889
. : milestone, 17716,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~4d0be98df7, baseline=1.59.0-SNAPSHOT~76b5b63bcb
dateFormat X
axisFormat %s
section baseline
no_agent (1.186 ms) : 1174, 1198
. : milestone, 1186,
iast (3.217 ms) : 3173, 3261
. : milestone, 3217,
iast_FULL (5.911 ms) : 5852, 5970
. : milestone, 5911,
iast_GLOBAL (3.542 ms) : 3480, 3604
. : milestone, 3542,
profiling (2.003 ms) : 1985, 2020
. : milestone, 2003,
tracing (1.796 ms) : 1781, 1811
. : milestone, 1796,
section candidate
no_agent (1.169 ms) : 1157, 1180
. : milestone, 1169,
iast (3.162 ms) : 3120, 3204
. : milestone, 3162,
iast_FULL (5.84 ms) : 5782, 5899
. : milestone, 5840,
iast_GLOBAL (3.641 ms) : 3577, 3704
. : milestone, 3641,
profiling (2.228 ms) : 2205, 2251
. : milestone, 2228,
tracing (1.831 ms) : 1815, 1847
. : milestone, 1831,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~4d0be98df7, baseline=1.59.0-SNAPSHOT~76b5b63bcb
dateFormat X
axisFormat %s
section baseline
no_agent (1.483 ms) : 1472, 1495
. : milestone, 1483,
appsec (3.786 ms) : 3563, 4009
. : milestone, 3786,
iast (2.282 ms) : 2211, 2352
. : milestone, 2282,
iast_GLOBAL (2.321 ms) : 2250, 2392
. : milestone, 2321,
profiling (2.113 ms) : 2056, 2170
. : milestone, 2113,
tracing (2.083 ms) : 2029, 2138
. : milestone, 2083,
section candidate
no_agent (1.483 ms) : 1472, 1495
. : milestone, 1483,
appsec (3.778 ms) : 3554, 4002
. : milestone, 3778,
iast (2.277 ms) : 2206, 2347
. : milestone, 2277,
iast_GLOBAL (2.32 ms) : 2249, 2391
. : milestone, 2320,
profiling (2.1 ms) : 2044, 2156
. : milestone, 2100,
tracing (2.088 ms) : 2034, 2143
. : milestone, 2088,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~4d0be98df7, baseline=1.59.0-SNAPSHOT~76b5b63bcb
dateFormat X
axisFormat %s
section baseline
no_agent (14.931 s) : 14931000, 14931000
. : milestone, 14931000,
appsec (15.036 s) : 15036000, 15036000
. : milestone, 15036000,
iast (17.911 s) : 17911000, 17911000
. : milestone, 17911000,
iast_GLOBAL (17.846 s) : 17846000, 17846000
. : milestone, 17846000,
profiling (15.007 s) : 15007000, 15007000
. : milestone, 15007000,
tracing (14.698 s) : 14698000, 14698000
. : milestone, 14698000,
section candidate
no_agent (15.011 s) : 15011000, 15011000
. : milestone, 15011000,
appsec (15.037 s) : 15037000, 15037000
. : milestone, 15037000,
iast (18.211 s) : 18211000, 18211000
. : milestone, 18211000,
iast_GLOBAL (17.393 s) : 17393000, 17393000
. : milestone, 17393000,
profiling (14.989 s) : 14989000, 14989000
. : milestone, 14989000,
tracing (14.786 s) : 14786000, 14786000
. : milestone, 14786000,
|
…aDog/dd-trace-java into dougqh/fdirect-apis-for-tagmap-entry
What Does This Do
Adds methods to TagMap.Entry to create entries directly
Adds methods to AgentSpan / DDSpan to set TagMap.Entry(Reader) directly
Motivation
The intention is to enable reuse of TagMap.Entry objects to further reduce allocation
Those improvements have been prototyped and shown to be beneficial, but will be done in separate pull requests
I'd originally hoped to make reuse of TagMap.Entry-s hidden from instrumentation by adding in caches behind the scenes, but that approach didn't pan out. The caches were beneficial when memory was scarce, but harmful when memory is plentiful.
So for now, the simplest approach is to expose APIs, so TagMap.Entry-s can be used directly in the key places where doing so is beneficial. Examples include static meta information, git related tags, db connection info, etc
Additional Notes
It will probably also make sense to extend these changes to TraceSegment; however, TagMap isn't currently visible to TraceSegment at build time. To keep this pull request simple, changing TraceSegment is left to another pull request
Contributor Checklist
type:and (comp:orinst:) labels in addition to any useful labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]