Skip to content

Improve Call Site Instrumenter Gradle plugin#6988

Merged
PerfectSlayer merged 6 commits intomasterfrom
bbujon/fix-ci-build-cache
May 7, 2024
Merged

Improve Call Site Instrumenter Gradle plugin#6988
PerfectSlayer merged 6 commits intomasterfrom
bbujon/fix-ci-build-cache

Conversation

@PerfectSlayer
Copy link
Copy Markdown
Contributor

@PerfectSlayer PerfectSlayer commented May 3, 2024

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_CONSOLE reporter 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 the JavaExec tasks 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.

@PerfectSlayer PerfectSlayer added tag: no release notes Changes to exclude from release notes comp: tooling Build & Tooling labels May 3, 2024
@PerfectSlayer PerfectSlayer requested a review from a team as a code owner May 3, 2024 14:44
@PerfectSlayer PerfectSlayer requested review from am312 and dougqh May 3, 2024 14:44
@PerfectSlayer PerfectSlayer changed the title Bbujon/fix ci build cache Improve Call Site Instrumenter Gradle plugin May 3, 2024
@smola smola requested review from a team, manuel-alvarez-alvarez and smola May 6, 2024 07:38
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
@PerfectSlayer PerfectSlayer force-pushed the bbujon/fix-ci-build-cache branch from 4c291d7 to a6a76f4 Compare May 6, 2024 14:39
@PerfectSlayer PerfectSlayer requested a review from a team as a code owner May 6, 2024 14:39
@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented May 6, 2024

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master bbujon/fix-ci-build-cache
git_commit_date 1715000113 1715006288
git_commit_sha 154b90a a6a76f4
release_version 1.34.0-SNAPSHOT~154b90a742 1.34.0-SNAPSHOT~a6a76f4bdb
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1715009096 1715009096
ci_job_id 505051443 505051443
ci_pipeline_id 33664484 33664484
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
module Agent Agent
parent None None
variant iast iast

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 49 metrics, 14 unstable metrics.

Startup time reports for petclinic
gantt
    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
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.084 s -
Agent appsec 1.194 s 109.579 ms (10.1%)
Agent iast 1.21 s 125.493 ms (11.6%)
Agent profiling 1.277 s 193.226 ms (17.8%)
Total tracing 10.5 s -
Total appsec 10.514 s 14.038 ms (0.1%)
Total iast 10.739 s 238.951 ms (2.3%)
Total profiling 10.597 s 96.953 ms (0.9%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.089 s -
Agent appsec 1.192 s 103.092 ms (9.5%)
Agent iast 1.208 s 118.784 ms (10.9%)
Agent profiling 1.283 s 194.149 ms (17.8%)
Total tracing 10.43 s -
Total appsec 10.516 s 86.463 ms (0.8%)
Total iast 10.767 s 337.293 ms (3.2%)
Total profiling 10.653 s 223.429 ms (2.1%)
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
Loading
Startup time reports for insecure-bank
gantt
    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
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.077 s -
Agent iast 1.2 s 123.245 ms (11.4%)
Agent iast_HARDCODED_SECRET_DISABLED 1.198 s 121.378 ms (11.3%)
Agent iast_TELEMETRY_OFF 1.2 s 122.539 ms (11.4%)
Total tracing 8.54 s -
Total iast 8.999 s 459.145 ms (5.4%)
Total iast_HARDCODED_SECRET_DISABLED 8.97 s 430.414 ms (5.0%)
Total iast_TELEMETRY_OFF 9.017 s 477.254 ms (5.6%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.076 s -
Agent iast 1.217 s 140.923 ms (13.1%)
Agent iast_HARDCODED_SECRET_DISABLED 1.199 s 122.178 ms (11.4%)
Agent iast_TELEMETRY_OFF 1.197 s 120.136 ms (11.2%)
Total tracing 8.541 s -
Total iast 9.015 s 473.475 ms (5.5%)
Total iast_HARDCODED_SECRET_DISABLED 8.98 s 438.973 ms (5.1%)
Total iast_TELEMETRY_OFF 9.035 s 494.004 ms (5.8%)
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
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2024-05-06T14:57:44 2024-05-06T15:04:36
git_branch master bbujon/fix-ci-build-cache
git_commit_date 1715000113 1715006288
git_commit_sha 154b90a a6a76f4
release_version 1.34.0-SNAPSHOT~154b90a742 1.34.0-SNAPSHOT~a6a76f4bdb
start_time 2024-05-06T14:57:30 2024-05-06T15:04:22
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1715008222 1715008222
ci_job_id 505051444 505051444
ci_pipeline_id 33664484 33664484
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant iast iast

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 13 metrics, 15 unstable metrics.

Request duration reports for insecure-bank
gantt
    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,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 375.694 µs [356.204 µs, 395.183 µs] -
iast 487.565 µs [466.708 µs, 508.422 µs] 111.871 µs (29.8%)
iast_FULL 551.154 µs [530.464 µs, 571.843 µs] 175.46 µs (46.7%)
iast_GLOBAL 510.084 µs [487.932 µs, 532.235 µs] 134.39 µs (35.8%)
iast_HARDCODED_SECRET_DISABLED 484.066 µs [462.604 µs, 505.529 µs] 108.372 µs (28.8%)
iast_INACTIVE 454.277 µs [433.849 µs, 474.706 µs] 78.584 µs (20.9%)
iast_TELEMETRY_OFF 479.488 µs [458.014 µs, 500.962 µs] 103.794 µs (27.6%)
tracing 445.355 µs [425.313 µs, 465.397 µs] 69.661 µs (18.5%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 381.122 µs [361.512 µs, 400.733 µs] -
iast 481.15 µs [460.568 µs, 501.732 µs] 100.028 µs (26.2%)
iast_FULL 545.388 µs [524.845 µs, 565.932 µs] 164.266 µs (43.1%)
iast_GLOBAL 499.054 µs [478.48 µs, 519.628 µs] 117.932 µs (30.9%)
iast_HARDCODED_SECRET_DISABLED 482.873 µs [460.734 µs, 505.011 µs] 101.75 µs (26.7%)
iast_INACTIVE 474.581 µs [453.411 µs, 495.751 µs] 93.459 µs (24.5%)
iast_TELEMETRY_OFF 479.572 µs [457.996 µs, 501.148 µs] 98.45 µs (25.8%)
tracing 449.101 µs [428.866 µs, 469.335 µs] 67.978 µs (17.8%)
Request duration reports for petclinic
gantt
    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,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.35 ms [1.33 ms, 1.371 ms] -
appsec 1.747 ms [1.723 ms, 1.771 ms] 396.646 µs (29.4%)
appsec_no_iast 1.736 ms [1.712 ms, 1.76 ms] 385.218 µs (28.5%)
iast 1.495 ms [1.472 ms, 1.518 ms] 144.415 µs (10.7%)
profiling 1.534 ms [1.508 ms, 1.56 ms] 183.914 µs (13.6%)
tracing 1.489 ms [1.463 ms, 1.514 ms] 138.09 µs (10.2%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.35 ms [1.33 ms, 1.369 ms] -
appsec 1.71 ms [1.685 ms, 1.734 ms] 359.919 µs (26.7%)
appsec_no_iast 1.734 ms [1.71 ms, 1.758 ms] 384.132 µs (28.5%)
iast 1.49 ms [1.468 ms, 1.513 ms] 140.675 µs (10.4%)
profiling 1.513 ms [1.488 ms, 1.538 ms] 163.424 µs (12.1%)
tracing 1.508 ms [1.484 ms, 1.532 ms] 158.364 µs (11.7%)

Dacapo

@PerfectSlayer PerfectSlayer merged commit 1465164 into master May 7, 2024
@PerfectSlayer PerfectSlayer deleted the bbujon/fix-ci-build-cache branch May 7, 2024 05:13
@github-actions github-actions Bot added this to the 1.34.0 milestone May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: tooling Build & Tooling tag: no release notes Changes to exclude from release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants