Skip to content
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

Wire up the DD_TRACE_BATCH_INTERVAL setting #4940

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

kevingosse
Copy link
Collaborator

Summary of changes

Use the value of DD_TRACE_BATCH_INTERVAL in the AgentWriter to change the batch interval in the serialization thread.
Also, allow to completely disable the delay.

Reason for change

The AWS Lambda waits on the traces to be flushed before finishing the invocation, so the delay is getting in the way.

Implementation details

Fun fact, the setting existed from the very beginning but apparently I forgot to pass the value to the AgentWriter :awkward-monkey:

Test coverage

One could argue that the setting would have been implemented properly if I added tests to begin with. But I can't really think of a good way to test this.

@kevingosse kevingosse requested a review from a team as a code owner November 30, 2023 11:56
@github-actions github-actions bot added the area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) label Nov 30, 2023
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Nov 30, 2023

Datadog Report

Branch report: kevin/agent_flush_delay
Commit report: addca0c

dd-trace-dotnet: 0 Failed, 0 New Flaky, 302773 Passed, 951 Skipped, 30m 54.12s Wall Time

@andrewlock
Copy link
Member

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

Execution-time benchmarks measure the whole time it takes to execute a program. And are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are shown in red. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard.

Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4940) - mean (71ms)  : 62, 80
     .   : milestone, 71,
    master - mean (71ms)  : 60, 83
     .   : milestone, 71,

    section CallTarget+Inlining+NGEN
    This PR (4940) - mean (998ms)  : 966, 1031
     .   : milestone, 998,
    master - mean (998ms)  : 972, 1023
     .   : milestone, 998,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4940) - mean (106ms)  : 103, 109
     .   : milestone, 106,
    master - mean (107ms)  : 102, 112
     .   : milestone, 107,

    section CallTarget+Inlining+NGEN
    This PR (4940) - mean (689ms)  : 674, 703
     .   : milestone, 689,
    master - mean (691ms)  : 668, 714
     .   : milestone, 691,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4940) - mean (91ms)  : 88, 93
     .   : milestone, 91,
    master - mean (90ms)  : 87, 92
     .   : milestone, 90,

    section CallTarget+Inlining+NGEN
    This PR (4940) - mean (667ms)  : 645, 689
     .   : milestone, 667,
    master - mean (660ms)  : 638, 682
     .   : milestone, 660,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4940) - mean (189ms)  : 185, 192
     .   : milestone, 189,
    master - mean (189ms)  : 186, 192
     .   : milestone, 189,

    section CallTarget+Inlining+NGEN
    This PR (4940) - mean (1,131ms)  : 1106, 1157
     .   : milestone, 1131,
    master - mean (1,137ms)  : 1112, 1161
     .   : milestone, 1137,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4940) - mean (273ms)  : 269, 277
     .   : milestone, 273,
    master - mean (272ms)  : 269, 276
     .   : milestone, 272,

    section CallTarget+Inlining+NGEN
    This PR (4940) - mean (1,088ms)  : 1067, 1110
     .   : milestone, 1088,
    master - mean (1,088ms)  : 1062, 1115
     .   : milestone, 1088,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4940) - mean (261ms)  : 258, 265
     .   : milestone, 261,
    master - mean (262ms)  : 259, 264
     .   : milestone, 262,

    section CallTarget+Inlining+NGEN
    This PR (4940) - mean (1,058ms)  : 1033, 1084
     .   : milestone, 1058,
    master - mean (1,062ms)  : 1033, 1091
     .   : milestone, 1062,

Loading

@andrewlock
Copy link
Member

Throughput/Crank Report:zap:

Throughput results for AspNetCoreSimpleController comparing the following branches/commits:

Cases where throughput results for the PR are worse than latest master (5% drop or greater), results are shown in red.

Note that these results are based on a single point-in-time result for each branch. For full results, see one of the many, many dashboards!

gantt
    title Throughput Linux x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4940) (11.303M)   : 0, 11303327
    master (11.333M)   : 0, 11332518
    benchmarks/2.9.0 (11.258M)   : 0, 11257868

    section Automatic
    This PR (4940) (7.782M)   : 0, 7781864
    master (7.657M)   : 0, 7657438
    benchmarks/2.9.0 (8.046M)   : 0, 8046105

    section Trace stats
    This PR (4940) (8.085M)   : 0, 8085406
    master (8.054M)   : 0, 8053668

    section Manual
    This PR (4940) (9.858M)   : 0, 9858481
    master (10.004M)   : 0, 10003794

    section Manual + Automatic
    This PR (4940) (7.255M)   : 0, 7255122
    master (7.437M)   : 0, 7436536

    section Version Conflict
    This PR (4940) (6.490M)   : 0, 6489909
    master (6.771M)   : 0, 6770626

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4940) (9.601M)   : 0, 9600956
    master (9.642M)   : 0, 9641863
    benchmarks/2.9.0 (9.571M)   : 0, 9571091

    section Automatic
    This PR (4940) (6.620M)   : 0, 6619773
    master (6.503M)   : 0, 6503245

    section Trace stats
    This PR (4940) (6.919M)   : 0, 6919412
    master (6.987M)   : 0, 6987377

    section Manual
    This PR (4940) (7.934M)   : crit ,0, 7934046
    master (8.537M)   : 0, 8536637

    section Manual + Automatic
    This PR (4940) (6.109M)   : 0, 6108521
    master (6.089M)   : 0, 6089321

    section Version Conflict
    This PR (4940) (5.538M)   : 0, 5538299
    master (5.724M)   : 0, 5723643

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4940) (10.929M)   : 0, 10928700
    master (10.254M)   : 0, 10253707
    benchmarks/2.9.0 (8.981M)   : 0, 8981100

    section Automatic
    This PR (4940) (7.718M)   : 0, 7717536
    master (6.421M)   : 0, 6420836
    benchmarks/2.9.0 (6.621M)   : 0, 6621015

    section Trace stats
    This PR (4940) (8.048M)   : 0, 8048034
    master (6.589M)   : 0, 6589319

    section Manual
    This PR (4940) (9.541M)   : 0, 9541064
    master (7.901M)   : 0, 7900787

    section Manual + Automatic
    This PR (4940) (7.345M)   : 0, 7345071
    master (6.157M)   : 0, 6157174

    section Version Conflict
    This PR (4940) (6.623M)   : 0, 6623004
    master (5.598M)   : 0, 5598196

