-
Notifications
You must be signed in to change notification settings - Fork 301
Add JSON parsing support #8579
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
base: master
Are you sure you want to change the base?
Add JSON parsing support #8579
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 58 metrics, 5 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.48.0-SNAPSHOT~521e2e6d26, baseline=1.48.0-SNAPSHOT~b046b86617
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.049 s) : 0, 1048819
Total [baseline] (8.679 s) : 0, 8678936
Agent [candidate] (1.043 s) : 0, 1042972
Total [candidate] (8.671 s) : 0, 8671407
section iast
Agent [baseline] (1.17 s) : 0, 1170036
Total [baseline] (9.261 s) : 0, 9261017
Agent [candidate] (1.179 s) : 0, 1178763
Total [candidate] (9.279 s) : 0, 9279091
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.173 s) : 0, 1172573
Total [baseline] (9.193 s) : 0, 9192628
Agent [candidate] (1.176 s) : 0, 1175656
Total [candidate] (9.215 s) : 0, 9214672
section iast_TELEMETRY_OFF
Agent [baseline] (1.171 s) : 0, 1171474
Total [baseline] (9.246 s) : 0, 9246289
Agent [candidate] (1.172 s) : 0, 1172088
Total [candidate] (9.257 s) : 0, 9257232
gantt
title insecure-bank - break down per module: candidate=1.48.0-SNAPSHOT~521e2e6d26, baseline=1.48.0-SNAPSHOT~b046b86617
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (723.314 ms) : 0, 723314
BytebuddyAgent [candidate] (718.151 ms) : 0, 718151
GlobalTracer [baseline] (240.408 ms) : 0, 240408
GlobalTracer [candidate] (240.048 ms) : 0, 240048
AppSec [baseline] (54.712 ms) : 0, 54712
AppSec [candidate] (54.578 ms) : 0, 54578
Remote Config [baseline] (679.594 µs) : 0, 680
Remote Config [candidate] (679.577 µs) : 0, 680
Telemetry [baseline] (14.327 ms) : 0, 14327
Telemetry [candidate] (14.348 ms) : 0, 14348
section iast
BytebuddyAgent [baseline] (837.588 ms) : 0, 837588
BytebuddyAgent [candidate] (843.908 ms) : 0, 843908
GlobalTracer [baseline] (229.699 ms) : 0, 229699
GlobalTracer [candidate] (231.057 ms) : 0, 231057
AppSec [baseline] (55.784 ms) : 0, 55784
AppSec [candidate] (55.386 ms) : 0, 55386
Remote Config [baseline] (595.951 µs) : 0, 596
Remote Config [candidate] (603.783 µs) : 0, 604
Telemetry [baseline] (8.619 ms) : 0, 8619
Telemetry [candidate] (8.705 ms) : 0, 8705
IAST [baseline] (22.545 ms) : 0, 22545
IAST [candidate] (23.685 ms) : 0, 23685
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (838.288 ms) : 0, 838288
BytebuddyAgent [candidate] (840.953 ms) : 0, 840953
GlobalTracer [baseline] (230.354 ms) : 0, 230354
GlobalTracer [candidate] (230.905 ms) : 0, 230905
AppSec [baseline] (56.171 ms) : 0, 56171
AppSec [candidate] (56.187 ms) : 0, 56187
Remote Config [baseline] (611.237 µs) : 0, 611
Remote Config [candidate] (600.839 µs) : 0, 601
Telemetry [baseline] (8.687 ms) : 0, 8687
Telemetry [candidate] (8.697 ms) : 0, 8697
IAST [baseline] (23.152 ms) : 0, 23152
IAST [candidate] (22.882 ms) : 0, 22882
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (838.732 ms) : 0, 838732
BytebuddyAgent [candidate] (837.329 ms) : 0, 837329
GlobalTracer [baseline] (229.631 ms) : 0, 229631
GlobalTracer [candidate] (231.126 ms) : 0, 231126
AppSec [baseline] (55.581 ms) : 0, 55581
AppSec [candidate] (56.508 ms) : 0, 56508
Remote Config [baseline] (605.228 µs) : 0, 605
Remote Config [candidate] (599.695 µs) : 0, 600
Telemetry [baseline] (8.595 ms) : 0, 8595
Telemetry [candidate] (8.692 ms) : 0, 8692
IAST [baseline] (22.963 ms) : 0, 22963
IAST [candidate] (22.598 ms) : 0, 22598
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.48.0-SNAPSHOT~521e2e6d26, baseline=1.48.0-SNAPSHOT~b046b86617
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.04 s) : 0, 1039895
Total [baseline] (10.491 s) : 0, 10490575
Agent [candidate] (1.042 s) : 0, 1042358
Total [candidate] (10.477 s) : 0, 10477082
section appsec
Agent [baseline] (1.184 s) : 0, 1183656
Total [baseline] (10.737 s) : 0, 10737034
Agent [candidate] (1.184 s) : 0, 1184222
Total [candidate] (10.729 s) : 0, 10728776
section iast
Agent [baseline] (1.171 s) : 0, 1171225
Total [baseline] (10.993 s) : 0, 10993085
Agent [candidate] (1.172 s) : 0, 1171593
Total [candidate] (11.007 s) : 0, 11006786
section profiling
Agent [baseline] (1.262 s) : 0, 1262314
Total [baseline] (10.925 s) : 0, 10925294
Agent [candidate] (1.265 s) : 0, 1265351
Total [candidate] (10.811 s) : 0, 10811288
gantt
title petclinic - break down per module: candidate=1.48.0-SNAPSHOT~521e2e6d26, baseline=1.48.0-SNAPSHOT~b046b86617
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (718.903 ms) : 0, 718903
BytebuddyAgent [candidate] (720.379 ms) : 0, 720379
GlobalTracer [baseline] (239.709 ms) : 0, 239709
GlobalTracer [candidate] (239.935 ms) : 0, 239935
AppSec [baseline] (54.675 ms) : 0, 54675
AppSec [candidate] (54.75 ms) : 0, 54750
Remote Config [baseline] (678.865 µs) : 0, 679
Remote Config [candidate] (689.536 µs) : 0, 690
Telemetry [baseline] (10.716 ms) : 0, 10716
Telemetry [candidate] (11.378 ms) : 0, 11378
section appsec
BytebuddyAgent [baseline] (735.136 ms) : 0, 735136
BytebuddyAgent [candidate] (736.757 ms) : 0, 736757
GlobalTracer [baseline] (236.681 ms) : 0, 236681
GlobalTracer [candidate] (236.534 ms) : 0, 236534
AppSec [baseline] (176.114 ms) : 0, 176114
AppSec [candidate] (176.022 ms) : 0, 176022
Remote Config [baseline] (665.287 µs) : 0, 665
Remote Config [candidate] (660.646 µs) : 0, 661
Telemetry [baseline] (8.994 ms) : 0, 8994
Telemetry [candidate] (8.244 ms) : 0, 8244
IAST [baseline] (21.637 ms) : 0, 21637
IAST [candidate] (21.545 ms) : 0, 21545
section iast
BytebuddyAgent [baseline] (837.789 ms) : 0, 837789
BytebuddyAgent [candidate] (837.725 ms) : 0, 837725
GlobalTracer [baseline] (229.671 ms) : 0, 229671
GlobalTracer [candidate] (230.678 ms) : 0, 230678
AppSec [baseline] (56.438 ms) : 0, 56438
AppSec [candidate] (55.933 ms) : 0, 55933
Remote Config [baseline] (601.041 µs) : 0, 601
Remote Config [candidate] (596.188 µs) : 0, 596
Telemetry [baseline] (8.703 ms) : 0, 8703
Telemetry [candidate] (8.581 ms) : 0, 8581
IAST [baseline] (22.735 ms) : 0, 22735
IAST [candidate] (22.809 ms) : 0, 22809
section profiling
BytebuddyAgent [baseline] (709.596 ms) : 0, 709596
BytebuddyAgent [candidate] (714.382 ms) : 0, 714382
GlobalTracer [baseline] (350.29 ms) : 0, 350290
GlobalTracer [candidate] (351.523 ms) : 0, 351523
AppSec [baseline] (54.638 ms) : 0, 54638
AppSec [candidate] (53.123 ms) : 0, 53123
Remote Config [baseline] (690.408 µs) : 0, 690
Remote Config [candidate] (662.148 µs) : 0, 662
Telemetry [baseline] (9.133 ms) : 0, 9133
Telemetry [candidate] (8.995 ms) : 0, 8995
ProfilingAgent [baseline] (97.102 ms) : 0, 97102
ProfilingAgent [candidate] (95.567 ms) : 0, 95567
Profiling [baseline] (97.126 ms) : 0, 97126
Profiling [candidate] (95.591 ms) : 0, 95591
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 13 metrics, 17 unstable metrics. Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.48.0-SNAPSHOT~521e2e6d26, baseline=1.48.0-SNAPSHOT~b046b86617
dateFormat X
axisFormat %s
section baseline
no_agent (376.861 µs) : 357, 397
. : milestone, 377,
iast (513.062 µs) : 491, 535
. : milestone, 513,
iast_FULL (731.788 µs) : 710, 754
. : milestone, 732,
iast_GLOBAL (560.167 µs) : 538, 583
. : milestone, 560,
iast_HARDCODED_SECRET_DISABLED (510.731 µs) : 489, 532
. : milestone, 511,
iast_INACTIVE (455.827 µs) : 435, 477
. : milestone, 456,
iast_TELEMETRY_OFF (505.305 µs) : 483, 527
. : milestone, 505,
tracing (456.498 µs) : 435, 478
. : milestone, 456,
section candidate
no_agent (388.316 µs) : 365, 411
. : milestone, 388,
iast (511.474 µs) : 490, 533
. : milestone, 511,
iast_FULL (729.954 µs) : 708, 752
. : milestone, 730,
iast_GLOBAL (553.115 µs) : 531, 575
. : milestone, 553,
iast_HARDCODED_SECRET_DISABLED (508.57 µs) : 487, 530
. : milestone, 509,
iast_INACTIVE (464.547 µs) : 443, 486
. : milestone, 465,
iast_TELEMETRY_OFF (497.095 µs) : 475, 520
. : milestone, 497,
tracing (456.954 µs) : 436, 478
. : milestone, 457,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.48.0-SNAPSHOT~521e2e6d26, baseline=1.48.0-SNAPSHOT~b046b86617
dateFormat X
axisFormat %s
section baseline
no_agent (1.366 ms) : 1345, 1386
. : milestone, 1366,
appsec (1.72 ms) : 1697, 1743
. : milestone, 1720,
appsec_no_iast (1.729 ms) : 1704, 1753
. : milestone, 1729,
code_origins (1.676 ms) : 1649, 1703
. : milestone, 1676,
iast (1.514 ms) : 1489, 1538
. : milestone, 1514,
profiling (1.516 ms) : 1492, 1541
. : milestone, 1516,
tracing (1.49 ms) : 1466, 1514
. : milestone, 1490,
section candidate
no_agent (1.35 ms) : 1330, 1369
. : milestone, 1350,
appsec (1.744 ms) : 1721, 1768
. : milestone, 1744,
appsec_no_iast (1.74 ms) : 1716, 1764
. : milestone, 1740,
code_origins (1.689 ms) : 1663, 1714
. : milestone, 1689,
iast (1.511 ms) : 1487, 1534
. : milestone, 1511,
profiling (1.509 ms) : 1487, 1532
. : milestone, 1509,
tracing (1.497 ms) : 1473, 1521
. : milestone, 1497,
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~521e2e6d26, baseline=1.48.0-SNAPSHOT~b046b86617
dateFormat X
axisFormat %s
section baseline
no_agent (14.924 s) : 14924000, 14924000
. : milestone, 14924000,
appsec (14.994 s) : 14994000, 14994000
. : milestone, 14994000,
iast (18.873 s) : 18873000, 18873000
. : milestone, 18873000,
iast_GLOBAL (17.875 s) : 17875000, 17875000
. : milestone, 17875000,
profiling (15.629 s) : 15629000, 15629000
. : milestone, 15629000,
tracing (15.303 s) : 15303000, 15303000
. : milestone, 15303000,
section candidate
no_agent (15.405 s) : 15405000, 15405000
. : milestone, 15405000,
appsec (15.093 s) : 15093000, 15093000
. : milestone, 15093000,
iast (18.603 s) : 18603000, 18603000
. : milestone, 18603000,
iast_GLOBAL (18.192 s) : 18192000, 18192000
. : milestone, 18192000,
profiling (14.862 s) : 14862000, 14862000
. : milestone, 14862000,
tracing (14.7 s) : 14700000, 14700000
. : milestone, 14700000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.48.0-SNAPSHOT~521e2e6d26, baseline=1.48.0-SNAPSHOT~b046b86617
dateFormat X
axisFormat %s
section baseline
no_agent (1.474 ms) : 1463, 1486
. : milestone, 1474,
appsec (2.35 ms) : 2306, 2394
. : milestone, 2350,
iast (2.121 ms) : 2066, 2177
. : milestone, 2121,
iast_GLOBAL (2.168 ms) : 2112, 2224
. : milestone, 2168,
profiling (1.983 ms) : 1938, 2027
. : milestone, 1983,
tracing (1.958 ms) : 1915, 2001
. : milestone, 1958,
section candidate
no_agent (1.474 ms) : 1462, 1485
. : milestone, 1474,
appsec (2.333 ms) : 2289, 2377
. : milestone, 2333,
iast (2.12 ms) : 2064, 2176
. : milestone, 2120,
iast_GLOBAL (2.159 ms) : 2103, 2215
. : milestone, 2159,
profiling (1.967 ms) : 1923, 2011
. : milestone, 1967,
tracing (1.944 ms) : 1902, 1987
. : milestone, 1944,
|
* @throws IOException If the JSON is invalid or a reader error occurs. | ||
*/ | ||
@SuppressWarnings("unchecked") | ||
public static Map<String, Object> fromJsonToMap(String json) throws IOException { |
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.
Do we have actual consumer candidates for this?
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.
That's the mirror function of JsonMapper.toJson(Map)
.
About actual consumers, I think there are some instrumentations that parse JSON object already.
I will need to review and migrate then in another PR.
What Does This Do
This PR introduces JSON reading / parsing capability to the
json
component.Motivation
Only JSON writer was implemented to write JSON payload.
Now, we should be able to read input JSON payload too.
Additional Notes
The parser is not bullet-proofed but I added a good amount of testing.
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-78