Improve Call Site Instrumenter Gradle plugin#6988
Merged
PerfectSlayer merged 6 commits intomasterfrom May 7, 2024
Merged
Conversation
This reporter simplifies the error handling into the gradle plugin and prevent Project/OutputStream serialization that blocks Gradle configuration cache mechanism
Avoid serializing heavy objects that blocks Gradle configuration cache. Simplify error handling to get the same result without exit code / doLast tricks.
Use the right types for extension in addition to providers/properties
:dd-java-agent requires :dd-java-agent:agent-crashtracking for packaging while :dd-java-agent:agent-crashtracking requires :dd-java-agent for testing
4c291d7 to
a6a76f4
Compare
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 49 metrics, 14 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.34.0-SNAPSHOT~a6a76f4bdb, baseline=1.34.0-SNAPSHOT~154b90a742
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.084 s) : 0, 1084137
Total [baseline] (10.5 s) : 0, 10500092
Agent [candidate] (1.089 s) : 0, 1089270
Total [candidate] (10.43 s) : 0, 10429985
section appsec
Agent [baseline] (1.194 s) : 0, 1193716
Total [baseline] (10.514 s) : 0, 10514130
Agent [candidate] (1.192 s) : 0, 1192362
Total [candidate] (10.516 s) : 0, 10516448
section iast
Agent [baseline] (1.21 s) : 0, 1209630
Total [baseline] (10.739 s) : 0, 10739043
Agent [candidate] (1.208 s) : 0, 1208053
Total [candidate] (10.767 s) : 0, 10767278
section profiling
Agent [baseline] (1.277 s) : 0, 1277364
Total [baseline] (10.597 s) : 0, 10597045
Agent [candidate] (1.283 s) : 0, 1283419
Total [candidate] (10.653 s) : 0, 10653414
gantt
title petclinic - break down per module: candidate=1.34.0-SNAPSHOT~a6a76f4bdb, baseline=1.34.0-SNAPSHOT~154b90a742
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (679.358 ms) : 0, 679358
BytebuddyAgent [candidate] (682.902 ms) : 0, 682902
GlobalTracer [baseline] (312.178 ms) : 0, 312178
GlobalTracer [candidate] (313.363 ms) : 0, 313363
AppSec [baseline] (49.723 ms) : 0, 49723
AppSec [candidate] (49.864 ms) : 0, 49864
Remote Config [baseline] (664.489 µs) : 0, 664
Remote Config [candidate] (676.811 µs) : 0, 677
Telemetry [baseline] (7.674 ms) : 0, 7674
Telemetry [candidate] (7.608 ms) : 0, 7608
section appsec
BytebuddyAgent [baseline] (698.782 ms) : 0, 698782
BytebuddyAgent [candidate] (696.949 ms) : 0, 696949
GlobalTracer [baseline] (291.641 ms) : 0, 291641
GlobalTracer [candidate] (292.579 ms) : 0, 292579
AppSec [baseline] (149.718 ms) : 0, 149718
AppSec [candidate] (149.539 ms) : 0, 149539
Remote Config [baseline] (621.649 µs) : 0, 622
Remote Config [candidate] (622.061 µs) : 0, 622
Telemetry [baseline] (8.782 ms) : 0, 8782
Telemetry [candidate] (8.513 ms) : 0, 8513
IAST [baseline] (19.401 ms) : 0, 19401
IAST [candidate] (19.456 ms) : 0, 19456
section iast
BytebuddyAgent [baseline] (801.858 ms) : 0, 801858
BytebuddyAgent [candidate] (800.179 ms) : 0, 800179
GlobalTracer [baseline] (290.441 ms) : 0, 290441
GlobalTracer [candidate] (290.253 ms) : 0, 290253
AppSec [baseline] (50.676 ms) : 0, 50676
AppSec [candidate] (50.611 ms) : 0, 50611
Remote Config [baseline] (636.802 µs) : 0, 637
Remote Config [candidate] (589.566 µs) : 0, 590
Telemetry [baseline] (6.54 ms) : 0, 6540
Telemetry [candidate] (7.366 ms) : 0, 7366
IAST [baseline] (24.815 ms) : 0, 24815
IAST [candidate] (24.424 ms) : 0, 24424
section profiling
ProfilingAgent [baseline] (96.405 ms) : 0, 96405
ProfilingAgent [candidate] (97.844 ms) : 0, 97844
BytebuddyAgent [baseline] (683.265 ms) : 0, 683265
BytebuddyAgent [candidate] (685.904 ms) : 0, 685904
GlobalTracer [baseline] (381.959 ms) : 0, 381959
GlobalTracer [candidate] (383.821 ms) : 0, 383821
AppSec [baseline] (50.393 ms) : 0, 50393
AppSec [candidate] (50.539 ms) : 0, 50539
Remote Config [baseline] (710.854 µs) : 0, 711
Remote Config [candidate] (723.09 µs) : 0, 723
Telemetry [baseline] (7.532 ms) : 0, 7532
Telemetry [candidate] (7.612 ms) : 0, 7612
Profiling [baseline] (96.429 ms) : 0, 96429
Profiling [candidate] (97.868 ms) : 0, 97868
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.34.0-SNAPSHOT~a6a76f4bdb, baseline=1.34.0-SNAPSHOT~154b90a742
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.077 s) : 0, 1077028
Total [baseline] (8.54 s) : 0, 8540062
Agent [candidate] (1.076 s) : 0, 1076445
Total [candidate] (8.541 s) : 0, 8541218
section iast
Agent [baseline] (1.2 s) : 0, 1200273
Total [baseline] (8.999 s) : 0, 8999207
Agent [candidate] (1.217 s) : 0, 1217368
Total [candidate] (9.015 s) : 0, 9014694
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.198 s) : 0, 1198406
Total [baseline] (8.97 s) : 0, 8970476
Agent [candidate] (1.199 s) : 0, 1198623
Total [candidate] (8.98 s) : 0, 8980192
section iast_TELEMETRY_OFF
Agent [baseline] (1.2 s) : 0, 1199567
Total [baseline] (9.017 s) : 0, 9017317
Agent [candidate] (1.197 s) : 0, 1196580
Total [candidate] (9.035 s) : 0, 9035222
gantt
title insecure-bank - break down per module: candidate=1.34.0-SNAPSHOT~a6a76f4bdb, baseline=1.34.0-SNAPSHOT~154b90a742
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (675.052 ms) : 0, 675052
BytebuddyAgent [candidate] (674.369 ms) : 0, 674369
GlobalTracer [baseline] (310.086 ms) : 0, 310086
GlobalTracer [candidate] (309.909 ms) : 0, 309909
AppSec [baseline] (49.372 ms) : 0, 49372
AppSec [candidate] (49.407 ms) : 0, 49407
Remote Config [baseline] (652.826 µs) : 0, 653
Remote Config [candidate] (666.782 µs) : 0, 667
Telemetry [baseline] (7.47 ms) : 0, 7470
Telemetry [candidate] (7.623 ms) : 0, 7623
section iast
BytebuddyAgent [baseline] (795.119 ms) : 0, 795119
BytebuddyAgent [candidate] (806.615 ms) : 0, 806615
GlobalTracer [baseline] (288.434 ms) : 0, 288434
GlobalTracer [candidate] (292.379 ms) : 0, 292379
AppSec [baseline] (51.106 ms) : 0, 51106
AppSec [candidate] (51.654 ms) : 0, 51654
IAST [baseline] (24.119 ms) : 0, 24119
IAST [candidate] (24.512 ms) : 0, 24512
Remote Config [baseline] (563.847 µs) : 0, 564
Remote Config [candidate] (573.934 µs) : 0, 574
Telemetry [baseline] (6.546 ms) : 0, 6546
Telemetry [candidate] (6.69 ms) : 0, 6690
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (792.993 ms) : 0, 792993
BytebuddyAgent [candidate] (794.34 ms) : 0, 794340
GlobalTracer [baseline] (287.706 ms) : 0, 287706
GlobalTracer [candidate] (287.795 ms) : 0, 287795
AppSec [baseline] (51.06 ms) : 0, 51060
AppSec [candidate] (50.525 ms) : 0, 50525
IAST [baseline] (24.313 ms) : 0, 24313
IAST [candidate] (24.442 ms) : 0, 24442
Remote Config [baseline] (1.366 ms) : 0, 1366
Remote Config [candidate] (575.385 µs) : 0, 575
Telemetry [baseline] (6.664 ms) : 0, 6664
Telemetry [candidate] (6.627 ms) : 0, 6627
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (794.208 ms) : 0, 794208
BytebuddyAgent [candidate] (791.793 ms) : 0, 791793
GlobalTracer [baseline] (289.023 ms) : 0, 289023
GlobalTracer [candidate] (288.637 ms) : 0, 288637
AppSec [baseline] (50.401 ms) : 0, 50401
AppSec [candidate] (50.312 ms) : 0, 50312
IAST [baseline] (23.613 ms) : 0, 23613
IAST [candidate] (22.911 ms) : 0, 22911
Remote Config [baseline] (576.976 µs) : 0, 577
Remote Config [candidate] (575.627 µs) : 0, 576
Telemetry [baseline] (7.293 ms) : 0, 7293
Telemetry [candidate] (8.042 ms) : 0, 8042
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 13 metrics, 15 unstable metrics. Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.34.0-SNAPSHOT~a6a76f4bdb, baseline=1.34.0-SNAPSHOT~154b90a742
dateFormat X
axisFormat %s
section baseline
no_agent (375.694 µs) : 356, 395
. : milestone, 376,
iast (487.565 µs) : 467, 508
. : milestone, 488,
iast_FULL (551.154 µs) : 530, 572
. : milestone, 551,
iast_GLOBAL (510.084 µs) : 488, 532
. : milestone, 510,
iast_HARDCODED_SECRET_DISABLED (484.066 µs) : 463, 506
. : milestone, 484,
iast_INACTIVE (454.277 µs) : 434, 475
. : milestone, 454,
iast_TELEMETRY_OFF (479.488 µs) : 458, 501
. : milestone, 479,
tracing (445.355 µs) : 425, 465
. : milestone, 445,
section candidate
no_agent (381.122 µs) : 362, 401
. : milestone, 381,
iast (481.15 µs) : 461, 502
. : milestone, 481,
iast_FULL (545.388 µs) : 525, 566
. : milestone, 545,
iast_GLOBAL (499.054 µs) : 478, 520
. : milestone, 499,
iast_HARDCODED_SECRET_DISABLED (482.873 µs) : 461, 505
. : milestone, 483,
iast_INACTIVE (474.581 µs) : 453, 496
. : milestone, 475,
iast_TELEMETRY_OFF (479.572 µs) : 458, 501
. : milestone, 480,
tracing (449.101 µs) : 429, 469
. : milestone, 449,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.34.0-SNAPSHOT~a6a76f4bdb, baseline=1.34.0-SNAPSHOT~154b90a742
dateFormat X
axisFormat %s
section baseline
no_agent (1.35 ms) : 1330, 1371
. : milestone, 1350,
appsec (1.747 ms) : 1723, 1771
. : milestone, 1747,
appsec_no_iast (1.736 ms) : 1712, 1760
. : milestone, 1736,
iast (1.495 ms) : 1472, 1518
. : milestone, 1495,
profiling (1.534 ms) : 1508, 1560
. : milestone, 1534,
tracing (1.489 ms) : 1463, 1514
. : milestone, 1489,
section candidate
no_agent (1.35 ms) : 1330, 1369
. : milestone, 1350,
appsec (1.71 ms) : 1685, 1734
. : milestone, 1710,
appsec_no_iast (1.734 ms) : 1710, 1758
. : milestone, 1734,
iast (1.49 ms) : 1468, 1513
. : milestone, 1490,
profiling (1.513 ms) : 1488, 1538
. : milestone, 1513,
tracing (1.508 ms) : 1484, 1532
. : milestone, 1508,
Dacapo |
dougqh
approved these changes
May 6, 2024
manuel-alvarez-alvarez
approved these changes
May 6, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
This PR implements the Call Site Instrumenter Gradle plugin using Kotlin and latest Gradle convention.
It also clearly documents its usage by having an extension (the Gradle way of configuring plugin) both documented and using the right types.
Most of the changes, other than using recommended API, are done with (build) performance and simplification in mind.
Like the new
ERROR_CONSOLEreporter that will only report error, preventing the Java process exit code trick and OutputStream serialization to redirect console (it now uses the default expected behavior of theJavaExectasks and will no more report empty logs during the build).Motivation
This makes our custom plugin compatible with the latest version of Gradle and its incoming features like configuration cache. Moreover, it was deprecated to use Groovy to implement Gradle plugins for performance reasons and the plugin was not able to fully compile using
@CompileStatic.Additional Notes
Jira ticket: [PROJ-IDENT]
Commits will be squashed at merged.