-
Notifications
You must be signed in to change notification settings - Fork 324
[G2J] call site instrumentation plugin #10462
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
Migration from Groovy to Java for unit tests
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 petclinicgantt
title petclinic - global startup overhead: candidate=1.59.0-SNAPSHOT~c7521ee4ed, baseline=1.59.0-SNAPSHOT~949e5f91b3
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.057 s) : 0, 1056926
Total [baseline] (10.982 s) : 0, 10982125
Agent [candidate] (1.059 s) : 0, 1058936
Total [candidate] (10.991 s) : 0, 10990656
section appsec
Agent [baseline] (1.231 s) : 0, 1230908
Total [baseline] (11.0 s) : 0, 11000270
Agent [candidate] (1.231 s) : 0, 1231449
Total [candidate] (10.923 s) : 0, 10922760
section iast
Agent [baseline] (1.231 s) : 0, 1231246
Total [baseline] (11.118 s) : 0, 11117701
Agent [candidate] (1.225 s) : 0, 1224809
Total [candidate] (11.15 s) : 0, 11149978
section profiling
Agent [baseline] (1.186 s) : 0, 1186041
Total [baseline] (10.951 s) : 0, 10950631
Agent [candidate] (1.193 s) : 0, 1192848
Total [candidate] (11.069 s) : 0, 11069148
gantt
title petclinic - break down per module: candidate=1.59.0-SNAPSHOT~c7521ee4ed, baseline=1.59.0-SNAPSHOT~949e5f91b3
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.176 ms) : 0, 1176
crashtracking [candidate] (1.168 ms) : 0, 1168
BytebuddyAgent [baseline] (622.946 ms) : 0, 622946
BytebuddyAgent [candidate] (622.836 ms) : 0, 622836
AgentMeter [baseline] (28.809 ms) : 0, 28809
AgentMeter [candidate] (28.861 ms) : 0, 28861
GlobalTracer [baseline] (257.186 ms) : 0, 257186
GlobalTracer [candidate] (257.478 ms) : 0, 257478
AppSec [baseline] (32.83 ms) : 0, 32830
AppSec [candidate] (32.914 ms) : 0, 32914
Debugger [baseline] (62.696 ms) : 0, 62696
Debugger [candidate] (62.052 ms) : 0, 62052
Remote Config [baseline] (627.733 µs) : 0, 628
Remote Config [candidate] (624.163 µs) : 0, 624
Telemetry [baseline] (9.076 ms) : 0, 9076
Telemetry [candidate] (9.09 ms) : 0, 9090
Flare Poller [baseline] (6.05 ms) : 0, 6050
Flare Poller [candidate] (8.438 ms) : 0, 8438
section appsec
crashtracking [baseline] (1.181 ms) : 0, 1181
crashtracking [candidate] (1.195 ms) : 0, 1195
BytebuddyAgent [baseline] (652.203 ms) : 0, 652203
BytebuddyAgent [candidate] (652.469 ms) : 0, 652469
AgentMeter [baseline] (11.794 ms) : 0, 11794
AgentMeter [candidate] (11.804 ms) : 0, 11804
GlobalTracer [baseline] (256.883 ms) : 0, 256883
GlobalTracer [candidate] (256.932 ms) : 0, 256932
AppSec [baseline] (167.949 ms) : 0, 167949
AppSec [candidate] (167.306 ms) : 0, 167306
Debugger [baseline] (66.466 ms) : 0, 66466
Debugger [candidate] (67.429 ms) : 0, 67429
Remote Config [baseline] (678.911 µs) : 0, 679
Remote Config [candidate] (675.396 µs) : 0, 675
Telemetry [baseline] (9.293 ms) : 0, 9293
Telemetry [candidate] (9.235 ms) : 0, 9235
Flare Poller [baseline] (3.677 ms) : 0, 3677
Flare Poller [candidate] (3.601 ms) : 0, 3601
IAST [baseline] (25.496 ms) : 0, 25496
IAST [candidate] (25.522 ms) : 0, 25522
section iast
crashtracking [baseline] (1.179 ms) : 0, 1179
crashtracking [candidate] (1.189 ms) : 0, 1189
BytebuddyAgent [baseline] (795.718 ms) : 0, 795718
BytebuddyAgent [candidate] (789.19 ms) : 0, 789190
AgentMeter [baseline] (11.135 ms) : 0, 11135
AgentMeter [candidate] (11.153 ms) : 0, 11153
GlobalTracer [baseline] (247.964 ms) : 0, 247964
GlobalTracer [candidate] (247.723 ms) : 0, 247723
AppSec [baseline] (32.036 ms) : 0, 32036
AppSec [candidate] (33.1 ms) : 0, 33100
Debugger [baseline] (68.337 ms) : 0, 68337
Debugger [candidate] (67.527 ms) : 0, 67527
Remote Config [baseline] (543.563 µs) : 0, 544
Remote Config [candidate] (540.81 µs) : 0, 541
Telemetry [baseline] (8.544 ms) : 0, 8544
Telemetry [candidate] (8.666 ms) : 0, 8666
Flare Poller [baseline] (3.492 ms) : 0, 3492
Flare Poller [candidate] (3.511 ms) : 0, 3511
IAST [baseline] (26.842 ms) : 0, 26842
IAST [candidate] (26.835 ms) : 0, 26835
section profiling
ProfilingAgent [baseline] (98.914 ms) : 0, 98914
ProfilingAgent [candidate] (99.638 ms) : 0, 99638
crashtracking [baseline] (1.22 ms) : 0, 1220
crashtracking [candidate] (1.211 ms) : 0, 1211
BytebuddyAgent [baseline] (677.225 ms) : 0, 677225
BytebuddyAgent [candidate] (681.599 ms) : 0, 681599
AgentMeter [baseline] (8.691 ms) : 0, 8691
AgentMeter [candidate] (8.634 ms) : 0, 8634
GlobalTracer [baseline] (216.904 ms) : 0, 216904
GlobalTracer [candidate] (217.66 ms) : 0, 217660
AppSec [baseline] (32.344 ms) : 0, 32344
AppSec [candidate] (32.707 ms) : 0, 32707
Debugger [baseline] (67.73 ms) : 0, 67730
Debugger [candidate] (67.934 ms) : 0, 67934
Remote Config [baseline] (586.216 µs) : 0, 586
Remote Config [candidate] (597.026 µs) : 0, 597
Telemetry [baseline] (8.656 ms) : 0, 8656
Telemetry [candidate] (8.782 ms) : 0, 8782
Flare Poller [baseline] (3.793 ms) : 0, 3793
Flare Poller [candidate] (3.827 ms) : 0, 3827
Profiling [baseline] (99.485 ms) : 0, 99485
Profiling [candidate] (100.23 ms) : 0, 100230
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.59.0-SNAPSHOT~c7521ee4ed, baseline=1.59.0-SNAPSHOT~949e5f91b3
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.057 s) : 0, 1057087
Total [baseline] (8.769 s) : 0, 8769148
Agent [candidate] (1.06 s) : 0, 1059867
Total [candidate] (8.693 s) : 0, 8693363
section iast
Agent [baseline] (1.227 s) : 0, 1227452
Total [baseline] (9.391 s) : 0, 9390841
Agent [candidate] (1.233 s) : 0, 1233187
Total [candidate] (9.368 s) : 0, 9367922
gantt
title insecure-bank - break down per module: candidate=1.59.0-SNAPSHOT~c7521ee4ed, baseline=1.59.0-SNAPSHOT~949e5f91b3
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.183 ms) : 0, 1183
crashtracking [candidate] (1.174 ms) : 0, 1174
BytebuddyAgent [baseline] (623.959 ms) : 0, 623959
BytebuddyAgent [candidate] (622.73 ms) : 0, 622730
AgentMeter [baseline] (28.766 ms) : 0, 28766
AgentMeter [candidate] (28.729 ms) : 0, 28729
GlobalTracer [baseline] (257.733 ms) : 0, 257733
GlobalTracer [candidate] (257.59 ms) : 0, 257590
AppSec [baseline] (32.891 ms) : 0, 32891
AppSec [candidate] (33.113 ms) : 0, 33113
Debugger [baseline] (60.406 ms) : 0, 60406
Debugger [candidate] (62.156 ms) : 0, 62156
Remote Config [baseline] (637.949 µs) : 0, 638
Remote Config [candidate] (618.562 µs) : 0, 619
Telemetry [baseline] (9.167 ms) : 0, 9167
Telemetry [candidate] (10.584 ms) : 0, 10584
Flare Poller [baseline] (6.832 ms) : 0, 6832
Flare Poller [candidate] (7.705 ms) : 0, 7705
section iast
crashtracking [baseline] (1.189 ms) : 0, 1189
crashtracking [candidate] (1.187 ms) : 0, 1187
BytebuddyAgent [baseline] (791.054 ms) : 0, 791054
BytebuddyAgent [candidate] (796.156 ms) : 0, 796156
AgentMeter [baseline] (11.098 ms) : 0, 11098
AgentMeter [candidate] (11.372 ms) : 0, 11372
GlobalTracer [baseline] (247.648 ms) : 0, 247648
GlobalTracer [candidate] (249.057 ms) : 0, 249057
IAST [baseline] (26.864 ms) : 0, 26864
IAST [candidate] (27.008 ms) : 0, 27008
AppSec [baseline] (32.431 ms) : 0, 32431
AppSec [candidate] (33.713 ms) : 0, 33713
Debugger [baseline] (68.894 ms) : 0, 68894
Debugger [candidate] (66.321 ms) : 0, 66321
Remote Config [baseline] (552.264 µs) : 0, 552
Remote Config [candidate] (542.769 µs) : 0, 543
Telemetry [baseline] (8.668 ms) : 0, 8668
Telemetry [candidate] (8.747 ms) : 0, 8747
Flare Poller [baseline] (3.57 ms) : 0, 3570
Flare Poller [candidate] (3.594 ms) : 0, 3594
LoadParameters
See matching parameters
SummaryFound 3 performance improvements and 1 performance regressions! Performance is the same for 17 metrics, 15 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~c7521ee4ed, baseline=1.59.0-SNAPSHOT~949e5f91b3
dateFormat X
axisFormat %s
section baseline
no_agent (18.805 ms) : 18613, 18997
. : milestone, 18805,
appsec (19.534 ms) : 19330, 19737
. : milestone, 19534,
code_origins (17.555 ms) : 17380, 17729
. : milestone, 17555,
iast (17.856 ms) : 17678, 18034
. : milestone, 17856,
profiling (18.708 ms) : 18519, 18897
. : milestone, 18708,
tracing (17.587 ms) : 17412, 17762
. : milestone, 17587,
section candidate
no_agent (18.806 ms) : 18612, 19000
. : milestone, 18806,
appsec (18.395 ms) : 18210, 18580
. : milestone, 18395,
code_origins (17.563 ms) : 17390, 17737
. : milestone, 17563,
iast (17.629 ms) : 17450, 17807
. : milestone, 17629,
profiling (18.656 ms) : 18472, 18839
. : milestone, 18656,
tracing (18.711 ms) : 18522, 18899
. : milestone, 18711,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~c7521ee4ed, baseline=1.59.0-SNAPSHOT~949e5f91b3
dateFormat X
axisFormat %s
section baseline
no_agent (1.181 ms) : 1169, 1192
. : milestone, 1181,
iast (3.285 ms) : 3239, 3331
. : milestone, 3285,
iast_FULL (5.788 ms) : 5731, 5845
. : milestone, 5788,
iast_GLOBAL (3.482 ms) : 3432, 3531
. : milestone, 3482,
profiling (2.047 ms) : 2029, 2064
. : milestone, 2047,
tracing (1.763 ms) : 1749, 1777
. : milestone, 1763,
section candidate
no_agent (1.181 ms) : 1170, 1193
. : milestone, 1181,
iast (3.289 ms) : 3245, 3333
. : milestone, 3289,
iast_FULL (5.642 ms) : 5587, 5697
. : milestone, 5642,
iast_GLOBAL (3.607 ms) : 3552, 3662
. : milestone, 3607,
profiling (2.159 ms) : 2139, 2179
. : milestone, 2159,
tracing (1.848 ms) : 1832, 1863
. : milestone, 1848,
DacapoParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 0 unstable metrics.
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~c7521ee4ed, baseline=1.59.0-SNAPSHOT~949e5f91b3
dateFormat X
axisFormat %s
section baseline
no_agent (1.478 ms) : 1467, 1490
. : milestone, 1478,
appsec (3.708 ms) : 3493, 3924
. : milestone, 3708,
iast (2.264 ms) : 2195, 2333
. : milestone, 2264,
iast_GLOBAL (2.308 ms) : 2238, 2377
. : milestone, 2308,
profiling (2.081 ms) : 2026, 2136
. : milestone, 2081,
tracing (2.064 ms) : 2011, 2118
. : milestone, 2064,
section candidate
no_agent (1.48 ms) : 1468, 1491
. : milestone, 1480,
appsec (2.508 ms) : 2453, 2563
. : milestone, 2508,
iast (2.265 ms) : 2196, 2334
. : milestone, 2265,
iast_GLOBAL (2.312 ms) : 2242, 2382
. : milestone, 2312,
profiling (2.119 ms) : 2062, 2175
. : milestone, 2119,
tracing (2.072 ms) : 2019, 2126
. : milestone, 2072,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~c7521ee4ed, baseline=1.59.0-SNAPSHOT~949e5f91b3
dateFormat X
axisFormat %s
section baseline
no_agent (14.973 s) : 14973000, 14973000
. : milestone, 14973000,
appsec (14.979 s) : 14979000, 14979000
. : milestone, 14979000,
iast (17.944 s) : 17944000, 17944000
. : milestone, 17944000,
iast_GLOBAL (17.992 s) : 17992000, 17992000
. : milestone, 17992000,
profiling (15.109 s) : 15109000, 15109000
. : milestone, 15109000,
tracing (14.605 s) : 14605000, 14605000
. : milestone, 14605000,
section candidate
no_agent (15.358 s) : 15358000, 15358000
. : milestone, 15358000,
appsec (14.958 s) : 14958000, 14958000
. : milestone, 14958000,
iast (18.08 s) : 18080000, 18080000
. : milestone, 18080000,
iast_GLOBAL (17.969 s) : 17969000, 17969000
. : milestone, 17969000,
profiling (14.848 s) : 14848000, 14848000
. : milestone, 14848000,
tracing (14.806 s) : 14806000, 14806000
. : milestone, 14806000,
|
| testImplementation(libs.bundles.groovy) | ||
| testImplementation(libs.bundles.spock) |
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.
❔ question: Are groovy and spock bundles still needed?
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.
removed
| # | ||
| # Finds all directories matching */src/test/groovy under the start folder, | ||
| # ensures corresponding src/test/java exists, mirrors missing subdirs, | ||
| # moves files with `git mv` (preserving history) and commits the changes. |
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.
🔨 issue: As raised in Slack, the script won't help to get changes marked as moved.
| testImplementation(libs.bundles.groovy) | ||
| testImplementation(libs.bundles.spock) |
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.
We can delete groovy and spock :)
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.
done
| CompilationUnit javaFile; | ||
| try { | ||
| javaFile = parseJavaFile(file); | ||
| } catch (FileNotFoundException e) { | ||
| throw new RuntimeException(e); | ||
| } |
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.
minor: I think we not need to wrap with try/catch in tests, we can simply propagate exceptions via throws ddeclaration.
| if (javaFile.getParsed() != Node.Parsedness.PARSED) { | ||
| throw new IllegalStateException("Failed to parse file: " + file); | ||
| } |
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 believe this should be assertEquals()?
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.
done
| Method enabled = null; | ||
| Set<String> enabledArgs = null; | ||
| Object[] enabledDeclaration = getEnabledDeclaration(targetType, interfaces); | ||
| if (enabledDeclaration != null) { | ||
| enabled = (Method) enabledDeclaration[0]; | ||
| enabledArgs = (Set<String>) enabledDeclaration[1]; | ||
| } |
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.
not sure that we need to have check for null in test?
Groovy code had no checks...
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.
Groovy code was using a tuple for returning 2 objects and it was converted to a object array.
I don't see a problem here, the method can return null and assignment to the local var is only done when != null
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
What Does This Do
Migration from Groovy to Java for unit tests
Motivation
Additional Notes
Tests run using:
./gradlew :buildSrc:call-site-instrumentation-plugin:test -PrunBuildSrcTestsTo review migration groovy -> java use this commit
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]