-
Notifications
You must be signed in to change notification settings - Fork 283
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
Add Language Specifics in Symbol Extraction #6119
Conversation
LanguageSpecifics add specific information to symbol/scopes for Classes, methods and fields. It's relate to - access modifiers - annotations - super class - interfaces - return type
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 54 cases. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.22.0-SNAPSHOT~f01ed6ffbb, baseline=1.23.0-SNAPSHOT~205e504500
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.028 s) : 0, 1028389
Total [baseline] (9.358 s) : 0, 9358333
Agent [candidate] (1.038 s) : 0, 1038055
Total [candidate] (9.39 s) : 0, 9389549
section appsec
Agent [baseline] (1.118 s) : 0, 1118140
Total [baseline] (9.375 s) : 0, 9375101
Agent [candidate] (1.119 s) : 0, 1118897
Total [candidate] (9.433 s) : 0, 9432901
section iast
Agent [baseline] (1.155 s) : 0, 1155500
Total [baseline] (9.55 s) : 0, 9549704
Agent [candidate] (1.165 s) : 0, 1164856
Total [candidate] (9.54 s) : 0, 9539624
section profiling
Agent [baseline] (1.205 s) : 0, 1204754
Total [baseline] (9.581 s) : 0, 9580602
Agent [candidate] (1.206 s) : 0, 1205561
Total [candidate] (9.563 s) : 0, 9562922
gantt
title petclinic - break down per module: candidate=1.22.0-SNAPSHOT~f01ed6ffbb, baseline=1.23.0-SNAPSHOT~205e504500
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (642.828 ms) : 0, 642828
BytebuddyAgent [candidate] (648.864 ms) : 0, 648864
GlobalTracer [baseline] (295.157 ms) : 0, 295157
GlobalTracer [candidate] (298.235 ms) : 0, 298235
AppSec [baseline] (49.078 ms) : 0, 49078
AppSec [candidate] (49.266 ms) : 0, 49266
Remote Config [baseline] (682.836 µs) : 0, 683
Remote Config [candidate] (689.27 µs) : 0, 689
Telemetry [baseline] (6.082 ms) : 0, 6082
Telemetry [candidate] (6.119 ms) : 0, 6119
section appsec
BytebuddyAgent [baseline] (643.958 ms) : 0, 643958
BytebuddyAgent [candidate] (644.024 ms) : 0, 644024
GlobalTracer [baseline] (294.224 ms) : 0, 294224
GlobalTracer [candidate] (295.426 ms) : 0, 295426
AppSec [baseline] (139.034 ms) : 0, 139034
AppSec [candidate] (138.536 ms) : 0, 138536
Remote Config [baseline] (647.636 µs) : 0, 648
Remote Config [candidate] (638.506 µs) : 0, 639
Telemetry [baseline] (5.747 ms) : 0, 5747
Telemetry [candidate] (5.756 ms) : 0, 5756
section iast
BytebuddyAgent [baseline] (773.867 ms) : 0, 773867
BytebuddyAgent [candidate] (779.504 ms) : 0, 779504
GlobalTracer [baseline] (274.736 ms) : 0, 274736
GlobalTracer [candidate] (276.608 ms) : 0, 276608
AppSec [baseline] (47.787 ms) : 0, 47787
AppSec [candidate] (48.095 ms) : 0, 48095
Remote Config [baseline] (577.719 µs) : 0, 578
Remote Config [candidate] (598.627 µs) : 0, 599
Telemetry [baseline] (8.276 ms) : 0, 8276
Telemetry [candidate] (7.714 ms) : 0, 7714
IAST [baseline] (15.64 ms) : 0, 15640
IAST [candidate] (17.484 ms) : 0, 17484
section profiling
BytebuddyAgent [baseline] (654.202 ms) : 0, 654202
BytebuddyAgent [candidate] (655.385 ms) : 0, 655385
GlobalTracer [baseline] (359.783 ms) : 0, 359783
GlobalTracer [candidate] (359.648 ms) : 0, 359648
AppSec [baseline] (49.578 ms) : 0, 49578
AppSec [candidate] (49.264 ms) : 0, 49264
Remote Config [baseline] (656.091 µs) : 0, 656
Remote Config [candidate] (658.214 µs) : 0, 658
Telemetry [baseline] (6.056 ms) : 0, 6056
Telemetry [candidate] (6.099 ms) : 0, 6099
ProfilingAgent [baseline] (81.051 ms) : 0, 81051
ProfilingAgent [candidate] (80.901 ms) : 0, 80901
Profiling [baseline] (81.075 ms) : 0, 81075
Profiling [candidate] (80.926 ms) : 0, 80926
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.22.0-SNAPSHOT~f01ed6ffbb, baseline=1.23.0-SNAPSHOT~205e504500
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.029 s) : 0, 1028776
Total [baseline] (8.773 s) : 0, 8773388
Agent [candidate] (1.03 s) : 0, 1030159
Total [candidate] (8.772 s) : 0, 8772459
section iast
Agent [baseline] (1.156 s) : 0, 1156252
Total [baseline] (9.289 s) : 0, 9289067
Agent [candidate] (1.163 s) : 0, 1163013
Total [candidate] (9.337 s) : 0, 9336877
section iast_TELEMETRY_OFF
Agent [baseline] (1.158 s) : 0, 1158006
Total [baseline] (9.289 s) : 0, 9289141
Agent [candidate] (1.148 s) : 0, 1147627
Total [candidate] (9.337 s) : 0, 9337372
gantt
title insecure-bank - break down per module: candidate=1.22.0-SNAPSHOT~f01ed6ffbb, baseline=1.23.0-SNAPSHOT~205e504500
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (643.815 ms) : 0, 643815
BytebuddyAgent [candidate] (643.177 ms) : 0, 643177
GlobalTracer [baseline] (294.68 ms) : 0, 294680
GlobalTracer [candidate] (296.239 ms) : 0, 296239
AppSec [baseline] (48.836 ms) : 0, 48836
AppSec [candidate] (49.349 ms) : 0, 49349
Remote Config [baseline] (677.871 µs) : 0, 678
Remote Config [candidate] (683.102 µs) : 0, 683
Telemetry [baseline] (6.069 ms) : 0, 6069
Telemetry [candidate] (6.075 ms) : 0, 6075
section iast
BytebuddyAgent [baseline] (773.308 ms) : 0, 773308
BytebuddyAgent [candidate] (779.107 ms) : 0, 779107
GlobalTracer [baseline] (274.115 ms) : 0, 274115
GlobalTracer [candidate] (276.321 ms) : 0, 276321
AppSec [baseline] (47.189 ms) : 0, 47189
AppSec [candidate] (48.303 ms) : 0, 48303
IAST [baseline] (17.389 ms) : 0, 17389
IAST [candidate] (16.205 ms) : 0, 16205
Remote Config [baseline] (603.247 µs) : 0, 603
Remote Config [candidate] (598.157 µs) : 0, 598
Telemetry [baseline] (9.109 ms) : 0, 9109
Telemetry [candidate] (7.61 ms) : 0, 7610
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (774.227 ms) : 0, 774227
BytebuddyAgent [candidate] (767.699 ms) : 0, 767699
GlobalTracer [baseline] (276.346 ms) : 0, 276346
GlobalTracer [candidate] (275.573 ms) : 0, 275573
AppSec [baseline] (46.988 ms) : 0, 46988
AppSec [candidate] (46.601 ms) : 0, 46601
IAST [baseline] (16.008 ms) : 0, 16008
IAST [candidate] (15.547 ms) : 0, 15547
Remote Config [baseline] (578.051 µs) : 0, 578
Remote Config [candidate] (622.033 µs) : 0, 622
Telemetry [baseline] (8.874 ms) : 0, 8874
Telemetry [candidate] (6.954 ms) : 0, 6954
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 22 cases. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.22.0-SNAPSHOT~f01ed6ffbb, baseline=1.23.0-SNAPSHOT~205e504500
dateFormat X
axisFormat %s
section baseline
no_agent (1.324 ms) : 1305, 1344
. : milestone, 1324,
appsec (1.691 ms) : 1666, 1716
. : milestone, 1691,
iast (1.492 ms) : 1468, 1517
. : milestone, 1492,
profiling (1.482 ms) : 1457, 1507
. : milestone, 1482,
tracing (1.447 ms) : 1422, 1471
. : milestone, 1447,
section candidate
no_agent (1.337 ms) : 1318, 1356
. : milestone, 1337,
appsec (1.693 ms) : 1669, 1718
. : milestone, 1693,
iast (1.487 ms) : 1463, 1511
. : milestone, 1487,
profiling (1.455 ms) : 1429, 1480
. : milestone, 1455,
tracing (1.436 ms) : 1411, 1460
. : milestone, 1436,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.22.0-SNAPSHOT~f01ed6ffbb, baseline=1.23.0-SNAPSHOT~205e504500
dateFormat X
axisFormat %s
section baseline
no_agent (364.819 µs) : 345, 384
. : milestone, 365,
iast (462.638 µs) : 441, 484
. : milestone, 463,
iast_FULL (531.14 µs) : 510, 552
. : milestone, 531,
iast_INACTIVE (432.376 µs) : 411, 454
. : milestone, 432,
iast_TELEMETRY_OFF (457.604 µs) : 437, 479
. : milestone, 458,
tracing (434.263 µs) : 413, 455
. : milestone, 434,
section candidate
no_agent (367.118 µs) : 346, 389
. : milestone, 367,
iast (464.132 µs) : 443, 485
. : milestone, 464,
iast_FULL (526.293 µs) : 505, 547
. : milestone, 526,
iast_INACTIVE (432.283 µs) : 411, 454
. : milestone, 432,
iast_TELEMETRY_OFF (463.395 µs) : 442, 485
. : milestone, 463,
tracing (438.323 µs) : 417, 460
. : milestone, 438,
|
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.
Nice work, thanks. Added some comments / questions.
assertLangSpecifics( | ||
mainMethodScope.getLanguageSpecifics(), | ||
asList("public", "static"), | ||
asList("@com.datadog.debugger.symbol.MyAnnotation"), |
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.
Can we also get the parameter value? E.g. "class"
, "field"
and "method"
?
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.
Parameter values are complicated because it means we need to serialize as string the value that could be potentially be anything like a custom class from user code. so calling toString on it is problematic.
So I choose deliberately to not try to get those values.
We could revisit that to get only safe values, though, but I am not sure it's that relevant for us to get all those information right now
Object.class.getTypeName(), | ||
asList("java.lang.annotation.Annotation"), | ||
null); | ||
} |
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.
Can we also assert on the other fields to make sure that the access modifiers are correctly reported?
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.
ah yes, missed them 🤦
Object.class.getTypeName(), | ||
null, | ||
null); | ||
Scope m3MethodScope = i1ClassScope.getScopes().get(0); |
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.
Interesting, can we actually put a method probe in a default function today?
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.
yes, in all methods having bytecode instructions
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.
Thanks!
What Does This Do
LanguageSpecifics add specific information to symbol/scopes for Classes, methods and fields. It's relate to
Motivation
Enrich the symbol extraction
Additional Notes
Jira ticket: DEBUG-1891