Skip to content

Conversation

@amarziali
Copy link
Contributor

What Does This Do

Improves CSS serializer performances by caching peer tags creations (avoids also utf8 conversions)

The cache has been choosen big enough to contains high cardinality tag values like (peer.hostname). -> tested with org2

A JMH test shows that in case of cache hit (obviously) performs better (see below).

The peer tags cache is unbounded since those tags have low cardinality (they are fixed and returned by the agent).


Benchmark  (NO CACHE)                                                        Mode  Cnt      Score     Error   Units
ConflatingMetricsAggregatorBenchmark.benchmark                     avgt    3      9.223 ±   0.622   us/op
ConflatingMetricsAggregatorBenchmark.benchmark:gc.alloc.rate       avgt    3   2177.221 ± 147.254  MB/sec
ConflatingMetricsAggregatorBenchmark.benchmark:gc.alloc.rate.norm  avgt    3  21056.002 ±   0.103    B/op
ConflatingMetricsAggregatorBenchmark.benchmark:gc.count            avgt    3    840.000            counts
ConflatingMetricsAggregatorBenchmark.benchmark:gc.time             avgt    3    573.000                ms
❯

Benchmark  (WITH CACHE)                                                        Mode  Cnt      Score     Error   Units
ConflatingMetricsAggregatorBenchmark.benchmark                     avgt    3      7.951 ±   0.986   us/op
ConflatingMetricsAggregatorBenchmark.benchmark:gc.alloc.rate       avgt    3   1788.643 ± 221.065  MB/sec
ConflatingMetricsAggregatorBenchmark.benchmark:gc.alloc.rate.norm  avgt    3  14911.998 ±   0.052    B/op
ConflatingMetricsAggregatorBenchmark.benchmark:gc.count            avgt    3    897.000            counts
ConflatingMetricsAggregatorBenchmark.benchmark:gc.time             avgt    3    537.000                ms

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@amarziali amarziali requested a review from a team as a code owner August 7, 2025 15:13
@amarziali amarziali requested review from bric3 and mcculls August 7, 2025 15:13
@amarziali amarziali changed the title Andrea.marziali/css improve Improves CSS peer tag aggregation Aug 7, 2025
@datadog-official
Copy link

datadog-official bot commented Aug 7, 2025

Code coverage: total 57.16%, patch 100.00% (view details)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 5c744a7 | Docs | Was this helpful? Give us feedback!

@pr-commenter
Copy link

pr-commenter bot commented Aug 7, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master andrea.marziali/css-improve
git_commit_date 1754897199 1754899480
git_commit_sha 0eeb9e5 5c744a7
release_version 1.53.0-SNAPSHOT~0eeb9e597f 1.53.0-SNAPSHOT~5c744a7106
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1754901357 1754901357
ci_job_id 1073210944 1073210944
ci_pipeline_id 73241479 73241479
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-gyl7p9tz 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-gyl7p9tz 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 45 metrics, 14 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.53.0-SNAPSHOT~5c744a7106, baseline=1.53.0-SNAPSHOT~0eeb9e597f

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.042 s) : 0, 1042436
Total [baseline] (8.579 s) : 0, 8578585
Agent [candidate] (1.045 s) : 0, 1044876
Total [candidate] (8.61 s) : 0, 8610311
section iast
Agent [baseline] (1.178 s) : 0, 1178409
Total [baseline] (9.313 s) : 0, 9312954
Agent [candidate] (1.192 s) : 0, 1191996
Total [candidate] (9.345 s) : 0, 9345352
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.042 s -
Agent iast 1.178 s 135.973 ms (13.0%)
Total tracing 8.579 s -
Total iast 9.313 s 734.369 ms (8.6%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.045 s -
Agent iast 1.192 s 147.119 ms (14.1%)
Total tracing 8.61 s -
Total iast 9.345 s 735.041 ms (8.5%)
gantt
    title insecure-bank - break down per module: candidate=1.53.0-SNAPSHOT~5c744a7106, baseline=1.53.0-SNAPSHOT~0eeb9e597f

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.434 ms) : 0, 1434
crashtracking [candidate] (1.428 ms) : 0, 1428
BytebuddyAgent [baseline] (729.618 ms) : 0, 729618
BytebuddyAgent [candidate] (731.424 ms) : 0, 731424
GlobalTracer [baseline] (241.215 ms) : 0, 241215
GlobalTracer [candidate] (241.772 ms) : 0, 241772
AppSec [baseline] (29.95 ms) : 0, 29950
AppSec [candidate] (30.037 ms) : 0, 30037
Debugger [baseline] (5.975 ms) : 0, 5975
Debugger [candidate] (6.039 ms) : 0, 6039
Remote Config [baseline] (646.264 µs) : 0, 646
Remote Config [candidate] (648.805 µs) : 0, 649
Telemetry [baseline] (12.677 ms) : 0, 12677
Telemetry [candidate] (12.613 ms) : 0, 12613
section iast
crashtracking [baseline] (1.436 ms) : 0, 1436
crashtracking [candidate] (1.45 ms) : 0, 1450
BytebuddyAgent [baseline] (850.779 ms) : 0, 850779
BytebuddyAgent [candidate] (862.13 ms) : 0, 862130
GlobalTracer [baseline] (233.215 ms) : 0, 233215
GlobalTracer [candidate] (234.84 ms) : 0, 234840
IAST [baseline] (28.29 ms) : 0, 28290
IAST [candidate] (27.999 ms) : 0, 27999
AppSec [baseline] (29.139 ms) : 0, 29139
AppSec [candidate] (28.905 ms) : 0, 28905
Debugger [baseline] (5.721 ms) : 0, 5721
Debugger [candidate] (6.611 ms) : 0, 6611
Remote Config [baseline] (580.464 µs) : 0, 580
Remote Config [candidate] (606.523 µs) : 0, 607
Telemetry [baseline] (8.262 ms) : 0, 8262
Telemetry [candidate] (8.223 ms) : 0, 8223
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.53.0-SNAPSHOT~5c744a7106, baseline=1.53.0-SNAPSHOT~0eeb9e597f

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.045 s) : 0, 1044755
Total [baseline] (10.686 s) : 0, 10685524
Agent [candidate] (1.048 s) : 0, 1047558
Total [candidate] (10.635 s) : 0, 10635385
section appsec
Agent [baseline] (1.227 s) : 0, 1226696
Total [baseline] (10.808 s) : 0, 10807506
Agent [candidate] (1.226 s) : 0, 1225676
Total [candidate] (10.778 s) : 0, 10777642
section iast
Agent [baseline] (1.186 s) : 0, 1185816
Total [baseline] (10.964 s) : 0, 10963954
Agent [candidate] (1.174 s) : 0, 1173907
Total [candidate] (10.948 s) : 0, 10948003
section profiling
Agent [baseline] (1.194 s) : 0, 1193708
Total [baseline] (10.896 s) : 0, 10896483
Agent [candidate] (1.199 s) : 0, 1199089
Total [candidate] (10.858 s) : 0, 10858119
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.045 s -
Agent appsec 1.227 s 181.941 ms (17.4%)
Agent iast 1.186 s 141.062 ms (13.5%)
Agent profiling 1.194 s 148.953 ms (14.3%)
Total tracing 10.686 s -
Total appsec 10.808 s 121.983 ms (1.1%)
Total iast 10.964 s 278.431 ms (2.6%)
Total profiling 10.896 s 210.959 ms (2.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.048 s -
Agent appsec 1.226 s 178.118 ms (17.0%)
Agent iast 1.174 s 126.349 ms (12.1%)
Agent profiling 1.199 s 151.53 ms (14.5%)
Total tracing 10.635 s -
Total appsec 10.778 s 142.257 ms (1.3%)
Total iast 10.948 s 312.618 ms (2.9%)
Total profiling 10.858 s 222.734 ms (2.1%)
gantt
    title petclinic - break down per module: candidate=1.53.0-SNAPSHOT~5c744a7106, baseline=1.53.0-SNAPSHOT~0eeb9e597f

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.427 ms) : 0, 1427
crashtracking [candidate] (1.462 ms) : 0, 1462
BytebuddyAgent [baseline] (731.224 ms) : 0, 731224
BytebuddyAgent [candidate] (735.101 ms) : 0, 735101
GlobalTracer [baseline] (241.691 ms) : 0, 241691
GlobalTracer [candidate] (242.936 ms) : 0, 242936
AppSec [baseline] (30.017 ms) : 0, 30017
AppSec [candidate] (30.258 ms) : 0, 30258
Debugger [baseline] (6.026 ms) : 0, 6026
Debugger [candidate] (6.054 ms) : 0, 6054
Remote Config [baseline] (647.786 µs) : 0, 648
Remote Config [candidate] (657.607 µs) : 0, 658
Telemetry [baseline] (12.661 ms) : 0, 12661
Telemetry [candidate] (9.291 ms) : 0, 9291
section appsec
crashtracking [baseline] (1.441 ms) : 0, 1441
crashtracking [candidate] (1.443 ms) : 0, 1443
BytebuddyAgent [baseline] (757.985 ms) : 0, 757985
BytebuddyAgent [candidate] (756.945 ms) : 0, 756945
GlobalTracer [baseline] (235.939 ms) : 0, 235939
GlobalTracer [candidate] (235.917 ms) : 0, 235917
AppSec [baseline] (167.98 ms) : 0, 167980
AppSec [candidate] (170.269 ms) : 0, 170269
Debugger [baseline] (7.925 ms) : 0, 7925
Debugger [candidate] (6.481 ms) : 0, 6481
Remote Config [baseline] (628.254 µs) : 0, 628
Remote Config [candidate] (652.955 µs) : 0, 653
Telemetry [baseline] (9.959 ms) : 0, 9959
Telemetry [candidate] (9.017 ms) : 0, 9017
IAST [baseline] (23.692 ms) : 0, 23692
IAST [candidate] (23.754 ms) : 0, 23754
section iast
crashtracking [baseline] (1.438 ms) : 0, 1438
crashtracking [candidate] (1.424 ms) : 0, 1424
BytebuddyAgent [baseline] (857.28 ms) : 0, 857280
BytebuddyAgent [candidate] (847.824 ms) : 0, 847824
GlobalTracer [baseline] (233.509 ms) : 0, 233509
GlobalTracer [candidate] (231.571 ms) : 0, 231571
AppSec [baseline] (26.986 ms) : 0, 26986
AppSec [candidate] (26.074 ms) : 0, 26074
Debugger [baseline] (8.24 ms) : 0, 8240
Debugger [candidate] (6.656 ms) : 0, 6656
Remote Config [baseline] (579.919 µs) : 0, 580
Remote Config [candidate] (587.528 µs) : 0, 588
Telemetry [baseline] (8.227 ms) : 0, 8227
Telemetry [candidate] (8.101 ms) : 0, 8101
IAST [baseline] (28.424 ms) : 0, 28424
IAST [candidate] (30.724 ms) : 0, 30724
section profiling
ProfilingAgent [baseline] (108.495 ms) : 0, 108495
ProfilingAgent [candidate] (108.131 ms) : 0, 108131
crashtracking [baseline] (1.403 ms) : 0, 1403
crashtracking [candidate] (1.404 ms) : 0, 1404
BytebuddyAgent [baseline] (760.32 ms) : 0, 760320
BytebuddyAgent [candidate] (764.413 ms) : 0, 764413
GlobalTracer [baseline] (221.602 ms) : 0, 221602
GlobalTracer [candidate] (222.275 ms) : 0, 222275
AppSec [baseline] (30.039 ms) : 0, 30039
AppSec [candidate] (30.059 ms) : 0, 30059
Debugger [baseline] (6.276 ms) : 0, 6276
Debugger [candidate] (6.344 ms) : 0, 6344
Remote Config [baseline] (675.147 µs) : 0, 675
Remote Config [candidate] (698.407 µs) : 0, 698
Telemetry [baseline] (15.275 ms) : 0, 15275
Telemetry [candidate] (16.009 ms) : 0, 16009
Profiling [baseline] (109.135 ms) : 0, 109135
Profiling [candidate] (108.768 ms) : 0, 108768
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master andrea.marziali/css-improve
git_commit_date 1754897199 1754899480
git_commit_sha 0eeb9e5 5c744a7
release_version 1.53.0-SNAPSHOT~0eeb9e597f 1.53.0-SNAPSHOT~5c744a7106
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1754901111 1754901111
ci_job_id 1073210945 1073210945
ci_pipeline_id 73241479 73241479
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-5oaex0z8 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-5oaex0z8 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 1 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 12 unstable metrics.

scenario Δ mean http_req_duration Δ mean throughput candidate mean http_req_duration candidate mean throughput baseline mean http_req_duration baseline mean throughput
scenario:load:petclinic:tracing:high_load better
[-1.723ms; -0.910ms] or [-3.877%; -2.048%]
unstable
[-4.215op/s; +10.590op/s] or [-4.003%; +10.058%]
43.119ms 108.475op/s 44.435ms 105.287op/s
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.53.0-SNAPSHOT~5c744a7106, baseline=1.53.0-SNAPSHOT~0eeb9e597f
    dateFormat X
    axisFormat %s
section baseline
no_agent (4.404 ms) : 4350, 4458
.   : milestone, 4404,
iast (9.333 ms) : 9177, 9488
.   : milestone, 9333,
iast_FULL (13.866 ms) : 13592, 14139
.   : milestone, 13866,
iast_GLOBAL (10.19 ms) : 10012, 10368
.   : milestone, 10190,
profiling (8.737 ms) : 8593, 8880
.   : milestone, 8737,
tracing (7.445 ms) : 7341, 7549
.   : milestone, 7445,
section candidate
no_agent (4.268 ms) : 4220, 4317
.   : milestone, 4268,
iast (9.255 ms) : 9103, 9407
.   : milestone, 9255,
iast_FULL (14.073 ms) : 13789, 14357
.   : milestone, 14073,
iast_GLOBAL (10.027 ms) : 9852, 10201
.   : milestone, 10027,
profiling (8.617 ms) : 8473, 8762
.   : milestone, 8617,
tracing (7.302 ms) : 7201, 7402
.   : milestone, 7302,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.404 ms [4.35 ms, 4.458 ms] -
iast 9.333 ms [9.177 ms, 9.488 ms] 4.929 ms (111.9%)
iast_FULL 13.866 ms [13.592 ms, 14.139 ms] 9.462 ms (214.9%)
iast_GLOBAL 10.19 ms [10.012 ms, 10.368 ms] 5.786 ms (131.4%)
profiling 8.737 ms [8.593 ms, 8.88 ms] 4.333 ms (98.4%)
tracing 7.445 ms [7.341 ms, 7.549 ms] 3.041 ms (69.1%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.268 ms [4.22 ms, 4.317 ms] -
iast 9.255 ms [9.103 ms, 9.407 ms] 4.987 ms (116.8%)
iast_FULL 14.073 ms [13.789 ms, 14.357 ms] 9.805 ms (229.7%)
iast_GLOBAL 10.027 ms [9.852 ms, 10.201 ms] 5.759 ms (134.9%)
profiling 8.617 ms [8.473 ms, 8.762 ms] 4.349 ms (101.9%)
tracing 7.302 ms [7.201 ms, 7.402 ms] 3.034 ms (71.1%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.53.0-SNAPSHOT~5c744a7106, baseline=1.53.0-SNAPSHOT~0eeb9e597f
    dateFormat X
    axisFormat %s
section baseline
no_agent (36.783 ms) : 36484, 37082
.   : milestone, 36783,
appsec (48.455 ms) : 48033, 48877
.   : milestone, 48455,
code_origins (45.361 ms) : 44972, 45749
.   : milestone, 45361,
iast (45.114 ms) : 44717, 45511
.   : milestone, 45114,
profiling (50.042 ms) : 49519, 50566
.   : milestone, 50042,
tracing (44.435 ms) : 44052, 44819
.   : milestone, 44435,
section candidate
no_agent (36.823 ms) : 36528, 37118
.   : milestone, 36823,
appsec (49.199 ms) : 48755, 49643
.   : milestone, 49199,
code_origins (44.957 ms) : 44547, 45367
.   : milestone, 44957,
iast (44.524 ms) : 44148, 44900
.   : milestone, 44524,
profiling (49.945 ms) : 49509, 50380
.   : milestone, 49945,
tracing (43.119 ms) : 42747, 43491
.   : milestone, 43119,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 36.783 ms [36.484 ms, 37.082 ms] -
appsec 48.455 ms [48.033 ms, 48.877 ms] 11.672 ms (31.7%)
code_origins 45.361 ms [44.972 ms, 45.749 ms] 8.578 ms (23.3%)
iast 45.114 ms [44.717 ms, 45.511 ms] 8.331 ms (22.7%)
profiling 50.042 ms [49.519 ms, 50.566 ms] 13.26 ms (36.0%)
tracing 44.435 ms [44.052 ms, 44.819 ms] 7.652 ms (20.8%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 36.823 ms [36.528 ms, 37.118 ms] -
appsec 49.199 ms [48.755 ms, 49.643 ms] 12.376 ms (33.6%)
code_origins 44.957 ms [44.547 ms, 45.367 ms] 8.134 ms (22.1%)
iast 44.524 ms [44.148 ms, 44.9 ms] 7.701 ms (20.9%)
profiling 49.945 ms [49.509 ms, 50.38 ms] 13.121 ms (35.6%)
tracing 43.119 ms [42.747 ms, 43.491 ms] 6.296 ms (17.1%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master andrea.marziali/css-improve
git_commit_date 1754897199 1754899480
git_commit_sha 0eeb9e5 5c744a7
release_version 1.53.0-SNAPSHOT~0eeb9e597f 1.53.0-SNAPSHOT~5c744a7106
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1754901571 1754901571
ci_job_id 1073210946 1073210946
ci_pipeline_id 73241479 73241479
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-1-u2sj9u2o 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-1-u2sj9u2o 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics.

Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.53.0-SNAPSHOT~5c744a7106, baseline=1.53.0-SNAPSHOT~0eeb9e597f
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.48 ms) : 1468, 1491
.   : milestone, 1480,
appsec (3.671 ms) : 3454, 3888
.   : milestone, 3671,
iast (2.204 ms) : 2141, 2267
.   : milestone, 2204,
iast_GLOBAL (2.256 ms) : 2193, 2320
.   : milestone, 2256,
profiling (2.058 ms) : 2007, 2108
.   : milestone, 2058,
tracing (2.021 ms) : 1972, 2070
.   : milestone, 2021,
section candidate
no_agent (1.481 ms) : 1469, 1492
.   : milestone, 1481,
appsec (3.679 ms) : 3463, 3896
.   : milestone, 3679,
iast (2.21 ms) : 2148, 2273
.   : milestone, 2210,
iast_GLOBAL (2.25 ms) : 2187, 2313
.   : milestone, 2250,
profiling (2.064 ms) : 2012, 2116
.   : milestone, 2064,
tracing (2.027 ms) : 1979, 2076
.   : milestone, 2027,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.48 ms [1.468 ms, 1.491 ms] -
appsec 3.671 ms [3.454 ms, 3.888 ms] 2.191 ms (148.1%)
iast 2.204 ms [2.141 ms, 2.267 ms] 724.129 µs (48.9%)
iast_GLOBAL 2.256 ms [2.193 ms, 2.32 ms] 776.387 µs (52.5%)
profiling 2.058 ms [2.007 ms, 2.108 ms] 578.166 µs (39.1%)
tracing 2.021 ms [1.972 ms, 2.07 ms] 541.312 µs (36.6%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.481 ms [1.469 ms, 1.492 ms] -
appsec 3.679 ms [3.463 ms, 3.896 ms] 2.199 ms (148.5%)
iast 2.21 ms [2.148 ms, 2.273 ms] 729.35 µs (49.3%)
iast_GLOBAL 2.25 ms [2.187 ms, 2.313 ms] 769.379 µs (52.0%)
profiling 2.064 ms [2.012 ms, 2.116 ms] 583.254 µs (39.4%)
tracing 2.027 ms [1.979 ms, 2.076 ms] 546.465 µs (36.9%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.53.0-SNAPSHOT~5c744a7106, baseline=1.53.0-SNAPSHOT~0eeb9e597f
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.101 s) : 15101000, 15101000
.   : milestone, 15101000,
appsec (14.99 s) : 14990000, 14990000
.   : milestone, 14990000,
iast (18.518 s) : 18518000, 18518000
.   : milestone, 18518000,
iast_GLOBAL (18.045 s) : 18045000, 18045000
.   : milestone, 18045000,
profiling (15.817 s) : 15817000, 15817000
.   : milestone, 15817000,
tracing (14.881 s) : 14881000, 14881000
.   : milestone, 14881000,
section candidate
no_agent (15.399 s) : 15399000, 15399000
.   : milestone, 15399000,
appsec (14.967 s) : 14967000, 14967000
.   : milestone, 14967000,
iast (18.242 s) : 18242000, 18242000
.   : milestone, 18242000,
iast_GLOBAL (17.956 s) : 17956000, 17956000
.   : milestone, 17956000,
profiling (15.344 s) : 15344000, 15344000
.   : milestone, 15344000,
tracing (15.101 s) : 15101000, 15101000
.   : milestone, 15101000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.101 s [15.101 s, 15.101 s] -
appsec 14.99 s [14.99 s, 14.99 s] -111.0 ms (-0.7%)
iast 18.518 s [18.518 s, 18.518 s] 3.417 s (22.6%)
iast_GLOBAL 18.045 s [18.045 s, 18.045 s] 2.944 s (19.5%)
profiling 15.817 s [15.817 s, 15.817 s] 716.0 ms (4.7%)
tracing 14.881 s [14.881 s, 14.881 s] -220.0 ms (-1.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.399 s [15.399 s, 15.399 s] -
appsec 14.967 s [14.967 s, 14.967 s] -432.0 ms (-2.8%)
iast 18.242 s [18.242 s, 18.242 s] 2.843 s (18.5%)
iast_GLOBAL 17.956 s [17.956 s, 17.956 s] 2.557 s (16.6%)
profiling 15.344 s [15.344 s, 15.344 s] -55.0 ms (-0.4%)
tracing 15.101 s [15.101 s, 15.101 s] -298.0 ms (-1.9%)

@amarziali amarziali force-pushed the andrea.marziali/css-improve branch from 117434d to 09f0a12 Compare August 8, 2025 15:22
PEER_TAGS_CACHE_ADDER =
key ->
Pair.of(
DDCaches.newFixedSizeCache(512),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Avoid magic values.

String, Pair<DDCache<String, UTF8BytesString>, Function<String, UTF8BytesString>>>
PEER_TAGS_CACHE =
DDCaches.newUnboundedCache(
64); // it can be unbounded since those values are returned by the agent and should be
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Make this a const, so maybe google java format will make the code readable.

Comment on lines +313 to +314
final Pair<DDCache<String, UTF8BytesString>, Function<String, UTF8BytesString>> pair =
PEER_TAGS_CACHE.computeIfAbsent(peerTag, PEER_TAGS_CACHE_ADDER);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: I suggest intermediate renaming to make this more legible.

@amarziali amarziali force-pushed the andrea.marziali/css-improve branch from 09f0a12 to e5b8954 Compare August 8, 2025 15:50
@amarziali amarziali force-pushed the andrea.marziali/css-improve branch from e5b8954 to 5c744a7 Compare August 11, 2025 08:04
@PerfectSlayer PerfectSlayer added tag: performance Performance related changes type: enhancement Enhancements and improvements comp: core Tracer core labels Aug 11, 2025
@amarziali amarziali merged commit f1139d7 into bdu/add-missing-attributes-in-metrics-key Aug 11, 2025
485 of 500 checks passed
@amarziali amarziali deleted the andrea.marziali/css-improve branch August 11, 2025 09:14
amarziali added a commit that referenced this pull request Aug 12, 2025
* Add jmh for metrics aggregation

* Cache peer tags to avoid too many strings/utf8 conversions

* Use span kind cache

* Fix tests
amarziali added a commit that referenced this pull request Aug 20, 2025
* Add jmh for metrics aggregation

* Cache peer tags to avoid too many strings/utf8 conversions

* Use span kind cache

* Fix tests
amarziali added a commit that referenced this pull request Aug 21, 2025
* Add jmh for metrics aggregation

* Cache peer tags to avoid too many strings/utf8 conversions

* Use span kind cache

* Fix tests
amarziali added a commit that referenced this pull request Aug 22, 2025
* chore(css): Add peer tags, span kind and trace root flag to MetricKey bucket

* chore(css): Use a map to create the metric key

Also delays the creation of the Utf8ByteString at serialization time.
Note that `writer.writeUTF8` emits a header corresponding to the length
of the value being written, calling this method again will count as an
entry in the array.
A possible idea was to use a cache to store the computation of the
peerTags, however `Utf8ByteString` is not concatenable / appendable,
which is necessary to have the proper encoding. Creating a
new "temporary" `Utf8ByteString`, was replaced by a direct call to
`String: :getBytes`.

* Improves CSS peer tag aggregation (#9336)

* Add jmh for metrics aggregation

* Cache peer tags to avoid too many strings/utf8 conversions

* Use span kind cache

* Fix tests

* Hardcode eligible span kind since  agent backpropagated are deprecated

* revisit peer tags aggregation rules according to the rfc

* IsTraceRoot is a tristate

* Don't confuse trace root with top levels

* Fix build after rebase

---------

Co-authored-by: Andrea Marziali <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: core Tracer core tag: performance Performance related changes type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants