-
Notifications
You must be signed in to change notification settings - Fork 318
Ensure tracer and scheduler are clean after test execution #9512
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
512699a to
0c57e15
Compare
Debugger benchmarksParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 9 metrics, 6 unstable metrics. See unchanged results
Request duration reports for reportsgantt
title reports - request duration [CI 0.99] : candidate=None, baseline=None
dateFormat X
axisFormat %s
section baseline
noprobe (333.27 µs) : 271, 396
. : milestone, 333,
basic (278.855 µs) : 270, 287
. : milestone, 279,
loop (8.961 ms) : 8956, 8966
. : milestone, 8961,
section candidate
noprobe (313.188 µs) : 288, 338
. : milestone, 313,
basic (276.736 µs) : 270, 284
. : milestone, 277,
loop (8.973 ms) : 8968, 8978
. : milestone, 8973,
|
|
🎯 Code Coverage 🔗 Commit SHA: d81fa1b | Docs | Was this helpful? Give us feedback! |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 46 metrics, 13 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.54.0-SNAPSHOT~d81fa1b078, baseline=1.54.0-SNAPSHOT~b84c0183bc
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.045 s) : 0, 1044865
Total [baseline] (8.644 s) : 0, 8643917
Agent [candidate] (1.047 s) : 0, 1046653
Total [candidate] (8.626 s) : 0, 8625778
section iast
Agent [baseline] (1.187 s) : 0, 1187041
Total [baseline] (9.371 s) : 0, 9371113
Agent [candidate] (1.189 s) : 0, 1188684
Total [candidate] (9.352 s) : 0, 9352326
gantt
title insecure-bank - break down per module: candidate=1.54.0-SNAPSHOT~d81fa1b078, baseline=1.54.0-SNAPSHOT~b84c0183bc
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.479 ms) : 0, 1479
crashtracking [candidate] (1.45 ms) : 0, 1450
BytebuddyAgent [baseline] (730.683 ms) : 0, 730683
BytebuddyAgent [candidate] (731.935 ms) : 0, 731935
GlobalTracer [baseline] (241.872 ms) : 0, 241872
GlobalTracer [candidate] (242.451 ms) : 0, 242451
AppSec [baseline] (30.503 ms) : 0, 30503
AppSec [candidate] (30.314 ms) : 0, 30314
Debugger [baseline] (6.418 ms) : 0, 6418
Debugger [candidate] (6.416 ms) : 0, 6416
Remote Config [baseline] (692.868 µs) : 0, 693
Remote Config [candidate] (672.166 µs) : 0, 672
Telemetry [baseline] (12.199 ms) : 0, 12199
Telemetry [candidate] (12.358 ms) : 0, 12358
section iast
crashtracking [baseline] (1.474 ms) : 0, 1474
crashtracking [candidate] (1.467 ms) : 0, 1467
BytebuddyAgent [baseline] (856.762 ms) : 0, 856762
BytebuddyAgent [candidate] (858.368 ms) : 0, 858368
GlobalTracer [baseline] (233.945 ms) : 0, 233945
GlobalTracer [candidate] (233.953 ms) : 0, 233953
IAST [baseline] (31.351 ms) : 0, 31351
IAST [candidate] (30.519 ms) : 0, 30519
AppSec [baseline] (27.292 ms) : 0, 27292
AppSec [candidate] (28.218 ms) : 0, 28218
Debugger [baseline] (6.163 ms) : 0, 6163
Debugger [candidate] (6.136 ms) : 0, 6136
Remote Config [baseline] (614.542 µs) : 0, 615
Remote Config [candidate] (605.872 µs) : 0, 606
Telemetry [baseline] (8.398 ms) : 0, 8398
Telemetry [candidate] (8.291 ms) : 0, 8291
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.54.0-SNAPSHOT~d81fa1b078, baseline=1.54.0-SNAPSHOT~b84c0183bc
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.05 s) : 0, 1050265
Total [baseline] (10.676 s) : 0, 10675571
Agent [candidate] (1.061 s) : 0, 1060503
Total [candidate] (10.826 s) : 0, 10825973
section appsec
Agent [baseline] (1.222 s) : 0, 1222086
Total [baseline] (10.859 s) : 0, 10858981
Agent [candidate] (1.231 s) : 0, 1230808
Total [candidate] (10.919 s) : 0, 10918792
section iast
Agent [baseline] (1.18 s) : 0, 1180493
Total [baseline] (10.969 s) : 0, 10969492
Agent [candidate] (1.182 s) : 0, 1181665
Total [candidate] (10.934 s) : 0, 10933876
section profiling
Agent [baseline] (1.198 s) : 0, 1197941
Total [baseline] (10.891 s) : 0, 10890564
Agent [candidate] (1.208 s) : 0, 1207743
Total [candidate] (11.016 s) : 0, 11016332
gantt
title petclinic - break down per module: candidate=1.54.0-SNAPSHOT~d81fa1b078, baseline=1.54.0-SNAPSHOT~b84c0183bc
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.45 ms) : 0, 1450
crashtracking [candidate] (1.47 ms) : 0, 1470
BytebuddyAgent [baseline] (732.456 ms) : 0, 732456
BytebuddyAgent [candidate] (740.898 ms) : 0, 740898
GlobalTracer [baseline] (242.517 ms) : 0, 242517
GlobalTracer [candidate] (245.407 ms) : 0, 245407
AppSec [baseline] (30.338 ms) : 0, 30338
AppSec [candidate] (30.985 ms) : 0, 30985
Debugger [baseline] (6.452 ms) : 0, 6452
Debugger [candidate] (6.472 ms) : 0, 6472
Remote Config [baseline] (681.088 µs) : 0, 681
Remote Config [candidate] (688.965 µs) : 0, 689
Telemetry [baseline] (15.278 ms) : 0, 15278
Telemetry [candidate] (13.271 ms) : 0, 13271
section appsec
crashtracking [baseline] (1.447 ms) : 0, 1447
crashtracking [candidate] (1.459 ms) : 0, 1459
BytebuddyAgent [baseline] (754.173 ms) : 0, 754173
BytebuddyAgent [candidate] (758.894 ms) : 0, 758894
GlobalTracer [baseline] (235.157 ms) : 0, 235157
GlobalTracer [candidate] (237.293 ms) : 0, 237293
AppSec [baseline] (169.474 ms) : 0, 169474
AppSec [candidate] (169.875 ms) : 0, 169875
Debugger [baseline] (8.289 ms) : 0, 8289
Debugger [candidate] (8.396 ms) : 0, 8396
Remote Config [baseline] (643.424 µs) : 0, 643
Remote Config [candidate] (628.883 µs) : 0, 629
Telemetry [baseline] (8.423 ms) : 0, 8423
Telemetry [candidate] (9.248 ms) : 0, 9248
IAST [baseline] (23.48 ms) : 0, 23480
IAST [candidate] (23.896 ms) : 0, 23896
section iast
crashtracking [baseline] (1.464 ms) : 0, 1464
crashtracking [candidate] (1.444 ms) : 0, 1444
BytebuddyAgent [baseline] (851.204 ms) : 0, 851204
BytebuddyAgent [candidate] (852.63 ms) : 0, 852630
GlobalTracer [baseline] (233.179 ms) : 0, 233179
GlobalTracer [candidate] (234.4 ms) : 0, 234400
AppSec [baseline] (26.421 ms) : 0, 26421
AppSec [candidate] (25.303 ms) : 0, 25303
Debugger [baseline] (8.759 ms) : 0, 8759
Debugger [candidate] (6.109 ms) : 0, 6109
Remote Config [baseline] (607.288 µs) : 0, 607
Remote Config [candidate] (615.699 µs) : 0, 616
Telemetry [baseline] (9.107 ms) : 0, 9107
Telemetry [candidate] (8.21 ms) : 0, 8210
IAST [baseline] (28.587 ms) : 0, 28587
IAST [candidate] (31.87 ms) : 0, 31870
section profiling
ProfilingAgent [baseline] (109.044 ms) : 0, 109044
ProfilingAgent [candidate] (108.755 ms) : 0, 108755
crashtracking [baseline] (1.436 ms) : 0, 1436
crashtracking [candidate] (1.451 ms) : 0, 1451
BytebuddyAgent [baseline] (760.304 ms) : 0, 760304
BytebuddyAgent [candidate] (766.668 ms) : 0, 766668
GlobalTracer [baseline] (222.923 ms) : 0, 222923
GlobalTracer [candidate] (224.655 ms) : 0, 224655
AppSec [baseline] (30.583 ms) : 0, 30583
AppSec [candidate] (31.064 ms) : 0, 31064
Debugger [baseline] (7.378 ms) : 0, 7378
Debugger [candidate] (7.61 ms) : 0, 7610
Remote Config [baseline] (686.956 µs) : 0, 687
Remote Config [candidate] (718.53 µs) : 0, 719
Telemetry [baseline] (15.021 ms) : 0, 15021
Telemetry [candidate] (15.871 ms) : 0, 15871
Profiling [baseline] (109.742 ms) : 0, 109742
Profiling [candidate] (109.474 ms) : 0, 109474
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 12 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.54.0-SNAPSHOT~d81fa1b078, baseline=1.54.0-SNAPSHOT~b84c0183bc
dateFormat X
axisFormat %s
section baseline
no_agent (37.891 ms) : 37580, 38202
. : milestone, 37891,
appsec (48.862 ms) : 48431, 49294
. : milestone, 48862,
code_origins (46.264 ms) : 45865, 46663
. : milestone, 46264,
iast (45.543 ms) : 45161, 45926
. : milestone, 45543,
profiling (49.433 ms) : 48968, 49898
. : milestone, 49433,
tracing (43.561 ms) : 43197, 43925
. : milestone, 43561,
section candidate
no_agent (37.589 ms) : 37283, 37895
. : milestone, 37589,
appsec (49.014 ms) : 48560, 49467
. : milestone, 49014,
code_origins (46.832 ms) : 46433, 47231
. : milestone, 46832,
iast (44.594 ms) : 44202, 44987
. : milestone, 44594,
profiling (49.55 ms) : 49058, 50042
. : milestone, 49550,
tracing (44.293 ms) : 43930, 44656
. : milestone, 44293,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.54.0-SNAPSHOT~d81fa1b078, baseline=1.54.0-SNAPSHOT~b84c0183bc
dateFormat X
axisFormat %s
section baseline
no_agent (4.365 ms) : 4309, 4420
. : milestone, 4365,
iast (9.553 ms) : 9397, 9708
. : milestone, 9553,
iast_FULL (14.099 ms) : 13817, 14381
. : milestone, 14099,
iast_GLOBAL (10.399 ms) : 10219, 10580
. : milestone, 10399,
profiling (8.904 ms) : 8758, 9049
. : milestone, 8904,
tracing (7.844 ms) : 7730, 7958
. : milestone, 7844,
section candidate
no_agent (4.466 ms) : 4414, 4519
. : milestone, 4466,
iast (9.531 ms) : 9372, 9690
. : milestone, 9531,
iast_FULL (14.089 ms) : 13811, 14367
. : milestone, 14089,
iast_GLOBAL (10.47 ms) : 10272, 10669
. : milestone, 10470,
profiling (8.858 ms) : 8703, 9014
. : milestone, 8858,
tracing (7.759 ms) : 7647, 7870
. : milestone, 7759,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.54.0-SNAPSHOT~d81fa1b078, baseline=1.54.0-SNAPSHOT~b84c0183bc
dateFormat X
axisFormat %s
section baseline
no_agent (1.487 ms) : 1475, 1498
. : milestone, 1487,
appsec (3.693 ms) : 3476, 3910
. : milestone, 3693,
iast (2.225 ms) : 2163, 2288
. : milestone, 2225,
iast_GLOBAL (2.266 ms) : 2202, 2329
. : milestone, 2266,
profiling (2.066 ms) : 2015, 2118
. : milestone, 2066,
tracing (2.027 ms) : 1979, 2076
. : milestone, 2027,
section candidate
no_agent (1.491 ms) : 1479, 1503
. : milestone, 1491,
appsec (3.73 ms) : 3511, 3948
. : milestone, 3730,
iast (2.216 ms) : 2153, 2278
. : milestone, 2216,
iast_GLOBAL (2.263 ms) : 2200, 2327
. : milestone, 2263,
profiling (2.057 ms) : 2006, 2107
. : milestone, 2057,
tracing (2.037 ms) : 1988, 2086
. : milestone, 2037,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.54.0-SNAPSHOT~d81fa1b078, baseline=1.54.0-SNAPSHOT~b84c0183bc
dateFormat X
axisFormat %s
section baseline
no_agent (15.646 s) : 15646000, 15646000
. : milestone, 15646000,
appsec (14.913 s) : 14913000, 14913000
. : milestone, 14913000,
iast (18.39 s) : 18390000, 18390000
. : milestone, 18390000,
iast_GLOBAL (17.939 s) : 17939000, 17939000
. : milestone, 17939000,
profiling (15.295 s) : 15295000, 15295000
. : milestone, 15295000,
tracing (15.166 s) : 15166000, 15166000
. : milestone, 15166000,
section candidate
no_agent (14.917 s) : 14917000, 14917000
. : milestone, 14917000,
appsec (14.736 s) : 14736000, 14736000
. : milestone, 14736000,
iast (18.388 s) : 18388000, 18388000
. : milestone, 18388000,
iast_GLOBAL (17.882 s) : 17882000, 17882000
. : milestone, 17882000,
profiling (16.081 s) : 16081000, 16081000
. : milestone, 16081000,
tracing (15.155 s) : 15155000, 15155000
. : milestone, 15155000,
|
dd-trace-core/src/test/groovy/datadog/trace/core/test/DDCoreSpecification.groovy
Show resolved
Hide resolved
dd-trace-core/src/test/groovy/datadog/trace/core/test/DDCoreSpecification.groovy
Outdated
Show resolved
Hide resolved
internal-api/src/main/java/datadog/trace/util/AgentTaskScheduler.java
Outdated
Show resolved
Hide resolved
smola
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.
Changes relevant to security products look fine.
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.
👏 praise: Thanks for the fix! And the follow up changes regarding to my comments 🤝
What Does This Do
On
DDCoreSpecificationwe spawn tracers. The first issue is that those tracers are not (always) closed and they might leak scheduled (repeated) tasks (like Health reporting, telemetry, metrics calculation) that accumulates in the AgentThreadScheduler queue.To mitigate that, this PR decorates the DDCoreTracerBuilder returned on DDCoreSpecification by recording the opened tracers and closing them when the test terminates.
Secondly, we have things that are scheduled with jitter (i.e. metrics calculation) that can be spawn after the test is completed (i.e. the test is quicker than the jitter). Hence they are stale on the scheduler and accumulates. They will hold memory and, in case for instance the agent metrics are enabled, the tests will finish to fail for OOM.
This PR is also removing the final modifier to the AgentTaskScheduler
INSTANCE(hence only exposing publicly a getter now) in order to be able to shutdown it after each test class and reset with a new one.Please note that I tried to find alternate solution to avoid removing
final(i.e. play with Unsafe, etc..) but it resulted in having to deal with Unsafe that is not very portable across jdk and also, static final things might be inlined so I preferred that easier solution.Motivation
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]