Migrate dd-trace-api Groovy files to Java (part 2)#10776
Conversation
| - Do not wrap checked exceptions and throw a Runtime exception; prefer adding a throws clause at method declaration | ||
| - Do not mark local variables `final` | ||
| - Ensure variables are human-readable; avoid single-letter names and pre-define variables that are referenced multiple times | ||
| - When translating Spock `Mock(...)` usage, use `libs.bundles.mockito` instead of writing manual recording/stub implementations |
There was a problem hiding this comment.
Originally the AI had implemented its own detailed inner classes where using mockito would be much cleaner. See b628e82
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 64 metrics, 7 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.61.0-SNAPSHOT~ce94551337, baseline=1.61.0-SNAPSHOT~c04d61b318
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.068 s) : 0, 1067732
Total [baseline] (11.025 s) : 0, 11025269
Agent [candidate] (1.058 s) : 0, 1058388
Total [candidate] (11.044 s) : 0, 11043503
section appsec
Agent [baseline] (1.251 s) : 0, 1250558
Total [baseline] (11.147 s) : 0, 11147158
Agent [candidate] (1.259 s) : 0, 1258792
Total [candidate] (11.209 s) : 0, 11208690
section iast
Agent [baseline] (1.229 s) : 0, 1228787
Total [baseline] (11.395 s) : 0, 11395422
Agent [candidate] (1.225 s) : 0, 1225403
Total [candidate] (11.323 s) : 0, 11322601
section profiling
Agent [baseline] (1.183 s) : 0, 1182809
Total [baseline] (11.014 s) : 0, 11013544
Agent [candidate] (1.181 s) : 0, 1181202
Total [candidate] (11.009 s) : 0, 11009339
gantt
title petclinic - break down per module: candidate=1.61.0-SNAPSHOT~ce94551337, baseline=1.61.0-SNAPSHOT~c04d61b318
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.22 ms) : 0, 1220
crashtracking [candidate] (1.207 ms) : 0, 1207
BytebuddyAgent [baseline] (633.694 ms) : 0, 633694
BytebuddyAgent [candidate] (627.9 ms) : 0, 627900
AgentMeter [baseline] (29.447 ms) : 0, 29447
AgentMeter [candidate] (29.048 ms) : 0, 29048
GlobalTracer [baseline] (258.681 ms) : 0, 258681
GlobalTracer [candidate] (256.703 ms) : 0, 256703
AppSec [baseline] (31.792 ms) : 0, 31792
AppSec [candidate] (31.472 ms) : 0, 31472
Debugger [baseline] (59.986 ms) : 0, 59986
Debugger [candidate] (59.516 ms) : 0, 59516
Remote Config [baseline] (595.366 µs) : 0, 595
Remote Config [candidate] (587.631 µs) : 0, 588
Telemetry [baseline] (8.768 ms) : 0, 8768
Telemetry [candidate] (8.67 ms) : 0, 8670
Flare Poller [baseline] (7.264 ms) : 0, 7264
Flare Poller [candidate] (7.234 ms) : 0, 7234
section appsec
crashtracking [baseline] (1.2 ms) : 0, 1200
crashtracking [candidate] (1.203 ms) : 0, 1203
BytebuddyAgent [baseline] (660.897 ms) : 0, 660897
BytebuddyAgent [candidate] (665.86 ms) : 0, 665860
AgentMeter [baseline] (12.113 ms) : 0, 12113
AgentMeter [candidate] (12.119 ms) : 0, 12119
GlobalTracer [baseline] (258.96 ms) : 0, 258960
GlobalTracer [candidate] (260.664 ms) : 0, 260664
AppSec [baseline] (177.758 ms) : 0, 177758
AppSec [candidate] (178.672 ms) : 0, 178672
Debugger [baseline] (64.437 ms) : 0, 64437
Debugger [candidate] (66.204 ms) : 0, 66204
Remote Config [baseline] (583.711 µs) : 0, 584
Remote Config [candidate] (579.541 µs) : 0, 580
Telemetry [baseline] (10.571 ms) : 0, 10571
Telemetry [candidate] (9.077 ms) : 0, 9077
Flare Poller [baseline] (3.603 ms) : 0, 3603
Flare Poller [candidate] (3.637 ms) : 0, 3637
IAST [baseline] (24.01 ms) : 0, 24010
IAST [candidate] (24.243 ms) : 0, 24243
section iast
crashtracking [baseline] (1.208 ms) : 0, 1208
crashtracking [candidate] (1.191 ms) : 0, 1191
BytebuddyAgent [baseline] (797.084 ms) : 0, 797084
BytebuddyAgent [candidate] (794.902 ms) : 0, 794902
AgentMeter [baseline] (11.31 ms) : 0, 11310
AgentMeter [candidate] (11.367 ms) : 0, 11367
GlobalTracer [baseline] (247.545 ms) : 0, 247545
GlobalTracer [candidate] (246.662 ms) : 0, 246662
AppSec [baseline] (26.381 ms) : 0, 26381
AppSec [candidate] (26.38 ms) : 0, 26380
Debugger [baseline] (63.716 ms) : 0, 63716
Debugger [candidate] (63.406 ms) : 0, 63406
Remote Config [baseline] (549.326 µs) : 0, 549
Remote Config [candidate] (528.917 µs) : 0, 529
Telemetry [baseline] (14.874 ms) : 0, 14874
Telemetry [candidate] (14.913 ms) : 0, 14913
Flare Poller [baseline] (4.897 ms) : 0, 4897
Flare Poller [candidate] (4.854 ms) : 0, 4854
IAST [baseline] (25.158 ms) : 0, 25158
IAST [candidate] (25.144 ms) : 0, 25144
section profiling
crashtracking [baseline] (1.168 ms) : 0, 1168
crashtracking [candidate] (1.164 ms) : 0, 1164
BytebuddyAgent [baseline] (682.737 ms) : 0, 682737
BytebuddyAgent [candidate] (682.006 ms) : 0, 682006
AgentMeter [baseline] (8.561 ms) : 0, 8561
AgentMeter [candidate] (8.587 ms) : 0, 8587
GlobalTracer [baseline] (215.376 ms) : 0, 215376
GlobalTracer [candidate] (215.26 ms) : 0, 215260
AppSec [baseline] (31.923 ms) : 0, 31923
AppSec [candidate] (31.984 ms) : 0, 31984
Debugger [baseline] (64.994 ms) : 0, 64994
Debugger [candidate] (62.072 ms) : 0, 62072
Remote Config [baseline] (590.462 µs) : 0, 590
Remote Config [candidate] (580.29 µs) : 0, 580
Telemetry [baseline] (8.978 ms) : 0, 8978
Telemetry [candidate] (10.642 ms) : 0, 10642
Flare Poller [baseline] (3.527 ms) : 0, 3527
Flare Poller [candidate] (4.275 ms) : 0, 4275
ProfilingAgent [baseline] (94.053 ms) : 0, 94053
ProfilingAgent [candidate] (93.747 ms) : 0, 93747
Profiling [baseline] (94.635 ms) : 0, 94635
Profiling [candidate] (94.301 ms) : 0, 94301
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.61.0-SNAPSHOT~ce94551337, baseline=1.61.0-SNAPSHOT~c04d61b318
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.063 s) : 0, 1062633
Total [baseline] (8.847 s) : 0, 8847125
Agent [candidate] (1.06 s) : 0, 1059621
Total [candidate] (8.86 s) : 0, 8859841
section iast
Agent [baseline] (1.237 s) : 0, 1236593
Total [baseline] (9.622 s) : 0, 9621682
Agent [candidate] (1.228 s) : 0, 1227570
Total [candidate] (9.587 s) : 0, 9587347
gantt
title insecure-bank - break down per module: candidate=1.61.0-SNAPSHOT~ce94551337, baseline=1.61.0-SNAPSHOT~c04d61b318
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.209 ms) : 0, 1209
crashtracking [candidate] (1.186 ms) : 0, 1186
BytebuddyAgent [baseline] (631.95 ms) : 0, 631950
BytebuddyAgent [candidate] (628.065 ms) : 0, 628065
AgentMeter [baseline] (29.264 ms) : 0, 29264
AgentMeter [candidate] (29.163 ms) : 0, 29163
GlobalTracer [baseline] (258.026 ms) : 0, 258026
GlobalTracer [candidate] (257.177 ms) : 0, 257177
AppSec [baseline] (31.836 ms) : 0, 31836
AppSec [candidate] (31.607 ms) : 0, 31607
Debugger [baseline] (59.069 ms) : 0, 59069
Debugger [candidate] (58.99 ms) : 0, 58990
Remote Config [baseline] (598.199 µs) : 0, 598
Remote Config [candidate] (587.626 µs) : 0, 588
Telemetry [baseline] (8.704 ms) : 0, 8704
Telemetry [candidate] (8.694 ms) : 0, 8694
Flare Poller [baseline] (5.749 ms) : 0, 5749
Flare Poller [candidate] (8.049 ms) : 0, 8049
section iast
crashtracking [baseline] (1.208 ms) : 0, 1208
crashtracking [candidate] (1.201 ms) : 0, 1201
BytebuddyAgent [baseline] (801.834 ms) : 0, 801834
BytebuddyAgent [candidate] (797.231 ms) : 0, 797231
AgentMeter [baseline] (11.53 ms) : 0, 11530
AgentMeter [candidate] (11.319 ms) : 0, 11319
GlobalTracer [baseline] (249.432 ms) : 0, 249432
GlobalTracer [candidate] (247.289 ms) : 0, 247289
AppSec [baseline] (27.662 ms) : 0, 27662
AppSec [candidate] (26.375 ms) : 0, 26375
Debugger [baseline] (62.488 ms) : 0, 62488
Debugger [candidate] (62.632 ms) : 0, 62632
Remote Config [baseline] (539.111 µs) : 0, 539
Remote Config [candidate] (530.748 µs) : 0, 531
Telemetry [baseline] (14.958 ms) : 0, 14958
Telemetry [candidate] (15.078 ms) : 0, 15078
Flare Poller [baseline] (4.915 ms) : 0, 4915
Flare Poller [candidate] (4.756 ms) : 0, 4756
IAST [baseline] (25.587 ms) : 0, 25587
IAST [candidate] (25.109 ms) : 0, 25109
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 14 metrics, 21 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~ce94551337, baseline=1.61.0-SNAPSHOT~c04d61b318
dateFormat X
axisFormat %s
section baseline
no_agent (1.253 ms) : 1240, 1266
. : milestone, 1253,
iast (3.179 ms) : 3134, 3223
. : milestone, 3179,
iast_FULL (5.975 ms) : 5914, 6036
. : milestone, 5975,
iast_GLOBAL (3.518 ms) : 3453, 3583
. : milestone, 3518,
profiling (2.156 ms) : 2133, 2178
. : milestone, 2156,
tracing (1.812 ms) : 1796, 1827
. : milestone, 1812,
section candidate
no_agent (1.188 ms) : 1176, 1200
. : milestone, 1188,
iast (3.277 ms) : 3234, 3321
. : milestone, 3277,
iast_FULL (5.869 ms) : 5811, 5927
. : milestone, 5869,
iast_GLOBAL (3.458 ms) : 3400, 3515
. : milestone, 3458,
profiling (2.1 ms) : 2081, 2120
. : milestone, 2100,
tracing (1.782 ms) : 1767, 1797
. : milestone, 1782,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~ce94551337, baseline=1.61.0-SNAPSHOT~c04d61b318
dateFormat X
axisFormat %s
section baseline
no_agent (19.386 ms) : 19184, 19588
. : milestone, 19386,
appsec (18.601 ms) : 18407, 18796
. : milestone, 18601,
code_origins (17.694 ms) : 17518, 17871
. : milestone, 17694,
iast (17.92 ms) : 17740, 18099
. : milestone, 17920,
profiling (18.868 ms) : 18675, 19061
. : milestone, 18868,
tracing (17.936 ms) : 17757, 18115
. : milestone, 17936,
section candidate
no_agent (17.253 ms) : 17076, 17431
. : milestone, 17253,
appsec (19.593 ms) : 19389, 19797
. : milestone, 19593,
code_origins (17.724 ms) : 17547, 17901
. : milestone, 17724,
iast (17.616 ms) : 17443, 17789
. : milestone, 17616,
profiling (18.714 ms) : 18526, 18902
. : milestone, 18714,
tracing (17.681 ms) : 17506, 17855
. : milestone, 17681,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~ce94551337, baseline=1.61.0-SNAPSHOT~c04d61b318
dateFormat X
axisFormat %s
section baseline
no_agent (1.488 ms) : 1476, 1500
. : milestone, 1488,
appsec (2.864 ms) : 2775, 2953
. : milestone, 2864,
iast (2.651 ms) : 2542, 2760
. : milestone, 2651,
iast_GLOBAL (2.693 ms) : 2583, 2802
. : milestone, 2693,
profiling (2.458 ms) : 2366, 2550
. : milestone, 2458,
tracing (2.414 ms) : 2326, 2502
. : milestone, 2414,
section candidate
no_agent (1.486 ms) : 1474, 1498
. : milestone, 1486,
appsec (2.874 ms) : 2785, 2964
. : milestone, 2874,
iast (2.65 ms) : 2541, 2759
. : milestone, 2650,
iast_GLOBAL (2.69 ms) : 2581, 2800
. : milestone, 2690,
profiling (2.44 ms) : 2350, 2530
. : milestone, 2440,
tracing (2.397 ms) : 2310, 2485
. : milestone, 2397,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~ce94551337, baseline=1.61.0-SNAPSHOT~c04d61b318
dateFormat X
axisFormat %s
section baseline
no_agent (14.371 s) : 14371000, 14371000
. : milestone, 14371000,
appsec (13.817 s) : 13817000, 13817000
. : milestone, 13817000,
iast (17.67 s) : 17670000, 17670000
. : milestone, 17670000,
iast_GLOBAL (17.09 s) : 17090000, 17090000
. : milestone, 17090000,
profiling (14.332 s) : 14332000, 14332000
. : milestone, 14332000,
tracing (14.624 s) : 14624000, 14624000
. : milestone, 14624000,
section candidate
no_agent (14.848 s) : 14848000, 14848000
. : milestone, 14848000,
appsec (13.977 s) : 13977000, 13977000
. : milestone, 13977000,
iast (17.438 s) : 17438000, 17438000
. : milestone, 17438000,
iast_GLOBAL (17.19 s) : 17190000, 17190000
. : milestone, 17190000,
profiling (14.519 s) : 14519000, 14519000
. : milestone, 14519000,
tracing (14.151 s) : 14151000, 14151000
. : milestone, 14151000,
|
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
084e3e0
into
master
Migrate dd-trace-api Groovy files to Java (part 2) Use Mockito Update claude skill Fix list error Merge branch 'master' into sarahchen6/g2j-dd-trace-api-migration-pt-2 Co-authored-by: sarah.chen <sarah.chen@datadoghq.com>
What Does This Do
Migrate
dd-trace-apimodule from Groovy to Java, using the/migrate-groovy-to-javaClaude skill. This is part 2, following #10759, with two file changes to make the PRs easier to review.Motivation
This is part of a broader initiative to migrate all testing in this repo to JUnit.
Additional Notes
We can see in the TestOpt dashboard here that the migrated Java tests ran successfully. The migration was done with Claude Sonnet 4.6, and I reviewed the code after -- originally the AI had written inner classes to simulate mocking, but I think using
mockitois a cleaner solution.Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]
Note: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.