-
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
Improve Context API null handling and Javadoc #8129
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 58 metrics, 4 unstable metrics.
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.45.0-SNAPSHOT~c4da3f7ab2, baseline=1.45.0-SNAPSHOT~7d4150eb06
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.057 s) : 0, 1057406
Total [baseline] (10.442 s) : 0, 10442304
Agent [candidate] (1.052 s) : 0, 1051999
Total [candidate] (10.408 s) : 0, 10408097
section appsec
Agent [baseline] (1.185 s) : 0, 1185432
Total [baseline] (10.714 s) : 0, 10713694
Agent [candidate] (1.189 s) : 0, 1188612
Total [candidate] (10.705 s) : 0, 10704510
section iast
Agent [baseline] (1.179 s) : 0, 1179011
Total [baseline] (10.985 s) : 0, 10985429
Agent [candidate] (1.177 s) : 0, 1177001
Total [candidate] (10.903 s) : 0, 10902544
section profiling
Agent [baseline] (1.276 s) : 0, 1275885
Total [baseline] (10.809 s) : 0, 10809213
Agent [candidate] (1.275 s) : 0, 1274732
Total [candidate] (10.747 s) : 0, 10746717
gantt
title petclinic - break down per module: candidate=1.45.0-SNAPSHOT~c4da3f7ab2, baseline=1.45.0-SNAPSHOT~7d4150eb06
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (715.598 ms) : 0, 715598
BytebuddyAgent [candidate] (710.601 ms) : 0, 710601
GlobalTracer [baseline] (257.795 ms) : 0, 257795
GlobalTracer [candidate] (255.449 ms) : 0, 255449
AppSec [baseline] (55.414 ms) : 0, 55414
AppSec [candidate] (56.916 ms) : 0, 56916
Remote Config [baseline] (715.616 µs) : 0, 716
Remote Config [candidate] (689.663 µs) : 0, 690
Telemetry [baseline] (12.721 ms) : 0, 12721
Telemetry [candidate] (13.361 ms) : 0, 13361
section appsec
BytebuddyAgent [baseline] (728.808 ms) : 0, 728808
BytebuddyAgent [candidate] (730.726 ms) : 0, 730726
GlobalTracer [baseline] (252.647 ms) : 0, 252647
GlobalTracer [candidate] (253.176 ms) : 0, 253176
AppSec [baseline] (170.208 ms) : 0, 170208
AppSec [candidate] (171.269 ms) : 0, 171269
IAST [baseline] (19.376 ms) : 0, 19376
IAST [candidate] (19.603 ms) : 0, 19603
Remote Config [baseline] (663.183 µs) : 0, 663
Remote Config [candidate] (665.77 µs) : 0, 666
Telemetry [baseline] (8.399 ms) : 0, 8399
Telemetry [candidate] (7.975 ms) : 0, 7975
section iast
BytebuddyAgent [baseline] (828.802 ms) : 0, 828802
BytebuddyAgent [candidate] (828.101 ms) : 0, 828101
GlobalTracer [baseline] (246.583 ms) : 0, 246583
GlobalTracer [candidate] (245.823 ms) : 0, 245823
AppSec [baseline] (58.085 ms) : 0, 58085
AppSec [candidate] (57.73 ms) : 0, 57730
IAST [baseline] (21.35 ms) : 0, 21350
IAST [candidate] (21.226 ms) : 0, 21226
Remote Config [baseline] (667.338 µs) : 0, 667
Remote Config [candidate] (652.287 µs) : 0, 652
Telemetry [baseline] (8.461 ms) : 0, 8461
Telemetry [candidate] (8.486 ms) : 0, 8486
section profiling
BytebuddyAgent [baseline] (704.726 ms) : 0, 704726
BytebuddyAgent [candidate] (703.453 ms) : 0, 703453
GlobalTracer [baseline] (371.194 ms) : 0, 371194
GlobalTracer [candidate] (371.153 ms) : 0, 371153
AppSec [baseline] (54.229 ms) : 0, 54229
AppSec [candidate] (53.891 ms) : 0, 53891
Remote Config [baseline] (672.826 µs) : 0, 673
Remote Config [candidate] (640.709 µs) : 0, 641
Telemetry [baseline] (7.855 ms) : 0, 7855
Telemetry [candidate] (7.819 ms) : 0, 7819
ProfilingAgent [baseline] (95.222 ms) : 0, 95222
ProfilingAgent [candidate] (95.815 ms) : 0, 95815
Profiling [baseline] (95.247 ms) : 0, 95247
Profiling [candidate] (95.839 ms) : 0, 95839
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.45.0-SNAPSHOT~c4da3f7ab2, baseline=1.45.0-SNAPSHOT~7d4150eb06
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.055 s) : 0, 1054856
Total [baseline] (8.595 s) : 0, 8595225
Agent [candidate] (1.051 s) : 0, 1050836
Total [candidate] (8.585 s) : 0, 8584798
section iast
Agent [baseline] (1.175 s) : 0, 1174605
Total [baseline] (9.185 s) : 0, 9184893
Agent [candidate] (1.184 s) : 0, 1183996
Total [candidate] (9.189 s) : 0, 9189071
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.179 s) : 0, 1178837
Total [baseline] (9.228 s) : 0, 9227716
Agent [candidate] (1.177 s) : 0, 1177380
Total [candidate] (9.156 s) : 0, 9155941
section iast_TELEMETRY_OFF
Agent [baseline] (1.178 s) : 0, 1178380
Total [baseline] (9.169 s) : 0, 9168919
Agent [candidate] (1.175 s) : 0, 1175054
Total [candidate] (9.166 s) : 0, 9165922
gantt
title insecure-bank - break down per module: candidate=1.45.0-SNAPSHOT~c4da3f7ab2, baseline=1.45.0-SNAPSHOT~7d4150eb06
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (716.138 ms) : 0, 716138
BytebuddyAgent [candidate] (709.808 ms) : 0, 709808
GlobalTracer [baseline] (256.965 ms) : 0, 256965
GlobalTracer [candidate] (255.381 ms) : 0, 255381
AppSec [baseline] (55.308 ms) : 0, 55308
AppSec [candidate] (58.142 ms) : 0, 58142
Remote Config [baseline] (710.089 µs) : 0, 710
Remote Config [candidate] (692.715 µs) : 0, 693
Telemetry [baseline] (10.609 ms) : 0, 10609
Telemetry [candidate] (11.917 ms) : 0, 11917
section iast
BytebuddyAgent [baseline] (826.075 ms) : 0, 826075
BytebuddyAgent [candidate] (833.44 ms) : 0, 833440
GlobalTracer [baseline] (245.417 ms) : 0, 245417
GlobalTracer [candidate] (247.363 ms) : 0, 247363
AppSec [baseline] (57.572 ms) : 0, 57572
AppSec [candidate] (57.824 ms) : 0, 57824
IAST [baseline] (21.421 ms) : 0, 21421
IAST [candidate] (21.194 ms) : 0, 21194
Remote Config [baseline] (640.163 µs) : 0, 640
Remote Config [candidate] (646.97 µs) : 0, 647
Telemetry [baseline] (8.462 ms) : 0, 8462
Telemetry [candidate] (8.523 ms) : 0, 8523
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (826.95 ms) : 0, 826950
BytebuddyAgent [candidate] (827.822 ms) : 0, 827822
GlobalTracer [baseline] (247.26 ms) : 0, 247260
GlobalTracer [candidate] (246.44 ms) : 0, 246440
AppSec [baseline] (58.473 ms) : 0, 58473
AppSec [candidate] (57.936 ms) : 0, 57936
IAST [baseline] (21.696 ms) : 0, 21696
IAST [candidate] (21.16 ms) : 0, 21160
Remote Config [baseline] (661.731 µs) : 0, 662
Remote Config [candidate] (656.279 µs) : 0, 656
Telemetry [baseline] (8.711 ms) : 0, 8711
Telemetry [candidate] (8.457 ms) : 0, 8457
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (826.967 ms) : 0, 826967
BytebuddyAgent [candidate] (825.657 ms) : 0, 825657
GlobalTracer [baseline] (248.296 ms) : 0, 248296
GlobalTracer [candidate] (246.61 ms) : 0, 246610
AppSec [baseline] (57.939 ms) : 0, 57939
AppSec [candidate] (57.883 ms) : 0, 57883
IAST [baseline] (20.977 ms) : 0, 20977
IAST [candidate] (20.879 ms) : 0, 20879
Remote Config [baseline] (656.502 µs) : 0, 657
Remote Config [candidate] (640.34 µs) : 0, 640
Telemetry [baseline] (8.507 ms) : 0, 8507
Telemetry [candidate] (8.39 ms) : 0, 8390
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 16 unstable metrics. Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.45.0-SNAPSHOT~c4da3f7ab2, baseline=1.45.0-SNAPSHOT~7d4150eb06
dateFormat X
axisFormat %s
section baseline
no_agent (381.235 µs) : 360, 402
. : milestone, 381,
iast (503.178 µs) : 481, 525
. : milestone, 503,
iast_FULL (659.57 µs) : 638, 681
. : milestone, 660,
iast_GLOBAL (522.413 µs) : 501, 544
. : milestone, 522,
iast_HARDCODED_SECRET_DISABLED (493.439 µs) : 471, 515
. : milestone, 493,
iast_INACTIVE (451.563 µs) : 431, 473
. : milestone, 452,
iast_TELEMETRY_OFF (480.508 µs) : 459, 502
. : milestone, 481,
tracing (457.109 µs) : 436, 478
. : milestone, 457,
section candidate
no_agent (383.983 µs) : 364, 404
. : milestone, 384,
iast (495.883 µs) : 474, 517
. : milestone, 496,
iast_FULL (662.597 µs) : 641, 684
. : milestone, 663,
iast_GLOBAL (528.815 µs) : 507, 551
. : milestone, 529,
iast_HARDCODED_SECRET_DISABLED (497.025 µs) : 476, 518
. : milestone, 497,
iast_INACTIVE (463.987 µs) : 442, 486
. : milestone, 464,
iast_TELEMETRY_OFF (485.463 µs) : 464, 507
. : milestone, 485,
tracing (450.576 µs) : 430, 471
. : milestone, 451,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.45.0-SNAPSHOT~c4da3f7ab2, baseline=1.45.0-SNAPSHOT~7d4150eb06
dateFormat X
axisFormat %s
section baseline
no_agent (1.359 ms) : 1339, 1379
. : milestone, 1359,
appsec (1.757 ms) : 1733, 1780
. : milestone, 1757,
appsec_no_iast (1.77 ms) : 1745, 1796
. : milestone, 1770,
iast (1.509 ms) : 1485, 1532
. : milestone, 1509,
profiling (1.521 ms) : 1497, 1544
. : milestone, 1521,
tracing (1.504 ms) : 1477, 1530
. : milestone, 1504,
section candidate
no_agent (1.374 ms) : 1354, 1394
. : milestone, 1374,
appsec (1.737 ms) : 1713, 1761
. : milestone, 1737,
appsec_no_iast (1.775 ms) : 1750, 1799
. : milestone, 1775,
iast (1.521 ms) : 1498, 1545
. : milestone, 1521,
profiling (1.565 ms) : 1540, 1590
. : milestone, 1565,
tracing (1.505 ms) : 1480, 1529
. : milestone, 1505,
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 biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.45.0-SNAPSHOT~c4da3f7ab2, baseline=1.45.0-SNAPSHOT~7d4150eb06
dateFormat X
axisFormat %s
section baseline
no_agent (14.938 s) : 14938000, 14938000
. : milestone, 14938000,
appsec (15.865 s) : 15865000, 15865000
. : milestone, 15865000,
iast (19.043 s) : 19043000, 19043000
. : milestone, 19043000,
iast_GLOBAL (18.069 s) : 18069000, 18069000
. : milestone, 18069000,
profiling (15.635 s) : 15635000, 15635000
. : milestone, 15635000,
tracing (15.41 s) : 15410000, 15410000
. : milestone, 15410000,
section candidate
no_agent (15.597 s) : 15597000, 15597000
. : milestone, 15597000,
appsec (15.066 s) : 15066000, 15066000
. : milestone, 15066000,
iast (18.942 s) : 18942000, 18942000
. : milestone, 18942000,
iast_GLOBAL (17.991 s) : 17991000, 17991000
. : milestone, 17991000,
profiling (15.681 s) : 15681000, 15681000
. : milestone, 15681000,
tracing (14.754 s) : 14754000, 14754000
. : milestone, 14754000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.45.0-SNAPSHOT~c4da3f7ab2, baseline=1.45.0-SNAPSHOT~7d4150eb06
dateFormat X
axisFormat %s
section baseline
no_agent (1.476 ms) : 1465, 1488
. : milestone, 1476,
appsec (2.355 ms) : 2313, 2397
. : milestone, 2355,
iast (2.115 ms) : 2062, 2169
. : milestone, 2115,
iast_GLOBAL (2.15 ms) : 2096, 2203
. : milestone, 2150,
profiling (1.973 ms) : 1929, 2016
. : milestone, 1973,
tracing (1.946 ms) : 1905, 1988
. : milestone, 1946,
section candidate
no_agent (1.47 ms) : 1459, 1482
. : milestone, 1470,
appsec (2.367 ms) : 2325, 2409
. : milestone, 2367,
iast (2.1 ms) : 2046, 2153
. : milestone, 2100,
iast_GLOBAL (2.143 ms) : 2090, 2197
. : milestone, 2143,
profiling (1.975 ms) : 1931, 2018
. : milestone, 1975,
tracing (1.939 ms) : 1899, 1980
. : milestone, 1939,
|
components/context/src/main/java/datadog/context/EmptyContext.java
Outdated
Show resolved
Hide resolved
components/context/src/main/java/datadog/context/IndexedContext.java
Outdated
Show resolved
Hide resolved
components/context/src/main/java/datadog/context/IndexedContext.java
Outdated
Show resolved
Hide resolved
components/context/src/main/java/datadog/context/SingletonContext.java
Outdated
Show resolved
Hide resolved
components/context/src/main/java/datadog/context/SingletonContext.java
Outdated
Show resolved
Hide resolved
components/context/src/main/java/datadog/context/SingletonContext.java
Outdated
Show resolved
Hide resolved
components/context/src/main/java/datadog/context/ThreadLocalContextManager.java
Outdated
Show resolved
Hide resolved
components/context/src/main/java/datadog/context/WeakMapContextBinder.java
Outdated
Show resolved
Hide resolved
c3d4b3a
to
fb5152d
Compare
components/context/src/main/java/datadog/context/EmptyContext.java
Outdated
Show resolved
Hide resolved
components/context/src/main/java/datadog/context/IndexedContext.java
Outdated
Show resolved
Hide resolved
components/context/src/main/java/datadog/context/IndexedContext.java
Outdated
Show resolved
Hide resolved
components/context/src/main/java/datadog/context/SingletonContext.java
Outdated
Show resolved
Hide resolved
components/context/src/main/java/datadog/context/SingletonContext.java
Outdated
Show resolved
Hide resolved
components/context/src/main/java/datadog/context/WeakMapContextBinder.java
Outdated
Show resolved
Hide resolved
components/context/src/main/java/datadog/context/WeakMapContextBinder.java
Outdated
Show resolved
Hide resolved
components/context/src/main/java/datadog/context/WeakMapContextBinder.java
Outdated
Show resolved
Hide resolved
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.
+1 thanks for the diligent cleanup!
Improve Javadoc about usage and thread safety Improve null handling using defensive checks, and document parameters and results Improve tests to cover all context implementations
fb5152d
to
c4da3f7
Compare
What Does This Do
This PR is a follow up of #8117:
Motivation
The goal is to make the most explicit possible the new API and document how it is supposed to behave with unexpected cases.
Additional Notes
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: LANGPLAT-39