Temporary bridge between contexts and spans/scopes#8636
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 69 metrics, 2 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.48.0-SNAPSHOT~4d4a759c4b, baseline=1.48.0-SNAPSHOT~bfdfd2bcad
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.059 s) : 0, 1058721
Total [baseline] (10.457 s) : 0, 10456875
Agent [candidate] (1.059 s) : 0, 1059020
Total [candidate] (10.439 s) : 0, 10439271
section appsec
Agent [baseline] (1.191 s) : 0, 1190866
Total [baseline] (10.739 s) : 0, 10738630
Agent [candidate] (1.199 s) : 0, 1198886
Total [candidate] (10.782 s) : 0, 10781513
section iast
Agent [baseline] (1.19 s) : 0, 1190341
Total [baseline] (11.02 s) : 0, 11019749
Agent [candidate] (1.179 s) : 0, 1178926
Total [candidate] (11.033 s) : 0, 11033100
section profiling
Agent [baseline] (1.284 s) : 0, 1284218
Total [baseline] (10.873 s) : 0, 10873431
Agent [candidate] (1.276 s) : 0, 1275939
Total [candidate] (10.88 s) : 0, 10880458
gantt
title petclinic - break down per module: candidate=1.48.0-SNAPSHOT~4d4a759c4b, baseline=1.48.0-SNAPSHOT~bfdfd2bcad
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (723.584 ms) : 0, 723584
BytebuddyAgent [candidate] (723.312 ms) : 0, 723312
GlobalTracer [baseline] (240.165 ms) : 0, 240165
GlobalTracer [candidate] (240.989 ms) : 0, 240989
AppSec [baseline] (54.929 ms) : 0, 54929
AppSec [candidate] (54.716 ms) : 0, 54716
Debugger [baseline] (4.513 ms) : 0, 4513
Debugger [candidate] (4.489 ms) : 0, 4489
Remote Config [baseline] (688.54 µs) : 0, 689
Remote Config [candidate] (695.019 µs) : 0, 695
Telemetry [baseline] (14.088 ms) : 0, 14088
Telemetry [candidate] (13.535 ms) : 0, 13535
section appsec
BytebuddyAgent [baseline] (735.496 ms) : 0, 735496
BytebuddyAgent [candidate] (740.981 ms) : 0, 740981
GlobalTracer [baseline] (234.742 ms) : 0, 234742
GlobalTracer [candidate] (236.862 ms) : 0, 236862
AppSec [baseline] (176.19 ms) : 0, 176190
AppSec [candidate] (176.574 ms) : 0, 176574
Debugger [baseline] (4.263 ms) : 0, 4263
Debugger [candidate] (4.262 ms) : 0, 4262
Remote Config [baseline] (639.841 µs) : 0, 640
Remote Config [candidate] (647.212 µs) : 0, 647
Telemetry [baseline] (8.207 ms) : 0, 8207
Telemetry [candidate] (8.209 ms) : 0, 8209
IAST [baseline] (21.569 ms) : 0, 21569
IAST [candidate] (21.727 ms) : 0, 21727
section iast
BytebuddyAgent [baseline] (847.994 ms) : 0, 847994
BytebuddyAgent [candidate] (836.907 ms) : 0, 836907
GlobalTracer [baseline] (229.415 ms) : 0, 229415
GlobalTracer [candidate] (229.733 ms) : 0, 229733
AppSec [baseline] (55.666 ms) : 0, 55666
AppSec [candidate] (55.738 ms) : 0, 55738
Debugger [baseline] (4.173 ms) : 0, 4173
Debugger [candidate] (4.146 ms) : 0, 4146
Remote Config [baseline] (614.371 µs) : 0, 614
Remote Config [candidate] (604.357 µs) : 0, 604
Telemetry [baseline] (8.86 ms) : 0, 8860
Telemetry [candidate] (8.753 ms) : 0, 8753
IAST [baseline] (22.941 ms) : 0, 22941
IAST [candidate] (22.61 ms) : 0, 22610
section profiling
BytebuddyAgent [baseline] (716.113 ms) : 0, 716113
BytebuddyAgent [candidate] (711.211 ms) : 0, 711211
GlobalTracer [baseline] (350.181 ms) : 0, 350181
GlobalTracer [candidate] (349.348 ms) : 0, 349348
AppSec [baseline] (54.59 ms) : 0, 54590
AppSec [candidate] (53.487 ms) : 0, 53487
Debugger [baseline] (4.386 ms) : 0, 4386
Debugger [candidate] (4.305 ms) : 0, 4305
Remote Config [baseline] (715.021 µs) : 0, 715
Remote Config [candidate] (695.047 µs) : 0, 695
Telemetry [baseline] (9.087 ms) : 0, 9087
Telemetry [candidate] (8.964 ms) : 0, 8964
ProfilingAgent [baseline] (103.022 ms) : 0, 103022
ProfilingAgent [candidate] (102.138 ms) : 0, 102138
Profiling [baseline] (103.05 ms) : 0, 103050
Profiling [candidate] (102.163 ms) : 0, 102163
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.48.0-SNAPSHOT~4d4a759c4b, baseline=1.48.0-SNAPSHOT~bfdfd2bcad
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.052 s) : 0, 1052021
Total [baseline] (8.712 s) : 0, 8711511
Agent [candidate] (1.051 s) : 0, 1050918
Total [candidate] (8.663 s) : 0, 8662938
section iast
Agent [baseline] (1.178 s) : 0, 1178107
Total [baseline] (9.23 s) : 0, 9229766
Agent [candidate] (1.183 s) : 0, 1183483
Total [candidate] (9.302 s) : 0, 9301981
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.177 s) : 0, 1176628
Total [baseline] (9.191 s) : 0, 9191374
Agent [candidate] (1.184 s) : 0, 1183872
Total [candidate] (9.254 s) : 0, 9254374
section iast_TELEMETRY_OFF
Agent [baseline] (1.171 s) : 0, 1171288
Total [baseline] (9.205 s) : 0, 9205180
Agent [candidate] (1.184 s) : 0, 1183942
Total [candidate] (9.271 s) : 0, 9270828
gantt
title insecure-bank - break down per module: candidate=1.48.0-SNAPSHOT~4d4a759c4b, baseline=1.48.0-SNAPSHOT~bfdfd2bcad
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (718.58 ms) : 0, 718580
BytebuddyAgent [candidate] (717.56 ms) : 0, 717560
GlobalTracer [baseline] (239.648 ms) : 0, 239648
GlobalTracer [candidate] (239.637 ms) : 0, 239637
AppSec [baseline] (55.252 ms) : 0, 55252
AppSec [candidate] (54.417 ms) : 0, 54417
Debugger [baseline] (4.488 ms) : 0, 4488
Debugger [candidate] (4.452 ms) : 0, 4452
Remote Config [baseline] (699.882 µs) : 0, 700
Remote Config [candidate] (691.907 µs) : 0, 692
Telemetry [baseline] (12.738 ms) : 0, 12738
Telemetry [candidate] (13.638 ms) : 0, 13638
section iast
BytebuddyAgent [baseline] (836.789 ms) : 0, 836789
BytebuddyAgent [candidate] (839.395 ms) : 0, 839395
GlobalTracer [baseline] (228.718 ms) : 0, 228718
GlobalTracer [candidate] (231.141 ms) : 0, 231141
IAST [baseline] (22.771 ms) : 0, 22771
IAST [candidate] (22.954 ms) : 0, 22954
AppSec [baseline] (55.723 ms) : 0, 55723
AppSec [candidate] (55.798 ms) : 0, 55798
Debugger [baseline] (4.205 ms) : 0, 4205
Debugger [candidate] (4.206 ms) : 0, 4206
Remote Config [baseline] (615.49 µs) : 0, 615
Remote Config [candidate] (618.821 µs) : 0, 619
Telemetry [baseline] (8.852 ms) : 0, 8852
Telemetry [candidate] (8.918 ms) : 0, 8918
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (835.523 ms) : 0, 835523
BytebuddyAgent [candidate] (841.37 ms) : 0, 841370
GlobalTracer [baseline] (228.548 ms) : 0, 228548
GlobalTracer [candidate] (229.707 ms) : 0, 229707
IAST [baseline] (22.734 ms) : 0, 22734
IAST [candidate] (22.779 ms) : 0, 22779
AppSec [baseline] (55.771 ms) : 0, 55771
AppSec [candidate] (55.789 ms) : 0, 55789
Debugger [baseline] (4.151 ms) : 0, 4151
Debugger [candidate] (4.205 ms) : 0, 4205
Remote Config [baseline] (600.913 µs) : 0, 601
Remote Config [candidate] (612.905 µs) : 0, 613
Telemetry [baseline] (8.901 ms) : 0, 8901
Telemetry [candidate] (8.864 ms) : 0, 8864
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (831.658 ms) : 0, 831658
BytebuddyAgent [candidate] (840.566 ms) : 0, 840566
GlobalTracer [baseline] (227.842 ms) : 0, 227842
GlobalTracer [candidate] (230.478 ms) : 0, 230478
IAST [baseline] (22.247 ms) : 0, 22247
IAST [candidate] (22.695 ms) : 0, 22695
AppSec [baseline] (55.854 ms) : 0, 55854
AppSec [candidate] (56.074 ms) : 0, 56074
Debugger [baseline] (4.135 ms) : 0, 4135
Debugger [candidate] (4.216 ms) : 0, 4216
Remote Config [baseline] (603.083 µs) : 0, 603
Remote Config [candidate] (617.723 µs) : 0, 618
Telemetry [baseline] (8.612 ms) : 0, 8612
Telemetry [candidate] (8.745 ms) : 0, 8745
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 14 metrics, 16 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.48.0-SNAPSHOT~4d4a759c4b, baseline=1.48.0-SNAPSHOT~bfdfd2bcad
dateFormat X
axisFormat %s
section baseline
no_agent (1.368 ms) : 1349, 1388
. : milestone, 1368,
appsec (1.737 ms) : 1713, 1760
. : milestone, 1737,
appsec_no_iast (1.735 ms) : 1709, 1760
. : milestone, 1735,
code_origins (1.687 ms) : 1660, 1714
. : milestone, 1687,
iast (1.499 ms) : 1475, 1524
. : milestone, 1499,
profiling (1.524 ms) : 1501, 1547
. : milestone, 1524,
tracing (1.515 ms) : 1491, 1539
. : milestone, 1515,
section candidate
no_agent (1.378 ms) : 1357, 1398
. : milestone, 1378,
appsec (1.733 ms) : 1709, 1757
. : milestone, 1733,
appsec_no_iast (1.723 ms) : 1697, 1748
. : milestone, 1723,
code_origins (1.688 ms) : 1661, 1716
. : milestone, 1688,
iast (1.53 ms) : 1505, 1555
. : milestone, 1530,
profiling (1.522 ms) : 1499, 1546
. : milestone, 1522,
tracing (1.5 ms) : 1475, 1525
. : milestone, 1500,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.48.0-SNAPSHOT~4d4a759c4b, baseline=1.48.0-SNAPSHOT~bfdfd2bcad
dateFormat X
axisFormat %s
section baseline
no_agent (380.082 µs) : 359, 401
. : milestone, 380,
iast (516.718 µs) : 495, 539
. : milestone, 517,
iast_FULL (731.735 µs) : 710, 754
. : milestone, 732,
iast_GLOBAL (569.403 µs) : 546, 593
. : milestone, 569,
iast_HARDCODED_SECRET_DISABLED (517.208 µs) : 496, 539
. : milestone, 517,
iast_INACTIVE (476.809 µs) : 455, 499
. : milestone, 477,
iast_TELEMETRY_OFF (503.271 µs) : 481, 525
. : milestone, 503,
tracing (461.293 µs) : 441, 482
. : milestone, 461,
section candidate
no_agent (385.849 µs) : 366, 406
. : milestone, 386,
iast (520.303 µs) : 498, 543
. : milestone, 520,
iast_FULL (734.241 µs) : 712, 756
. : milestone, 734,
iast_GLOBAL (562.226 µs) : 540, 584
. : milestone, 562,
iast_HARDCODED_SECRET_DISABLED (510.827 µs) : 489, 533
. : milestone, 511,
iast_INACTIVE (468.309 µs) : 447, 490
. : milestone, 468,
iast_TELEMETRY_OFF (499.496 µs) : 478, 521
. : milestone, 499,
tracing (458.729 µs) : 437, 480
. : milestone, 459,
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.48.0-SNAPSHOT~4d4a759c4b, baseline=1.48.0-SNAPSHOT~bfdfd2bcad
dateFormat X
axisFormat %s
section baseline
no_agent (14.929 s) : 14929000, 14929000
. : milestone, 14929000,
appsec (14.597 s) : 14597000, 14597000
. : milestone, 14597000,
iast (18.868 s) : 18868000, 18868000
. : milestone, 18868000,
iast_GLOBAL (18.186 s) : 18186000, 18186000
. : milestone, 18186000,
profiling (15.29 s) : 15290000, 15290000
. : milestone, 15290000,
tracing (15.036 s) : 15036000, 15036000
. : milestone, 15036000,
section candidate
no_agent (14.997 s) : 14997000, 14997000
. : milestone, 14997000,
appsec (15.121 s) : 15121000, 15121000
. : milestone, 15121000,
iast (19.042 s) : 19042000, 19042000
. : milestone, 19042000,
iast_GLOBAL (17.38 s) : 17380000, 17380000
. : milestone, 17380000,
profiling (15.119 s) : 15119000, 15119000
. : milestone, 15119000,
tracing (15.477 s) : 15477000, 15477000
. : milestone, 15477000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.48.0-SNAPSHOT~4d4a759c4b, baseline=1.48.0-SNAPSHOT~bfdfd2bcad
dateFormat X
axisFormat %s
section baseline
no_agent (1.473 ms) : 1461, 1484
. : milestone, 1473,
appsec (2.345 ms) : 2301, 2389
. : milestone, 2345,
iast (2.123 ms) : 2067, 2178
. : milestone, 2123,
iast_GLOBAL (2.163 ms) : 2108, 2219
. : milestone, 2163,
profiling (1.978 ms) : 1934, 2021
. : milestone, 1978,
tracing (1.958 ms) : 1915, 2000
. : milestone, 1958,
section candidate
no_agent (1.483 ms) : 1471, 1494
. : milestone, 1483,
appsec (2.355 ms) : 2311, 2398
. : milestone, 2355,
iast (2.123 ms) : 2068, 2179
. : milestone, 2123,
iast_GLOBAL (2.169 ms) : 2113, 2225
. : milestone, 2169,
profiling (2.01 ms) : 1964, 2055
. : milestone, 2010,
tracing (1.962 ms) : 1919, 2005
. : milestone, 1962,
|
6c1c815 to
a374998
Compare
a374998 to
4d4a759
Compare
amarziali
left a comment
There was a problem hiding this comment.
looks ok from my understanding
| @Override | ||
| public final String toString() { | ||
| return super.toString() + "->" + span; | ||
| return super.toString() + "->" + context; |
There was a problem hiding this comment.
Should we dump only span() here instead of full context?
|
|
||
| @Override | ||
| public Context swap(Context context) { | ||
| throw new UnsupportedOperationException("Not yet implemented"); |
There was a problem hiding this comment.
Is it safe to throw an UnsupportedOperation from the scope manager in master? What about if someone start using the ContextManager API in an instrumentation? 😬
| @Override | ||
| default <T> Context with(@Nonnull ContextKey<T> key, @Nullable T value) { | ||
| return Context.root().with(SPAN_KEY, this, key, value); | ||
| return SPAN_KEY == key ? (Context) value : Context.root().with(SPAN_KEY, this, key, value); |
There was a problem hiding this comment.
Interesting optimization! 👍
What Does This Do
Use the existing scope manager to track contexts rather than spans in its scopes.
Motivation
Spans are now primordial contexts, so this is not a huge leap. It also means we can bring over other changes from the
project/contextbranch ahead of the wider replacement of the scope manager.Migration of continuations to continue contexts rather than spans will be addressed in a follow-up PR.
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: APMAPI-960