-
Notifications
You must be signed in to change notification settings - Fork 292
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
Instrument Gradle Launcher to avoid overwriting org.gradle.jvmargs property #8001
Instrument Gradle Launcher to avoid overwriting org.gradle.jvmargs property #8001
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 52 metrics, 10 unstable metrics.
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.43.0-SNAPSHOT~73d15fc31b, baseline=1.43.0-SNAPSHOT~79ca6e471f
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.109 s) : 0, 1109489
Total [baseline] (8.768 s) : 0, 8767976
Agent [candidate] (1.089 s) : 0, 1089364
Total [candidate] (8.666 s) : 0, 8665627
section iast
Agent [baseline] (1.217 s) : 0, 1216961
Total [baseline] (9.205 s) : 0, 9204708
Agent [candidate] (1.218 s) : 0, 1217802
Total [candidate] (9.2 s) : 0, 9200370
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.234 s) : 0, 1234207
Total [baseline] (9.259 s) : 0, 9258858
Agent [candidate] (1.216 s) : 0, 1215974
Total [candidate] (9.164 s) : 0, 9164140
section iast_TELEMETRY_OFF
Agent [baseline] (1.221 s) : 0, 1220776
Total [baseline] (9.265 s) : 0, 9264562
Agent [candidate] (1.213 s) : 0, 1212726
Total [candidate] (9.235 s) : 0, 9235014
gantt
title insecure-bank - break down per module: candidate=1.43.0-SNAPSHOT~73d15fc31b, baseline=1.43.0-SNAPSHOT~79ca6e471f
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (705.549 ms) : 0, 705549
BytebuddyAgent [candidate] (692.013 ms) : 0, 692013
GlobalTracer [baseline] (321.985 ms) : 0, 321985
GlobalTracer [candidate] (317.039 ms) : 0, 317039
AppSec [baseline] (55.557 ms) : 0, 55557
AppSec [candidate] (54.7 ms) : 0, 54700
Remote Config [baseline] (691.865 µs) : 0, 692
Remote Config [candidate] (686.122 µs) : 0, 686
Telemetry [baseline] (11.618 ms) : 0, 11618
Telemetry [candidate] (11.228 ms) : 0, 11228
section iast
BytebuddyAgent [baseline] (809.107 ms) : 0, 809107
BytebuddyAgent [candidate] (812.431 ms) : 0, 812431
GlobalTracer [baseline] (307.221 ms) : 0, 307221
GlobalTracer [candidate] (305.685 ms) : 0, 305685
AppSec [baseline] (57.245 ms) : 0, 57245
AppSec [candidate] (56.585 ms) : 0, 56585
IAST [baseline] (21.581 ms) : 0, 21581
IAST [candidate] (21.326 ms) : 0, 21326
Remote Config [baseline] (610.449 µs) : 0, 610
Remote Config [candidate] (599.568 µs) : 0, 600
Telemetry [baseline] (7.458 ms) : 0, 7458
Telemetry [candidate] (7.346 ms) : 0, 7346
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (820.265 ms) : 0, 820265
BytebuddyAgent [candidate] (809.215 ms) : 0, 809215
GlobalTracer [baseline] (312.124 ms) : 0, 312124
GlobalTracer [candidate] (306.527 ms) : 0, 306527
AppSec [baseline] (58.284 ms) : 0, 58284
AppSec [candidate] (57.66 ms) : 0, 57660
IAST [baseline] (21.354 ms) : 0, 21354
IAST [candidate] (20.714 ms) : 0, 20714
Remote Config [baseline] (636.03 µs) : 0, 636
Remote Config [candidate] (617.839 µs) : 0, 618
Telemetry [baseline] (7.677 ms) : 0, 7677
Telemetry [candidate] (7.518 ms) : 0, 7518
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (811.149 ms) : 0, 811149
BytebuddyAgent [candidate] (805.689 ms) : 0, 805689
GlobalTracer [baseline] (308.545 ms) : 0, 308545
GlobalTracer [candidate] (306.541 ms) : 0, 306541
AppSec [baseline] (58.384 ms) : 0, 58384
AppSec [candidate] (57.432 ms) : 0, 57432
IAST [baseline] (20.79 ms) : 0, 20790
IAST [candidate] (21.288 ms) : 0, 21288
Remote Config [baseline] (637.114 µs) : 0, 637
Remote Config [candidate] (618.757 µs) : 0, 619
Telemetry [baseline] (7.557 ms) : 0, 7557
Telemetry [candidate] (7.456 ms) : 0, 7456
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.43.0-SNAPSHOT~73d15fc31b, baseline=1.43.0-SNAPSHOT~79ca6e471f
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.092 s) : 0, 1092051
Total [baseline] (10.445 s) : 0, 10444551
Agent [candidate] (1.091 s) : 0, 1090642
Total [candidate] (10.45 s) : 0, 10450300
section appsec
Agent [baseline] (1.222 s) : 0, 1222401
Total [baseline] (10.739 s) : 0, 10738802
Agent [candidate] (1.223 s) : 0, 1222621
Total [candidate] (10.743 s) : 0, 10742788
section iast
Agent [baseline] (1.215 s) : 0, 1214529
Total [baseline] (10.886 s) : 0, 10886395
Agent [candidate] (1.225 s) : 0, 1224630
Total [candidate] (10.956 s) : 0, 10956340
section profiling
Agent [baseline] (1.316 s) : 0, 1315887
Total [baseline] (10.797 s) : 0, 10796597
Agent [candidate] (1.287 s) : 0, 1287478
Total [candidate] (10.854 s) : 0, 10853937
gantt
title petclinic - break down per module: candidate=1.43.0-SNAPSHOT~73d15fc31b, baseline=1.43.0-SNAPSHOT~79ca6e471f
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (691.842 ms) : 0, 691842
BytebuddyAgent [candidate] (693.001 ms) : 0, 693001
GlobalTracer [baseline] (319.039 ms) : 0, 319039
GlobalTracer [candidate] (318.029 ms) : 0, 318029
AppSec [baseline] (54.81 ms) : 0, 54810
AppSec [candidate] (54.613 ms) : 0, 54613
Remote Config [baseline] (696.144 µs) : 0, 696
Remote Config [candidate] (682.455 µs) : 0, 682
Telemetry [baseline] (11.973 ms) : 0, 11973
Telemetry [candidate] (10.57 ms) : 0, 10570
section appsec
BytebuddyAgent [baseline] (708.946 ms) : 0, 708946
BytebuddyAgent [candidate] (709.143 ms) : 0, 709143
GlobalTracer [baseline] (314.517 ms) : 0, 314517
GlobalTracer [candidate] (314.401 ms) : 0, 314401
AppSec [baseline] (166.666 ms) : 0, 166666
AppSec [candidate] (166.63 ms) : 0, 166630
IAST [baseline] (19.496 ms) : 0, 19496
IAST [candidate] (21.23 ms) : 0, 21230
Remote Config [baseline] (638.312 µs) : 0, 638
Remote Config [candidate] (637.914 µs) : 0, 638
Telemetry [baseline] (8.206 ms) : 0, 8206
Telemetry [candidate] (7.504 ms) : 0, 7504
section iast
BytebuddyAgent [baseline] (807.305 ms) : 0, 807305
BytebuddyAgent [candidate] (814.995 ms) : 0, 814995
GlobalTracer [baseline] (306.714 ms) : 0, 306714
GlobalTracer [candidate] (307.91 ms) : 0, 307910
AppSec [baseline] (57.203 ms) : 0, 57203
AppSec [candidate] (56.939 ms) : 0, 56939
IAST [baseline] (21.529 ms) : 0, 21529
IAST [candidate] (22.78 ms) : 0, 22780
Remote Config [baseline] (613.092 µs) : 0, 613
Remote Config [candidate] (622.476 µs) : 0, 622
Telemetry [baseline] (7.46 ms) : 0, 7460
Telemetry [candidate] (7.594 ms) : 0, 7594
section profiling
BytebuddyAgent [baseline] (685.883 ms) : 0, 685883
BytebuddyAgent [candidate] (686.284 ms) : 0, 686284
GlobalTracer [baseline] (435.936 ms) : 0, 435936
GlobalTracer [candidate] (401.266 ms) : 0, 401266
AppSec [baseline] (53.799 ms) : 0, 53799
AppSec [candidate] (55.162 ms) : 0, 55162
Remote Config [baseline] (649.781 µs) : 0, 650
Remote Config [candidate] (1.338 ms) : 0, 1338
Telemetry [baseline] (7.713 ms) : 0, 7713
Telemetry [candidate] (12.038 ms) : 0, 12038
ProfilingAgent [baseline] (92.993 ms) : 0, 92993
ProfilingAgent [candidate] (92.332 ms) : 0, 92332
Profiling [baseline] (93.016 ms) : 0, 93016
Profiling [candidate] (92.356 ms) : 0, 92356
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 11 metrics, 16 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.43.0-SNAPSHOT~73d15fc31b, baseline=1.43.0-SNAPSHOT~79ca6e471f
dateFormat X
axisFormat %s
section baseline
no_agent (366.815 µs) : 347, 386
. : milestone, 367,
iast (481.405 µs) : 460, 503
. : milestone, 481,
iast_FULL (644.999 µs) : 624, 666
. : milestone, 645,
iast_GLOBAL (516.815 µs) : 495, 539
. : milestone, 517,
iast_HARDCODED_SECRET_DISABLED (486.572 µs) : 465, 508
. : milestone, 487,
iast_INACTIVE (444.994 µs) : 424, 466
. : milestone, 445,
iast_TELEMETRY_OFF (483.657 µs) : 462, 506
. : milestone, 484,
tracing (444.75 µs) : 424, 466
. : milestone, 445,
section candidate
no_agent (374.149 µs) : 355, 394
. : milestone, 374,
iast (488.852 µs) : 466, 511
. : milestone, 489,
iast_FULL (640.37 µs) : 619, 662
. : milestone, 640,
iast_GLOBAL (516.178 µs) : 494, 538
. : milestone, 516,
iast_HARDCODED_SECRET_DISABLED (489.004 µs) : 467, 511
. : milestone, 489,
iast_INACTIVE (452.156 µs) : 431, 474
. : milestone, 452,
iast_TELEMETRY_OFF (473.04 µs) : 452, 494
. : milestone, 473,
tracing (442.689 µs) : 422, 463
. : milestone, 443,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.43.0-SNAPSHOT~73d15fc31b, baseline=1.43.0-SNAPSHOT~79ca6e471f
dateFormat X
axisFormat %s
section baseline
no_agent (1.339 ms) : 1320, 1359
. : milestone, 1339,
appsec (1.764 ms) : 1740, 1787
. : milestone, 1764,
appsec_no_iast (1.764 ms) : 1740, 1788
. : milestone, 1764,
iast (1.48 ms) : 1458, 1503
. : milestone, 1480,
profiling (1.501 ms) : 1478, 1524
. : milestone, 1501,
tracing (1.477 ms) : 1452, 1502
. : milestone, 1477,
section candidate
no_agent (1.349 ms) : 1330, 1369
. : milestone, 1349,
appsec (1.748 ms) : 1725, 1772
. : milestone, 1748,
appsec_no_iast (1.737 ms) : 1712, 1762
. : milestone, 1737,
iast (1.494 ms) : 1472, 1516
. : milestone, 1494,
profiling (1.572 ms) : 1547, 1597
. : milestone, 1572,
tracing (1.501 ms) : 1477, 1526
. : milestone, 1501,
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.43.0-SNAPSHOT~73d15fc31b, baseline=1.43.0-SNAPSHOT~79ca6e471f
dateFormat X
axisFormat %s
section baseline
no_agent (1.466 ms) : 1455, 1477
. : milestone, 1466,
appsec (2.327 ms) : 2286, 2368
. : milestone, 2327,
iast (2.079 ms) : 2027, 2131
. : milestone, 2079,
iast_GLOBAL (2.116 ms) : 2064, 2168
. : milestone, 2116,
profiling (1.948 ms) : 1907, 1990
. : milestone, 1948,
tracing (1.925 ms) : 1885, 1965
. : milestone, 1925,
section candidate
no_agent (1.465 ms) : 1454, 1477
. : milestone, 1465,
appsec (2.329 ms) : 2288, 2370
. : milestone, 2329,
iast (2.073 ms) : 2021, 2125
. : milestone, 2073,
iast_GLOBAL (2.114 ms) : 2061, 2166
. : milestone, 2114,
profiling (1.931 ms) : 1890, 1972
. : milestone, 1931,
tracing (1.915 ms) : 1875, 1955
. : milestone, 1915,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.43.0-SNAPSHOT~73d15fc31b, baseline=1.43.0-SNAPSHOT~79ca6e471f
dateFormat X
axisFormat %s
section baseline
no_agent (14.92 s) : 14920000, 14920000
. : milestone, 14920000,
appsec (14.998 s) : 14998000, 14998000
. : milestone, 14998000,
iast (18.755 s) : 18755000, 18755000
. : milestone, 18755000,
iast_GLOBAL (17.963 s) : 17963000, 17963000
. : milestone, 17963000,
profiling (14.818 s) : 14818000, 14818000
. : milestone, 14818000,
tracing (14.896 s) : 14896000, 14896000
. : milestone, 14896000,
section candidate
no_agent (14.891 s) : 14891000, 14891000
. : milestone, 14891000,
appsec (14.863 s) : 14863000, 14863000
. : milestone, 14863000,
iast (18.708 s) : 18708000, 18708000
. : milestone, 18708000,
iast_GLOBAL (17.912 s) : 17912000, 17912000
. : milestone, 17912000,
profiling (14.934 s) : 14934000, 14934000
. : milestone, 14934000,
tracing (14.943 s) : 14943000, 14943000
. : milestone, 14943000,
|
…er in the file or via command line
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
Fixes a problem with Gradle Daemon auto-instrumentation.
Our auto-instrumentation works by modifying the
GRADLE_OPTS
environment property.This property controls JVM options used for starting Gradle Launcher.
Gradle Launcher is a wrapper that is started when
gradle
orgradlew
command is run.The launcher itself does not execute Gradle builds, however.
The builds are executed by the Gradle Daemon, which is a long-running process that runs in the background and that is started by the launcher.
The properties of the JVM that runs Gradle Daemon can be controlled with
org.gradle.jvmargs
system property of the launcher.Which is why existing auto-instrumentation logic sets
GRADLE_OPTS=-Dorg.gradle.jvmargs=-javaagent:<TRACER_PATH>
.This works, but the problem with this approach is that
org.gradle.jvmargs
that is set like this in the command line overwritesorg.gradle.jvmargs
that may be set elsewhere.Usually
org.gradle.jvmargs
is set insidegradle.properties
file that lives in the root folder of a Gradle project.It is often used to set max heap size and other important properties for the Gradle daemon, so auto-instrumentation over-writing it can cause build failure.
The updated tracer instruments the Gradle Launcher, and automatically injects itself into the daemon when the launcher forks it.
This allows setting
GRADLE_OPTS=-javaagent:...
instead ofGRADLE_OPTS=-Dorg.gradle.jvmargs=-javaagent:...
, preservingorg.gradle.jvmargs
value.Motivation
To avoid overriding the users' Gradle Daemon JVM settings when auto-instrumentation is used.
Contributor Checklist
type:
and (comp:
orinst:
) labels in addition to any usefull labelsclose
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: SCV-208