Loading
gantt
    title Throughput Linux x64 (ASM) (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    master (7.353M)   : 0, 7352773
    benchmarks/2.9.0 (7.805M)   : 0, 7805126

    section No attack
    master (1.971M)   : 0, 1971063
    benchmarks/2.9.0 (3.177M)   : 0, 3177224

    section Attack
    master (1.553M)   : 0, 1553355
    benchmarks/2.9.0 (2.505M)   : 0, 2504790

    section Blocking
    master (3.237M)   : 0, 3236693

    section IAST default
    master (6.655M)   : 0, 6654796

    section IAST full
    master (5.949M)   : 0, 5949094

    section Base vuln
    master (0.974M)   : 0, 974472

    section IAST vuln
    master (0.921M)   : 0, 920725

Loading

@andrewlock
Copy link
Member

Benchmarks Report 🐌

Benchmarks for #4940 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.258
  • 3 benchmarks are slower, with geometric mean 1.365
  • 2 benchmarks have fewer allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 8.87μs 49.2ns 311ns 0.019 0.00951 0 7.48 KB
master StartStopWithChild netcoreapp3.1 11.2μs 62.4ns 419ns 0.0278 0.0111 0 7.57 KB
master StartStopWithChild net472 17.7μs 61.2ns 237ns 1.34 0.357 0.113 7.96 KB
#4940 StartStopWithChild net6.0 8.81μs 43.2ns 245ns 0.0296 0.0127 0 7.48 KB
#4940 StartStopWithChild netcoreapp3.1 10.7μs 57.4ns 314ns 0.0276 0.011 0 7.58 KB
#4940 StartStopWithChild net472 16.9μs 67.1ns 260ns 1.33 0.354 0.115 7.96 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 454μs 154ns 577ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 663μs 1.85μs 7.15μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 776μs 343ns 1.24μs 0.386 0 0 3.3 KB
#4940 WriteAndFlushEnrichedTraces net6.0 457μs 272ns 1.05μs 0 0 0 2.7 KB
#4940 WriteAndFlushEnrichedTraces netcoreapp3.1 625μs 314ns 1.22μs 0 0 0 2.7 KB
#4940 WriteAndFlushEnrichedTraces net472 785μs 216ns 838ns 0.391 0 0 3.3 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 44.2μs 25.7ns 96.1ns 0.0223 0 0 1.77 KB
master AllCycleSimpleBody netcoreapp3.1 47.3μs 204ns 791ns 0.0235 0 0 1.74 KB
master AllCycleSimpleBody net472 49.4μs 22.6ns 87.5ns 0.273 0 0 1.81 KB
master AllCycleMoreComplexBody net6.0 213μs 198ns 767ns 0.106 0 0 9.25 KB
master AllCycleMoreComplexBody netcoreapp3.1 228μs 161ns 602ns 0.113 0 0 9.14 KB
master AllCycleMoreComplexBody net472 237μs 69.6ns 251ns 1.42 0 0 9.32 KB
master ObjectExtractorSimpleBody net6.0 129ns 0.0422ns 0.146ns 0.00396 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 188ns 0.201ns 1ns 0.00369 0 0 272 B
master ObjectExtractorSimpleBody net472 152ns 0.115ns 0.432ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.81μs 1.39ns 5.21ns 0.0537 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.66μs 1.54ns 5.96ns 0.0493 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.42μs 2.57ns 9.95ns 0.602 0.00513 0 3.8 KB
#4940 AllCycleSimpleBody net6.0 44μs 47.7ns 185ns 0.0218 0 0 1.77 KB
#4940 AllCycleSimpleBody netcoreapp3.1 46.8μs 42ns 163ns 0.0232 0 0 1.74 KB
#4940 AllCycleSimpleBody net472 49.3μs 74.5ns 288ns 0.268 0 0 1.81 KB
#4940 AllCycleMoreComplexBody net6.0 214μs 37.1ns 129ns 0.106 0 0 9.25 KB
#4940 AllCycleMoreComplexBody netcoreapp3.1 225μs 102ns 382ns 0.112 0 0 9.14 KB
#4940 AllCycleMoreComplexBody net472 238μs 72.6ns 281ns 1.42 0 0 9.32 KB
#4940 ObjectExtractorSimpleBody net6.0 135ns 0.0643ns 0.249ns 0.00393 0 0 280 B
#4940 ObjectExtractorSimpleBody netcoreapp3.1 205ns 0.118ns 0.443ns 0.00372 0 0 272 B
#4940 ObjectExtractorSimpleBody net472 152ns 0.0616ns 0.239ns 0.0446 0 0 281 B
#4940 ObjectExtractorMoreComplexBody net6.0 2.76μs 1.5ns 5.62ns 0.0524 0 0 3.78 KB
#4940 ObjectExtractorMoreComplexBody netcoreapp3.1 3.57μs 0.854ns 3.2ns 0.0501 0 0 3.69 KB
#4940 ObjectExtractorMoreComplexBody net472 3.63μs 1.15ns 4.29ns 0.603 0.00526 0 3.8 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWaf(args=NestedMap (10)) net6.0 54.3μs 20.6ns 77.1ns 0.22 0 0 16.06 KB
master RunWaf(args=NestedMap (10)) netcoreapp3.1 68.1μs 355ns 1.85μs 0.2 0 0 16.06 KB
master RunWaf(args=NestedMap (10)) net472 97.5μs 419ns 1.62μs 2.52 0.0935 0 16.14 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 114μs 36.9ns 138ns 0.302 0 0 22.41 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 139μs 614ns 3.79μs 0.27 0 0 22.36 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net472 172μs 96.4ns 361ns 3.58 0.166 0 22.7 KB
master RunWaf(args=NestedMap (100)) net6.0 93.1μs 25.4ns 98.4ns 0.425 0 0 32.76 KB
master RunWaf(args=NestedMap (100)) netcoreapp3.1 125μs 372ns 1.34μs 0.457 0 0 33.33 KB
master RunWaf(args=NestedMap (100)) net472 184μs 128ns 497ns 5.29 0.365 0 33.67 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) net6.0 165μs 83.6ns 324ns 0.497 0 0 39.1 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) netcoreapp3.1 210μs 82.8ns 299ns 0.526 0 0 39.63 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) net472 261μs 128ns 480ns 6.39 0.522 0 40.23 KB
master RunWaf(args=NestedMap (20)) net6.0 97.1μs 158ns 610ns 0.455 0 0 32.18 KB
master RunWaf(args=NestedMap (20)) netcoreapp3.1 135μs 209ns 810ns 0.4 0 0 32.3 KB
master RunWaf(args=NestedMap (20)) net472 188μs 202ns 784ns 5.19 0.37 0 32.63 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 165μs 674ns 2.61μs 0.488 0 0 38.53 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 215μs 206ns 797ns 0.523 0 0 38.6 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net472 265μs 849ns 3.29μs 6.16 0.513 0 39.2 KB
#4940 RunWaf(args=NestedMap (10)) net6.0 54μs 18.5ns 66.6ns 0.216 0 0 16.06 KB
#4940 RunWaf(args=NestedMap (10)) netcoreapp3.1 67.8μs 398ns 3.78μs 0.213 0 0 16.06 KB
#4940 RunWaf(args=NestedMap (10)) net472 93.6μs 47.6ns 178ns 2.52 0.0934 0 16.14 KB
#4940 RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 114μs 38.9ns 151ns 0.287 0 0 22.41 KB
#4940 RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 138μs 466ns 1.74μs 0.264 0 0 22.36 KB
#4940 RunWafWithAttack(args=Neste(...)tack) [22]) net472 171μs 640ns 2.48μs 3.6 0.164 0 22.7 KB
#4940 RunWaf(args=NestedMap (100)) net6.0 95.2μs 69.1ns 259ns 0.454 0 0 32.76 KB
#4940 RunWaf(args=NestedMap (100)) netcoreapp3.1 133μs 628ns 2.51μs 0.41 0 0 33.33 KB
#4940 RunWaf(args=NestedMap (100)) net472 188μs 438ns 1.7μs 5.32 0.367 0 33.67 KB
#4940 RunWafWithAttack(args=Neste(...)tack) [23]) net6.0 177μs 73.5ns 275ns 0.528 0 0 39.1 KB
#4940 RunWafWithAttack(args=Neste(...)tack) [23]) netcoreapp3.1 203μs 862ns 3.34μs 0.498 0 0 39.63 KB
#4940 RunWafWithAttack(args=Neste(...)tack) [23]) net472 265μs 773ns 2.99μs 6.36 0.397 0 40.23 KB
#4940 RunWaf(args=NestedMap (20)) net6.0 103μs 52.6ns 197ns 0.454 0 0 32.18 KB
#4940 RunWaf(args=NestedMap (20)) netcoreapp3.1 132μs 703ns 3.22μs 0.436 0 0 32.3 KB
#4940 RunWaf(args=NestedMap (20)) net472 189μs 56.4ns 211ns 5.16 0.369 0 32.63 KB
#4940 RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 166μs 221ns 854ns 0.52 0 0 38.53 KB
#4940 RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 203μs 829ns 4.31μs 0.499 0 0 38.6 KB
#4940 RunWafWithAttack(args=Neste(...)tack) [22]) net472 265μs 119ns 460ns 6.15 0.523 0 39.2 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 175μs 205ns 793ns 0.175 0 0 18.25 KB
master SendRequest netcoreapp3.1 191μs 423ns 1.64μs 0.19 0 0 20.41 KB
master SendRequest net472 0.00148ns 0.000362ns 0.0014ns 0 0 0 0 b
#4940 SendRequest net6.0 173μs 160ns 619ns 0.258 0 0 18.25 KB
#4940 SendRequest netcoreapp3.1 193μs 315ns 1.22μs 0.195 0 0 20.41 KB
#4940 SendRequest net472 0.000261ns 0.000126ns 0.000473ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 544μs 617ns 2.31μs 0.556 0 0 41.51 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 661μs 586ns 2.27μs 0.327 0 0 41.92 KB
master WriteAndFlushEnrichedTraces net472 854μs 4.13μs 16.5μs 8.13 2.57 0.428 53.22 KB
#4940 WriteAndFlushEnrichedTraces net6.0 559μs 665ns 2.57μs 0.534 0 0 41.68 KB
#4940 WriteAndFlushEnrichedTraces netcoreapp3.1 656μs 991ns 3.84μs 0.329 0 0 41.83 KB
#4940 WriteAndFlushEnrichedTraces net472 851μs 3.06μs 11.9μs 8.33 2.5 0.417 53.24 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.01μs 0.427ns 1.65ns 0.0106 0 0 768 B
master ExecuteNonQuery netcoreapp3.1 1.47μs 0.595ns 2.3ns 0.0102 0 0 768 B
master ExecuteNonQuery net472 1.79μs 3.66ns 14.2ns 0.116 0 0 730 B
#4940 ExecuteNonQuery net6.0 1.06μs 0.713ns 2.76ns 0.0106 0 0 768 B
#4940 ExecuteNonQuery netcoreapp3.1 1.44μs 0.414ns 1.6ns 0.01 0 0 768 B
#4940 ExecuteNonQuery net472 1.71μs 2.92ns 11.3ns 0.116 0 0 730 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.22μs 0.865ns 3.24ns 0.0135 0 0 936 B
master CallElasticsearch netcoreapp3.1 1.54μs 0.942ns 3.52ns 0.0131 0 0 936 B
master CallElasticsearch net472 2.51μs 0.596ns 2.23ns 0.151 0 0 955 B
master CallElasticsearchAsync net6.0 1.24μs 0.521ns 2.02ns 0.013 0 0 912 B
master CallElasticsearchAsync netcoreapp3.1 1.64μs 0.349ns 1.31ns 0.013 0 0 984 B
master CallElasticsearchAsync net472 2.67μs 1.58ns 6.11ns 0.16 0 0 1.01 KB
#4940 CallElasticsearch net6.0 1.12μs 0.427ns 1.6ns 0.0133 0 0 936 B
#4940 CallElasticsearch netcoreapp3.1 1.53μs 0.719ns 2.79ns 0.0126 0 0 936 B
#4940 CallElasticsearch net472 2.42μs 1.14ns 4.42ns 0.151 0 0 955 B
#4940 CallElasticsearchAsync net6.0 1.24μs 0.738ns 2.76ns 0.0123 0 0 912 B
#4940 CallElasticsearchAsync netcoreapp3.1 1.6μs 1.2ns 4.51ns 0.0137 0 0 984 B
#4940 CallElasticsearchAsync net472 2.67μs 0.376ns 1.46ns 0.16 0 0 1.01 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.29μs 1.51ns 5.85ns 0.0124 0 0 912 B
master ExecuteAsync netcoreapp3.1 1.57μs 0.761ns 2.85ns 0.012 0 0 912 B
master ExecuteAsync net472 1.81μs 1.15ns 4.45ns 0.139 0 0 875 B
#4940 ExecuteAsync net6.0 1.25μs 0.929ns 3.6ns 0.0125 0 0 912 B
#4940 ExecuteAsync netcoreapp3.1 1.64μs 1.38ns 5.36ns 0.0122 0 0 912 B
#4940 ExecuteAsync net472 1.83μs 0.968ns 3.75ns 0.138 0 0 875 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 4.12μs 6.68ns 25ns 0.0287 0 0 2.1 KB
master SendAsync netcoreapp3.1 4.83μs 2.11ns 8.17ns 0.0363 0 0 2.63 KB
master SendAsync net472 7.82μs 2.5ns 9.35ns 0.522 0 0 3.31 KB
#4940 SendAsync net6.0 4.01μs 1.19ns 4.61ns 0.0281 0 0 2.1 KB
#4940 SendAsync netcoreapp3.1 4.97μs 1.42ns 5.52ns 0.0347 0 0 2.63 KB
#4940 SendAsync net472 7.79μs 1.46ns 5.47ns 0.523 0 0 3.31 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ Fewer allocations 🎉

Slower ⚠️ in #4940

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑net6.0 1.682 65,200.00 109,650.00 multimodal

Faster 🎉 in #4940

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑net6.0 1.177 60,750.00 51,600.00 multimodal

Fewer allocations 🎉 in #4940

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑net472 59.66 KB 58.52 KB -1.14 KB -1.92%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑net472 65.54 KB 57.34 KB -8.19 KB -12.50%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark(parameters=Syste(...)ring] [48]) net6.0 60.4μs 777ns 7.77μs 0 0 0 43.44 KB
master StringConcatBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 57.5μs 738ns 7.12μs 0 0 0 42.64 KB
master StringConcatBenchmark(parameters=Syste(...)ring] [48]) net472 37.8μs 96.9ns 363ns 0 0 0 59.66 KB
master StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net6.0 65.2μs 319ns 1.31μs 0 0 0 43.29 KB
master StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 97.9μs 3.06μs 30.6μs 0 0 0 42.64 KB
master StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net472 57.3μs 902ns 8.84μs 0 0 0 65.54 KB
#4940 StringConcatBenchmark(parameters=Syste(...)ring] [48]) net6.0 51.5μs 194ns 726ns 0 0 0 43.44 KB
#4940 StringConcatBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 53.1μs 244ns 914ns 0 0 0 42.64 KB
#4940 StringConcatBenchmark(parameters=Syste(...)ring] [48]) net472 37.9μs 122ns 455ns 0 0 0 58.52 KB
#4940 StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net6.0 105μs 2.98μs 29.8μs 0 0 0 43.29 KB
#4940 StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 89.7μs 3.19μs 31.7μs 0 0 0 42.64 KB
#4940 StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net472 63.6μs 324ns 1.45μs 0 0 0 57.34 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.52μs 0.591ns 2.29ns 0.0221 0 0 1.57 KB
master EnrichedLog netcoreapp3.1 2.17μs 0.943ns 3.53ns 0.0208 0 0 1.57 KB
master EnrichedLog net472 2.66μs 1.07ns 3.85ns 0.238 0 0 1.5 KB
#4940 EnrichedLog net6.0 1.48μs 0.722ns 2.7ns 0.022 0 0 1.57 KB
#4940 EnrichedLog netcoreapp3.1 2.21μs 1.45ns 5.43ns 0.0209 0 0 1.57 KB
#4940 EnrichedLog net472 2.56μs 2.45ns 9.5ns 0.238 0 0 1.5 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 113μs 140ns 542ns 0.0563 0 0 4.21 KB
master EnrichedLog netcoreapp3.1 119μs 296ns 1.15μs 0.0587 0 0 4.21 KB
master EnrichedLog net472 149μs 277ns 1.07μs 0.667 0.222 0 4.39 KB
#4940 EnrichedLog net6.0 112μs 128ns 494ns 0.0561 0 0 4.21 KB
#4940 EnrichedLog netcoreapp3.1 117μs 259ns 1μs 0 0 0 4.21 KB
#4940 EnrichedLog net472 148μs 147ns 568ns 0.664 0.221 0 4.39 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 3.03μs 1.11ns 4.28ns 0.0288 0 0 2.13 KB
master EnrichedLog netcoreapp3.1 4.13μs 1.76ns 6.81ns 0.0288 0 0 2.13 KB
master EnrichedLog net472 4.89μs 3.71ns 14.4ns 0.308 0 0 1.95 KB
#4940 EnrichedLog net6.0 2.97μs 1.24ns 4.63ns 0.0295 0 0 2.13 KB
#4940 EnrichedLog netcoreapp3.1 4.15μs 1.87ns 7.26ns 0.0287 0 0 2.13 KB
#4940 EnrichedLog net472 4.91μs 10.6ns 41.2ns 0.308 0 0 1.95 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.33μs 0.84ns 3.14ns 0.0158 0 0 1.1 KB
master SendReceive netcoreapp3.1 1.78μs 0.908ns 3.52ns 0.0152 0 0 1.1 KB
master SendReceive net472 2.01μs 1.22ns 4.72ns 0.177 0 0 1.12 KB
#4940 SendReceive net6.0 1.32μs 1.17ns 4.52ns 0.0151 0 0 1.1 KB
#4940 SendReceive netcoreapp3.1 1.75μs 1.03ns 3.99ns 0.0148 0 0 1.1 KB
#4940 SendReceive net472 2.18μs 2.27ns 8.77ns 0.177 0 0 1.12 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.73μs 3.2ns 12.4ns 0.0204 0 0 1.53 KB
master EnrichedLog netcoreapp3.1 3.87μs 1.41ns 4.89ns 0.0214 0 0 1.58 KB
master EnrichedLog net472 4.33μs 1.26ns 4.87ns 0.312 0 0 1.97 KB
#4940 EnrichedLog net6.0 2.7μs 0.725ns 2.81ns 0.0215 0 0 1.53 KB
#4940 EnrichedLog netcoreapp3.1 4.06μs 2.28ns 8.83ns 0.0204 0 0 1.58 KB
#4940 EnrichedLog net472 4.28μs 0.848ns 3.28ns 0.31 0 0 1.97 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #4940

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.339 461.31 617.61
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 1.130 728.43 823.26

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 461ns 0.401ns 1.55ns 0.00759 0 0 536 B
master StartFinishSpan netcoreapp3.1 694ns 0.455ns 1.64ns 0.00704 0 0 536 B
master StartFinishSpan net472 728ns 0.915ns 3.42ns 0.0854 0 0 538 B
master StartFinishScope net6.0 572ns 0.705ns 2.73ns 0.00908 0 0 656 B
master StartFinishScope netcoreapp3.1 857ns 0.47ns 1.82ns 0.00864 0 0 656 B
master StartFinishScope net472 1.05μs 1.32ns 5.09ns 0.0977 0 0 618 B
#4940 StartFinishSpan net6.0 618ns 0.389ns 1.51ns 0.00744 0 0 536 B
#4940 StartFinishSpan netcoreapp3.1 725ns 0.174ns 0.651ns 0.00723 0 0 536 B
#4940 StartFinishSpan net472 825ns 1.13ns 4.39ns 0.0853 0 0 538 B
#4940 StartFinishScope net6.0 528ns 0.136ns 0.527ns 0.00923 0 0 656 B
#4940 StartFinishScope netcoreapp3.1 888ns 0.396ns 1.48ns 0.00873 0 0 656 B
#4940 StartFinishScope net472 985ns 0.704ns 2.72ns 0.0978 0 0 618 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #4940

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.345 834.89 620.96

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 836ns 1.11ns 4.3ns 0.00929 0 0 656 B
master RunOnMethodBegin netcoreapp3.1 988ns 0.798ns 3.09ns 0.00908 0 0 656 B
master RunOnMethodBegin net472 1.16μs 1.24ns 4.81ns 0.098 0 0 618 B
#4940 RunOnMethodBegin net6.0 621ns 0.182ns 0.705ns 0.00908 0 0 656 B
#4940 RunOnMethodBegin netcoreapp3.1 929ns 0.387ns 1.45ns 0.0085 0 0 656 B
#4940 RunOnMethodBegin net472 1.06μs 0.223ns 0.862ns 0.0978 0 0 618 B

@kevingosse kevingosse merged commit b38c6b7 into master Nov 30, 2023
54 checks passed
@kevingosse kevingosse deleted the kevin/agent_flush_delay branch November 30, 2023 15:56
@github-actions github-actions bot added this to the vNext milestone Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants