-
Notifications
You must be signed in to change notification settings - Fork 318
Refactor muzzle tasks to dedicated classes, make Muzzletask cacheable #9544
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
Conversation
Note, this only caches the muzzle assertion, tasks are being still registered depending on what is brought back from maven. I.e. if a new dependency is discovered a new task will be registered and as such will be executed.
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
|
🎯 Code Coverage 🔗 Commit SHA: cb1388a | Docs | Was this helpful? Give us feedback! |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 56 metrics, 9 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.54.0-SNAPSHOT~cb1388adb7, baseline=1.54.0-SNAPSHOT~bd72002abf
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.022 s) : 0, 1021598
Total [baseline] (10.708 s) : 0, 10708489
Agent [candidate] (1.023 s) : 0, 1022928
Total [candidate] (10.765 s) : 0, 10765164
section appsec
Agent [baseline] (1.193 s) : 0, 1193132
Total [baseline] (11.015 s) : 0, 11014715
Agent [candidate] (1.193 s) : 0, 1193312
Total [candidate] (11.079 s) : 0, 11078941
section iast
Agent [baseline] (1.15 s) : 0, 1149745
Total [baseline] (11.073 s) : 0, 11072917
Agent [candidate] (1.148 s) : 0, 1147606
Total [candidate] (10.779 s) : 0, 10778967
section profiling
Agent [baseline] (1.17 s) : 0, 1169695
Total [baseline] (11.103 s) : 0, 11102592
Agent [candidate] (1.164 s) : 0, 1164130
Total [candidate] (11.008 s) : 0, 11007589
gantt
title petclinic - break down per module: candidate=1.54.0-SNAPSHOT~cb1388adb7, baseline=1.54.0-SNAPSHOT~bd72002abf
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.475 ms) : 0, 1475
crashtracking [candidate] (1.466 ms) : 0, 1466
BytebuddyAgent [baseline] (694.726 ms) : 0, 694726
BytebuddyAgent [candidate] (695.978 ms) : 0, 695978
GlobalTracer [baseline] (243.985 ms) : 0, 243985
GlobalTracer [candidate] (244.482 ms) : 0, 244482
AppSec [baseline] (32.779 ms) : 0, 32779
AppSec [candidate] (33.112 ms) : 0, 33112
Debugger [baseline] (6.367 ms) : 0, 6367
Debugger [candidate] (6.493 ms) : 0, 6493
Remote Config [baseline] (717.544 µs) : 0, 718
Remote Config [candidate] (696.301 µs) : 0, 696
Telemetry [baseline] (9.109 ms) : 0, 9109
Telemetry [candidate] (9.168 ms) : 0, 9168
Flare Poller [baseline] (11.061 ms) : 0, 11061
Flare Poller [candidate] (10.162 ms) : 0, 10162
section appsec
crashtracking [baseline] (1.476 ms) : 0, 1476
crashtracking [candidate] (1.454 ms) : 0, 1454
BytebuddyAgent [baseline] (716.407 ms) : 0, 716407
BytebuddyAgent [candidate] (716.42 ms) : 0, 716420
GlobalTracer [baseline] (235.429 ms) : 0, 235429
GlobalTracer [candidate] (235.618 ms) : 0, 235618
IAST [baseline] (24.765 ms) : 0, 24765
IAST [candidate] (24.954 ms) : 0, 24954
AppSec [baseline] (173.183 ms) : 0, 173183
AppSec [candidate] (173.131 ms) : 0, 173131
Debugger [baseline] (6.02 ms) : 0, 6020
Debugger [candidate] (6.034 ms) : 0, 6034
Remote Config [baseline] (652.448 µs) : 0, 652
Remote Config [candidate] (637.944 µs) : 0, 638
Telemetry [baseline] (9.208 ms) : 0, 9208
Telemetry [candidate] (9.899 ms) : 0, 9899
Flare Poller [baseline] (4.793 ms) : 0, 4793
Flare Poller [candidate] (3.992 ms) : 0, 3992
section iast
crashtracking [baseline] (1.504 ms) : 0, 1504
crashtracking [candidate] (1.455 ms) : 0, 1455
BytebuddyAgent [baseline] (812.883 ms) : 0, 812883
BytebuddyAgent [candidate] (811.851 ms) : 0, 811851
GlobalTracer [baseline] (233.286 ms) : 0, 233286
GlobalTracer [candidate] (232.985 ms) : 0, 232985
IAST [baseline] (26.382 ms) : 0, 26382
IAST [candidate] (26.193 ms) : 0, 26193
AppSec [baseline] (35.01 ms) : 0, 35010
AppSec [candidate] (34.835 ms) : 0, 34835
Debugger [baseline] (6.068 ms) : 0, 6068
Debugger [candidate] (6.031 ms) : 0, 6031
Remote Config [baseline] (597.683 µs) : 0, 598
Remote Config [candidate] (595.849 µs) : 0, 596
Telemetry [baseline] (8.384 ms) : 0, 8384
Telemetry [candidate] (8.147 ms) : 0, 8147
Flare Poller [baseline] (4.255 ms) : 0, 4255
Flare Poller [candidate] (4.21 ms) : 0, 4210
section profiling
crashtracking [baseline] (1.439 ms) : 0, 1439
crashtracking [candidate] (1.421 ms) : 0, 1421
BytebuddyAgent [baseline] (726.258 ms) : 0, 726258
BytebuddyAgent [candidate] (721.645 ms) : 0, 721645
GlobalTracer [baseline] (219.952 ms) : 0, 219952
GlobalTracer [candidate] (219.779 ms) : 0, 219779
AppSec [baseline] (33.096 ms) : 0, 33096
AppSec [candidate] (32.774 ms) : 0, 32774
Debugger [baseline] (8.128 ms) : 0, 8128
Debugger [candidate] (6.658 ms) : 0, 6658
Remote Config [baseline] (795.389 µs) : 0, 795
Remote Config [candidate] (844.837 µs) : 0, 845
Telemetry [baseline] (14.123 ms) : 0, 14123
Telemetry [candidate] (16.326 ms) : 0, 16326
Flare Poller [baseline] (4.997 ms) : 0, 4997
Flare Poller [candidate] (4.175 ms) : 0, 4175
ProfilingAgent [baseline] (106.985 ms) : 0, 106985
ProfilingAgent [candidate] (105.019 ms) : 0, 105019
Profiling [baseline] (108.457 ms) : 0, 108457
Profiling [candidate] (108.643 ms) : 0, 108643
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.54.0-SNAPSHOT~cb1388adb7, baseline=1.54.0-SNAPSHOT~bd72002abf
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.023 s) : 0, 1022867
Total [baseline] (8.676 s) : 0, 8675681
Agent [candidate] (1.023 s) : 0, 1023470
Total [candidate] (8.7 s) : 0, 8699978
section iast
Agent [baseline] (1.152 s) : 0, 1151962
Total [baseline] (9.281 s) : 0, 9280733
Agent [candidate] (1.155 s) : 0, 1155160
Total [candidate] (9.256 s) : 0, 9255683
gantt
title insecure-bank - break down per module: candidate=1.54.0-SNAPSHOT~cb1388adb7, baseline=1.54.0-SNAPSHOT~bd72002abf
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.476 ms) : 0, 1476
crashtracking [candidate] (1.474 ms) : 0, 1474
BytebuddyAgent [baseline] (697.171 ms) : 0, 697171
BytebuddyAgent [candidate] (696.187 ms) : 0, 696187
GlobalTracer [baseline] (243.899 ms) : 0, 243899
GlobalTracer [candidate] (244.123 ms) : 0, 244123
AppSec [baseline] (32.81 ms) : 0, 32810
AppSec [candidate] (33.109 ms) : 0, 33109
Debugger [baseline] (6.432 ms) : 0, 6432
Debugger [candidate] (6.467 ms) : 0, 6467
Remote Config [baseline] (686.591 µs) : 0, 687
Remote Config [candidate] (689.864 µs) : 0, 690
Telemetry [baseline] (9.072 ms) : 0, 9072
Telemetry [candidate] (9.138 ms) : 0, 9138
Flare Poller [baseline] (10.097 ms) : 0, 10097
Flare Poller [candidate] (11.025 ms) : 0, 11025
section iast
crashtracking [baseline] (1.477 ms) : 0, 1477
crashtracking [candidate] (1.476 ms) : 0, 1476
BytebuddyAgent [baseline] (814.077 ms) : 0, 814077
BytebuddyAgent [candidate] (817.404 ms) : 0, 817404
GlobalTracer [baseline] (233.296 ms) : 0, 233296
GlobalTracer [candidate] (234.15 ms) : 0, 234150
AppSec [baseline] (35.599 ms) : 0, 35599
AppSec [candidate] (35.083 ms) : 0, 35083
Debugger [baseline] (6.105 ms) : 0, 6105
Debugger [candidate] (6.079 ms) : 0, 6079
Remote Config [baseline] (610.701 µs) : 0, 611
Remote Config [candidate] (598.422 µs) : 0, 598
Telemetry [baseline] (8.401 ms) : 0, 8401
Telemetry [candidate] (8.278 ms) : 0, 8278
Flare Poller [baseline] (4.272 ms) : 0, 4272
Flare Poller [candidate] (4.261 ms) : 0, 4261
IAST [baseline] (26.801 ms) : 0, 26801
IAST [candidate] (26.58 ms) : 0, 26580
LoadParameters
See matching parameters
SummaryFound 1 performance improvements and 4 performance regressions! Performance is the same for 7 metrics, 12 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.54.0-SNAPSHOT~cb1388adb7, baseline=1.54.0-SNAPSHOT~bd72002abf
dateFormat X
axisFormat %s
section baseline
no_agent (37.004 ms) : 36715, 37293
. : milestone, 37004,
appsec (49.032 ms) : 48596, 49467
. : milestone, 49032,
code_origins (45.536 ms) : 45138, 45935
. : milestone, 45536,
iast (46.346 ms) : 45951, 46742
. : milestone, 46346,
profiling (47.15 ms) : 46713, 47586
. : milestone, 47150,
tracing (44.545 ms) : 44162, 44928
. : milestone, 44545,
section candidate
no_agent (36.582 ms) : 36296, 36868
. : milestone, 36582,
appsec (49.159 ms) : 48732, 49586
. : milestone, 49159,
code_origins (43.854 ms) : 43468, 44240
. : milestone, 43854,
iast (46.943 ms) : 46544, 47343
. : milestone, 46943,
profiling (50.001 ms) : 49515, 50487
. : milestone, 50001,
tracing (44.033 ms) : 43656, 44411
. : milestone, 44033,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.54.0-SNAPSHOT~cb1388adb7, baseline=1.54.0-SNAPSHOT~bd72002abf
dateFormat X
axisFormat %s
section baseline
no_agent (4.237 ms) : 4189, 4284
. : milestone, 4237,
iast (9.649 ms) : 9487, 9811
. : milestone, 9649,
iast_FULL (15.073 ms) : 14774, 15373
. : milestone, 15073,
iast_GLOBAL (10.576 ms) : 10391, 10762
. : milestone, 10576,
profiling (8.859 ms) : 8714, 9004
. : milestone, 8859,
tracing (7.72 ms) : 7601, 7838
. : milestone, 7720,
section candidate
no_agent (4.484 ms) : 4433, 4535
. : milestone, 4484,
iast (9.882 ms) : 9716, 10049
. : milestone, 9882,
iast_FULL (14.598 ms) : 14302, 14893
. : milestone, 14598,
iast_GLOBAL (11.036 ms) : 10838, 11235
. : milestone, 11036,
profiling (9.166 ms) : 9020, 9312
. : milestone, 9166,
tracing (8.498 ms) : 8370, 8627
. : milestone, 8498,
DacapoParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 1 unstable metrics.
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.54.0-SNAPSHOT~cb1388adb7, baseline=1.54.0-SNAPSHOT~bd72002abf
dateFormat X
axisFormat %s
section baseline
no_agent (15.503 s) : 15503000, 15503000
. : milestone, 15503000,
appsec (15.354 s) : 15354000, 15354000
. : milestone, 15354000,
iast (18.478 s) : 18478000, 18478000
. : milestone, 18478000,
iast_GLOBAL (18.195 s) : 18195000, 18195000
. : milestone, 18195000,
profiling (15.676 s) : 15676000, 15676000
. : milestone, 15676000,
tracing (15.195 s) : 15195000, 15195000
. : milestone, 15195000,
section candidate
no_agent (15.491 s) : 15491000, 15491000
. : milestone, 15491000,
appsec (15.021 s) : 15021000, 15021000
. : milestone, 15021000,
iast (18.788 s) : 18788000, 18788000
. : milestone, 18788000,
iast_GLOBAL (17.605 s) : 17605000, 17605000
. : milestone, 17605000,
profiling (15.545 s) : 15545000, 15545000
. : milestone, 15545000,
tracing (14.988 s) : 14988000, 14988000
. : milestone, 14988000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.54.0-SNAPSHOT~cb1388adb7, baseline=1.54.0-SNAPSHOT~bd72002abf
dateFormat X
axisFormat %s
section baseline
no_agent (1.472 ms) : 1461, 1484
. : milestone, 1472,
appsec (3.631 ms) : 3417, 3845
. : milestone, 3631,
iast (2.206 ms) : 2142, 2270
. : milestone, 2206,
iast_GLOBAL (2.257 ms) : 2192, 2322
. : milestone, 2257,
profiling (2.506 ms) : 2335, 2677
. : milestone, 2506,
tracing (2.036 ms) : 1985, 2087
. : milestone, 2036,
section candidate
no_agent (1.476 ms) : 1464, 1488
. : milestone, 1476,
appsec (2.507 ms) : 2453, 2560
. : milestone, 2507,
iast (2.207 ms) : 2143, 2271
. : milestone, 2207,
iast_GLOBAL (2.245 ms) : 2180, 2310
. : milestone, 2245,
profiling (2.06 ms) : 2007, 2112
. : milestone, 2060,
tracing (2.034 ms) : 1984, 2085
. : milestone, 2034,
|
AlexeyKuznetsov-DD
left a comment
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.
Left several comments
buildSrc/src/main/kotlin/datadog/gradle/plugin/muzzle/tasks/AbstractMuzzleReportTask.kt
Outdated
Show resolved
Hide resolved
buildSrc/src/main/kotlin/datadog/gradle/plugin/muzzle/tasks/AbstractMuzzleReportTask.kt
Outdated
Show resolved
Hide resolved
buildSrc/src/main/kotlin/datadog/gradle/plugin/muzzle/tasks/MuzzleEndTask.kt
Outdated
Show resolved
Hide resolved
buildSrc/src/main/kotlin/datadog/gradle/plugin/muzzle/MuzzleDirective.kt
Show resolved
Hide resolved
buildSrc/src/main/kotlin/datadog/gradle/plugin/muzzle/tasks/MuzzleEndTask.kt
Show resolved
Hide resolved
buildSrc/src/main/kotlin/datadog/gradle/plugin/muzzle/tasks/MuzzleEndTask.kt
Outdated
Show resolved
Hide resolved
buildSrc/src/main/kotlin/datadog/gradle/plugin/muzzle/tasks/MuzzleEndTask.kt
Show resolved
Hide resolved
buildSrc/src/main/kotlin/datadog/gradle/plugin/muzzle/tasks/MuzzleEndTask.kt
Outdated
Show resolved
Hide resolved
…cated-class-tasks
PerfectSlayer
left a comment
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.
Looking good. Left one question along the review
buildSrc/src/main/kotlin/datadog/gradle/plugin/muzzle/tasks/MuzzleGetReferencesTask.kt
Show resolved
Hide resolved
…cated-class-tasks
What Does This Do
This PR fix this wrong definition of tasks by creating proper types for each task.
Also, this refactoring was an opportunity to properly declare inputs and output and make the
MuzzleTaskcacheable.The logic to create tasks is unchanged, i.e. tasks are still created from what maven repo gives back.
I.e. if the compiled code didn't change and the version coming back from maven
Follow-up to
MuzzlePlugin#9315Note
This only caches the muzzle assertion task, if the input don't change, tasks are being still registered depending on what is brought back from maven. That means that if a new dependency is discovered, a new task will be registered, and as such, it will appear in the task graph and executed.
Note the up-to-date when run a second time

Note that muzzle plugin actually fetches from maven the versions as asked in the directives



...
...
Also notice here the tasks for some versions that were not executed in an earlier run.
The

printReferenceswas also made cacheable.Motivation
Previous MuzzlePlugin was using
MuzzleTaskfor every muzzle tasks, however it wired services that were not related to every task. Since tasks were different, the plugin ran different action viadoLastand a call to some functions. This is a bad and confusing use of the Gradle API.Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any usefull labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]