-
Notifications
You must be signed in to change notification settings - Fork 320
Use reflection for constructor in Scala 2.12 #9886
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
Use reflection for constructor in Scala 2.12 #9886
Conversation
|
🎯 Code Coverage 🔗 Commit SHA: 9244e6b | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 53 metrics, 12 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.55.0-SNAPSHOT~9244e6bf0b, baseline=1.55.0-SNAPSHOT~3a5a7f86c9
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.037 s) : 0, 1037103
Total [baseline] (8.688 s) : 0, 8687700
Agent [candidate] (1.029 s) : 0, 1029357
Total [candidate] (8.669 s) : 0, 8668990
section iast
Agent [baseline] (1.162 s) : 0, 1162493
Total [baseline] (9.354 s) : 0, 9353654
Agent [candidate] (1.169 s) : 0, 1169054
Total [candidate] (9.379 s) : 0, 9378726
gantt
title insecure-bank - break down per module: candidate=1.55.0-SNAPSHOT~9244e6bf0b, baseline=1.55.0-SNAPSHOT~3a5a7f86c9
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.488 ms) : 0, 1488
crashtracking [candidate] (1.45 ms) : 0, 1450
BytebuddyAgent [baseline] (707.563 ms) : 0, 707563
BytebuddyAgent [candidate] (701.934 ms) : 0, 701934
GlobalTracer [baseline] (246.195 ms) : 0, 246195
GlobalTracer [candidate] (244.649 ms) : 0, 244649
AppSec [baseline] (32.78 ms) : 0, 32780
AppSec [candidate] (32.24 ms) : 0, 32240
Debugger [baseline] (6.514 ms) : 0, 6514
Debugger [candidate] (6.388 ms) : 0, 6388
Remote Config [baseline] (693.145 µs) : 0, 693
Remote Config [candidate] (699.404 µs) : 0, 699
Telemetry [baseline] (13.239 ms) : 0, 13239
Telemetry [candidate] (15.122 ms) : 0, 15122
Flare Poller [baseline] (7.267 ms) : 0, 7267
Flare Poller [candidate] (5.684 ms) : 0, 5684
section iast
crashtracking [baseline] (1.468 ms) : 0, 1468
crashtracking [candidate] (1.497 ms) : 0, 1497
BytebuddyAgent [baseline] (824.78 ms) : 0, 824780
BytebuddyAgent [candidate] (830.613 ms) : 0, 830613
GlobalTracer [baseline] (234.099 ms) : 0, 234099
GlobalTracer [candidate] (234.937 ms) : 0, 234937
AppSec [baseline] (30.615 ms) : 0, 30615
AppSec [candidate] (26.995 ms) : 0, 26995
Debugger [baseline] (6.073 ms) : 0, 6073
Debugger [candidate] (6.091 ms) : 0, 6091
Remote Config [baseline] (604.39 µs) : 0, 604
Remote Config [candidate] (602.835 µs) : 0, 603
Telemetry [baseline] (8.467 ms) : 0, 8467
Telemetry [candidate] (8.354 ms) : 0, 8354
Flare Poller [baseline] (4.12 ms) : 0, 4120
Flare Poller [candidate] (4.123 ms) : 0, 4123
IAST [baseline] (30.903 ms) : 0, 30903
IAST [candidate] (34.378 ms) : 0, 34378
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.55.0-SNAPSHOT~9244e6bf0b, baseline=1.55.0-SNAPSHOT~3a5a7f86c9
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.032 s) : 0, 1032378
Total [baseline] (10.811 s) : 0, 10810803
Agent [candidate] (1.029 s) : 0, 1028643
Total [candidate] (10.853 s) : 0, 10853173
section appsec
Agent [baseline] (1.201 s) : 0, 1200710
Total [baseline] (11.009 s) : 0, 11008689
Agent [candidate] (1.205 s) : 0, 1204843
Total [candidate] (10.985 s) : 0, 10984917
section iast
Agent [baseline] (1.17 s) : 0, 1169914
Total [baseline] (11.117 s) : 0, 11116898
Agent [candidate] (1.175 s) : 0, 1175383
Total [candidate] (11.013 s) : 0, 11012634
section profiling
Agent [baseline] (1.179 s) : 0, 1178961
Total [baseline] (10.986 s) : 0, 10985766
Agent [candidate] (1.174 s) : 0, 1173824
Total [candidate] (10.878 s) : 0, 10878301
gantt
title petclinic - break down per module: candidate=1.55.0-SNAPSHOT~9244e6bf0b, baseline=1.55.0-SNAPSHOT~3a5a7f86c9
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.479 ms) : 0, 1479
crashtracking [candidate] (1.47 ms) : 0, 1470
BytebuddyAgent [baseline] (704.445 ms) : 0, 704445
BytebuddyAgent [candidate] (701.903 ms) : 0, 701903
GlobalTracer [baseline] (245.074 ms) : 0, 245074
GlobalTracer [candidate] (243.956 ms) : 0, 243956
AppSec [baseline] (32.331 ms) : 0, 32331
AppSec [candidate] (32.182 ms) : 0, 32182
Debugger [baseline] (6.343 ms) : 0, 6343
Debugger [candidate] (6.34 ms) : 0, 6340
Remote Config [baseline] (687.917 µs) : 0, 688
Remote Config [candidate] (682.367 µs) : 0, 682
Telemetry [baseline] (15.728 ms) : 0, 15728
Telemetry [candidate] (14.389 ms) : 0, 14389
Flare Poller [baseline] (4.994 ms) : 0, 4994
Flare Poller [candidate] (6.477 ms) : 0, 6477
section appsec
crashtracking [baseline] (1.465 ms) : 0, 1465
crashtracking [candidate] (1.471 ms) : 0, 1471
BytebuddyAgent [baseline] (724.371 ms) : 0, 724371
BytebuddyAgent [candidate] (728.544 ms) : 0, 728544
GlobalTracer [baseline] (235.625 ms) : 0, 235625
GlobalTracer [candidate] (235.77 ms) : 0, 235770
AppSec [baseline] (174.241 ms) : 0, 174241
AppSec [candidate] (174.08 ms) : 0, 174080
Debugger [baseline] (5.933 ms) : 0, 5933
Debugger [candidate] (5.855 ms) : 0, 5855
Remote Config [baseline] (639.327 µs) : 0, 639
Remote Config [candidate] (614.228 µs) : 0, 614
Telemetry [baseline] (8.47 ms) : 0, 8470
Telemetry [candidate] (8.374 ms) : 0, 8374
Flare Poller [baseline] (3.955 ms) : 0, 3955
Flare Poller [candidate] (3.895 ms) : 0, 3895
IAST [baseline] (24.92 ms) : 0, 24920
IAST [candidate] (25.011 ms) : 0, 25011
section iast
crashtracking [baseline] (1.48 ms) : 0, 1480
crashtracking [candidate] (1.469 ms) : 0, 1469
BytebuddyAgent [baseline] (830.23 ms) : 0, 830230
BytebuddyAgent [candidate] (835.199 ms) : 0, 835199
GlobalTracer [baseline] (235.118 ms) : 0, 235118
GlobalTracer [candidate] (236.276 ms) : 0, 236276
AppSec [baseline] (27.581 ms) : 0, 27581
AppSec [candidate] (28.732 ms) : 0, 28732
Debugger [baseline] (6.178 ms) : 0, 6178
Debugger [candidate] (6.039 ms) : 0, 6039
Remote Config [baseline] (614.429 µs) : 0, 614
Remote Config [candidate] (589.352 µs) : 0, 589
Telemetry [baseline] (8.507 ms) : 0, 8507
Telemetry [candidate] (8.343 ms) : 0, 8343
Flare Poller [baseline] (4.222 ms) : 0, 4222
Flare Poller [candidate] (4.142 ms) : 0, 4142
IAST [baseline] (34.463 ms) : 0, 34463
IAST [candidate] (33.097 ms) : 0, 33097
section profiling
crashtracking [baseline] (1.476 ms) : 0, 1476
crashtracking [candidate] (1.464 ms) : 0, 1464
BytebuddyAgent [baseline] (728.735 ms) : 0, 728735
BytebuddyAgent [candidate] (728.304 ms) : 0, 728304
GlobalTracer [baseline] (221.737 ms) : 0, 221737
GlobalTracer [candidate] (219.747 ms) : 0, 219747
AppSec [baseline] (32.613 ms) : 0, 32613
AppSec [candidate] (32.2 ms) : 0, 32200
Debugger [baseline] (9.228 ms) : 0, 9228
Debugger [candidate] (11.525 ms) : 0, 11525
Remote Config [baseline] (1.439 ms) : 0, 1439
Remote Config [candidate] (2.198 ms) : 0, 2198
Telemetry [baseline] (13.247 ms) : 0, 13247
Telemetry [candidate] (9.766 ms) : 0, 9766
Flare Poller [baseline] (4.151 ms) : 0, 4151
Flare Poller [candidate] (4.079 ms) : 0, 4079
ProfilingAgent [baseline] (110.678 ms) : 0, 110678
ProfilingAgent [candidate] (108.758 ms) : 0, 108758
Profiling [baseline] (111.325 ms) : 0, 111325
Profiling [candidate] (109.403 ms) : 0, 109403
LoadParameters
See matching parameters
SummaryFound 3 performance improvements and 3 performance regressions! Performance is the same for 6 metrics, 12 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.55.0-SNAPSHOT~9244e6bf0b, baseline=1.55.0-SNAPSHOT~3a5a7f86c9
dateFormat X
axisFormat %s
section baseline
no_agent (17.383 ms) : 17208, 17558
. : milestone, 17383,
appsec (19.274 ms) : 19073, 19475
. : milestone, 19274,
code_origins (17.57 ms) : 17397, 17744
. : milestone, 17570,
iast (19.526 ms) : 19332, 19721
. : milestone, 19526,
profiling (20.73 ms) : 20521, 20940
. : milestone, 20730,
tracing (17.582 ms) : 17405, 17758
. : milestone, 17582,
section candidate
no_agent (19.264 ms) : 19067, 19460
. : milestone, 19264,
appsec (19.418 ms) : 19217, 19619
. : milestone, 19418,
code_origins (19.326 ms) : 19129, 19522
. : milestone, 19326,
iast (18.628 ms) : 18439, 18818
. : milestone, 18628,
profiling (20.699 ms) : 20489, 20909
. : milestone, 20699,
tracing (18.216 ms) : 18034, 18398
. : milestone, 18216,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.55.0-SNAPSHOT~9244e6bf0b, baseline=1.55.0-SNAPSHOT~3a5a7f86c9
dateFormat X
axisFormat %s
section baseline
no_agent (1.202 ms) : 1190, 1214
. : milestone, 1202,
iast (3.384 ms) : 3337, 3432
. : milestone, 3384,
iast_FULL (5.867 ms) : 5807, 5926
. : milestone, 5867,
iast_GLOBAL (3.848 ms) : 3787, 3910
. : milestone, 3848,
profiling (1.931 ms) : 1915, 1948
. : milestone, 1931,
tracing (1.826 ms) : 1810, 1841
. : milestone, 1826,
section candidate
no_agent (1.209 ms) : 1197, 1221
. : milestone, 1209,
iast (3.198 ms) : 3160, 3236
. : milestone, 3198,
iast_FULL (5.865 ms) : 5806, 5924
. : milestone, 5865,
iast_GLOBAL (3.606 ms) : 3549, 3664
. : milestone, 3606,
profiling (1.894 ms) : 1877, 1910
. : milestone, 1894,
tracing (1.818 ms) : 1803, 1833
. : milestone, 1818,
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 biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.55.0-SNAPSHOT~9244e6bf0b, baseline=1.55.0-SNAPSHOT~3a5a7f86c9
dateFormat X
axisFormat %s
section baseline
no_agent (14.768 s) : 14768000, 14768000
. : milestone, 14768000,
appsec (15.016 s) : 15016000, 15016000
. : milestone, 15016000,
iast (18.722 s) : 18722000, 18722000
. : milestone, 18722000,
iast_GLOBAL (17.943 s) : 17943000, 17943000
. : milestone, 17943000,
profiling (15.172 s) : 15172000, 15172000
. : milestone, 15172000,
tracing (15.021 s) : 15021000, 15021000
. : milestone, 15021000,
section candidate
no_agent (14.862 s) : 14862000, 14862000
. : milestone, 14862000,
appsec (14.752 s) : 14752000, 14752000
. : milestone, 14752000,
iast (18.283 s) : 18283000, 18283000
. : milestone, 18283000,
iast_GLOBAL (17.807 s) : 17807000, 17807000
. : milestone, 17807000,
profiling (15.749 s) : 15749000, 15749000
. : milestone, 15749000,
tracing (15.346 s) : 15346000, 15346000
. : milestone, 15346000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.55.0-SNAPSHOT~9244e6bf0b, baseline=1.55.0-SNAPSHOT~3a5a7f86c9
dateFormat X
axisFormat %s
section baseline
no_agent (1.472 ms) : 1460, 1483
. : milestone, 1472,
appsec (2.469 ms) : 2417, 2521
. : milestone, 2469,
iast (2.215 ms) : 2150, 2279
. : milestone, 2215,
iast_GLOBAL (2.258 ms) : 2193, 2322
. : milestone, 2258,
profiling (2.076 ms) : 2023, 2130
. : milestone, 2076,
tracing (2.029 ms) : 1979, 2080
. : milestone, 2029,
section candidate
no_agent (1.472 ms) : 1461, 1484
. : milestone, 1472,
appsec (3.655 ms) : 3440, 3870
. : milestone, 3655,
iast (2.209 ms) : 2145, 2273
. : milestone, 2209,
iast_GLOBAL (2.261 ms) : 2196, 2326
. : milestone, 2261,
profiling (2.082 ms) : 2029, 2136
. : milestone, 2082,
tracing (2.032 ms) : 1982, 2083
. : milestone, 2032,
|
52646b2 to
9244e6b
Compare
91f2995
into
adrien.boitreaud/fix-muzzle-mismatch
…nstrumented (#9872) * relax muzzle check * relax more * spotlessApply * fix muzzle block by avoiding streaming hard deps and relaxing listener bus matchers * remove unnecessary defense on StreamExecution * revert changes on OL listener * improve getMicroBatchExecutionBatchIdKey * import InvocationTargetException * Update AbstractDatadogSparkListener.java * no need reflection since key is known * Update AbstractSparkInstrumentation.java * reflection against SparkPlanInfoAdvice * spotless * [DJM-974] Use reflection for constructor in Scala 2.12, lookup by parameter classes (#9886) --------- Co-authored-by: Charles Yu <[email protected]>
What Does This Do
Updates
SparkPlanInfoAdvicefor Scala 2.12 to use a reflected constructor rather the imported one to improve compatibility with different versions and forks of Spark.Note: also updating to not reflect the
SparkPlanInfoclass since we rely on it elsewhere in the tracer anyways (e.g.SparkSQLUtilsand in the decorations), so it felt reasonable to eliminate the additional reflect call and call it directly.Motivation
The current
SparkPlanInfoAdviceinstrumentation causes the tracer to fail entirely when encountering an unknownSparkPlanInfoconstructor. Instead, we should only fail theSparkPlanInfoAdviceinstrumentation and allow the listener and other Spark tracer components to continue unimpeded.Additional Notes
This was tested in our Databricks sandbox environment.
Contributor Checklist
type:and (comp:orinst:) labels in addition to any useful labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: DJM-974