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

[ASM] Refactor AspNetCore5DatabaseTests #6482

Merged
merged 10 commits into from
Jan 7, 2025

Conversation

NachoEchevarria
Copy link
Contributor

@NachoEchevarria NachoEchevarria commented Dec 23, 2024

Summary of changes

This PR removes the Samples.Security.AspNetCore5.DatabaseIntegration project and moves the test code to Samples.Security.AspNetCore5

It also adds a new DockerDependencyType value that can be used for projects that contain both tests that required docker and others that don't require them.

Reason for change

Implementation details

Test coverage

Other details

@github-actions github-actions bot added the area:tests unit tests, integration tests label Dec 23, 2024
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Dec 23, 2024

Datadog Report

Branch report: nacho/MergeDatabaseIntegrationMainSample
Commit report: 1ec5cd9
Test service: dd-trace-dotnet

✅ 0 Failed, 238621 Passed, 2129 Skipped, 18h 59m 21.8s Total Time

@andrewlock
Copy link
Member

andrewlock commented Dec 23, 2024

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 (6482) - mean (69ms)  : 65, 72
     .   : milestone, 69,
    master - mean (68ms)  : 66, 70
     .   : milestone, 68,

    section CallTarget+Inlining+NGEN
    This PR (6482) - mean (977ms)  : 959, 994
     .   : milestone, 977,
    master - mean (978ms)  : 940, 1016
     .   : milestone, 978,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6482) - mean (107ms)  : 104, 110
     .   : milestone, 107,
    master - mean (107ms)  : 105, 110
     .   : milestone, 107,

    section CallTarget+Inlining+NGEN
    This PR (6482) - mean (678ms)  : 662, 694
     .   : milestone, 678,
    master - mean (678ms)  : 664, 693
     .   : milestone, 678,

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

    section CallTarget+Inlining+NGEN
    This PR (6482) - mean (637ms)  : 622, 652
     .   : milestone, 637,
    master - mean (631ms)  : 616, 646
     .   : milestone, 631,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6482) - mean (194ms)  : 189, 198
     .   : milestone, 194,
    master - mean (194ms)  : 189, 199
     .   : milestone, 194,

    section CallTarget+Inlining+NGEN
    This PR (6482) - mean (1,100ms)  : 1068, 1133
     .   : milestone, 1100,
    master - mean (1,101ms)  : 1066, 1136
     .   : milestone, 1101,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6482) - mean (278ms)  : 273, 284
     .   : milestone, 278,
    master - mean (278ms)  : 274, 282
     .   : milestone, 278,

    section CallTarget+Inlining+NGEN
    This PR (6482) - mean (873ms)  : 842, 905
     .   : milestone, 873,
    master - mean (875ms)  : 845, 905
     .   : milestone, 875,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6482) - mean (267ms)  : 264, 271
     .   : milestone, 267,
    master - mean (267ms)  : 264, 271
     .   : milestone, 267,

    section CallTarget+Inlining+NGEN
    This PR (6482) - mean (850ms)  : 818, 882
     .   : milestone, 850,
    master - mean (853ms)  : 820, 887
     .   : milestone, 853,

Loading

@andrewlock
Copy link
Member

andrewlock commented Dec 23, 2024

Benchmarks Report for appsec 🐌

Benchmarks for #6482 compared to master:

  • All benchmarks have the same speed
  • 1 benchmarks have fewer allocations
  • 2 benchmarks have more 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.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 202μs 99.9ns 387ns 2.67 0 0 188.76 KB
master AllCycleSimpleBody netcoreapp3.1 298μs 121ns 454ns 2.68 0 0 196.09 KB
master AllCycleSimpleBody net472 267μs 90.8ns 315ns 35.8 1.99 0 225.79 KB
master AllCycleMoreComplexBody net6.0 209μs 88.1ns 318ns 2.7 0 0 192.26 KB
master AllCycleMoreComplexBody netcoreapp3.1 312μs 122ns 473ns 2.65 0 0 199.51 KB
master AllCycleMoreComplexBody net472 273μs 160ns 598ns 36.4 2.04 0 229.3 KB
master ObjectExtractorSimpleBody net6.0 144ns 0.145ns 0.56ns 0.00393 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 189ns 0.079ns 0.285ns 0.00379 0 0 272 B
master ObjectExtractorSimpleBody net472 163ns 0.1ns 0.389ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.91μs 1.27ns 4.93ns 0.0528 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.78μs 1.94ns 7.27ns 0.0496 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.65μs 2.64ns 9.87ns 0.603 0.0055 0 3.8 KB
#6482 AllCycleSimpleBody net6.0 205μs 98.8ns 370ns 2.67 0 0 188.76 KB
#6482 AllCycleSimpleBody netcoreapp3.1 296μs 91.3ns 342ns 2.65 0 0 196.09 KB
#6482 AllCycleSimpleBody net472 272μs 138ns 518ns 35.9 2.04 0 225.79 KB
#6482 AllCycleMoreComplexBody net6.0 209μs 74ns 256ns 2.7 0 0 192.26 KB
#6482 AllCycleMoreComplexBody netcoreapp3.1 312μs 137ns 512ns 2.64 0 0 199.5 KB
#6482 AllCycleMoreComplexBody net472 275μs 141ns 528ns 36.4 2.08 0 229.3 KB
#6482 ObjectExtractorSimpleBody net6.0 139ns 0.136ns 0.508ns 0.00395 0 0 280 B
#6482 ObjectExtractorSimpleBody netcoreapp3.1 196ns 0.119ns 0.462ns 0.00367 0 0 272 B
#6482 ObjectExtractorSimpleBody net472 163ns 0.173ns 0.649ns 0.0446 0 0 281 B
#6482 ObjectExtractorMoreComplexBody net6.0 2.89μs 1.8ns 6.74ns 0.0537 0 0 3.78 KB
#6482 ObjectExtractorMoreComplexBody netcoreapp3.1 3.74μs 0.977ns 3.52ns 0.0504 0 0 3.69 KB
#6482 ObjectExtractorMoreComplexBody net472 3.65μs 3.45ns 13.4ns 0.603 0.00548 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 36.8μs 29.1ns 109ns 0.456 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 54.1μs 16.2ns 62.7ns 0.456 0 0 32.4 KB
master EncodeArgs net472 67.9μs 61.6ns 239ns 5.16 0.0679 0 32.5 KB
master EncodeLegacyArgs net6.0 75.3μs 54.1ns 210ns 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 106μs 123ns 477ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 156μs 77.7ns 301ns 0.313 0 0 2.15 KB
#6482 EncodeArgs net6.0 36.2μs 18.8ns 73ns 0.45 0 0 32.4 KB
#6482 EncodeArgs netcoreapp3.1 54.6μs 26.6ns 99.5ns 0.433 0 0 32.4 KB
#6482 EncodeArgs net472 67.5μs 95.4ns 370ns 5.14 0.0676 0 32.5 KB
#6482 EncodeLegacyArgs net6.0 71.7μs 54ns 209ns 0 0 0 2.14 KB
#6482 EncodeLegacyArgs netcoreapp3.1 106μs 129ns 500ns 0 0 0 2.14 KB
#6482 EncodeLegacyArgs net472 153μs 72.2ns 280ns 0.309 0 0 2.15 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 RunWafRealisticBenchmark net6.0 175μs 128ns 496ns 0 0 0 2.44 KB
master RunWafRealisticBenchmark netcoreapp3.1 187μs 173ns 669ns 0 0 0 2.39 KB
master RunWafRealisticBenchmark net472 199μs 69.8ns 252ns 0.302 0 0 2.46 KB
master RunWafRealisticBenchmarkWithAttack net6.0 116μs 32.3ns 116ns 0 0 0 1.47 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 124μs 110ns 425ns 0 0 0 1.46 KB
master RunWafRealisticBenchmarkWithAttack net472 132μs 31.3ns 117ns 0.198 0 0 1.49 KB
#6482 RunWafRealisticBenchmark net6.0 175μs 82.2ns 318ns 0 0 0 2.44 KB
#6482 RunWafRealisticBenchmark netcoreapp3.1 185μs 84.1ns 315ns 0 0 0 2.39 KB
#6482 RunWafRealisticBenchmark net472 199μs 62ns 232ns 0.299 0 0 2.46 KB
#6482 RunWafRealisticBenchmarkWithAttack net6.0 115μs 62ns 232ns 0 0 0 1.47 KB
#6482 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 124μs 43.7ns 158ns 0 0 0 1.46 KB
#6482 RunWafRealisticBenchmarkWithAttack net472 133μs 48.2ns 180ns 0.2 0 0 1.49 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #6482

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 59.07 KB 60.98 KB 1.91 KB 3.24%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 253.38 KB 255.94 KB 2.55 KB 1.01%

Fewer allocations 🎉 in #6482

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 257.36 KB 254.93 KB -2.43 KB -0.94%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 61.8μs 793ns 7.77μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 62.5μs 764ns 7.41μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 37.3μs 44.4ns 154ns 0 0 0 59.07 KB
master StringConcatAspectBenchmark net6.0 329μs 1.88μs 14.1μs 0 0 0 257.36 KB
master StringConcatAspectBenchmark netcoreapp3.1 338μs 1.73μs 9.94μs 0 0 0 253.38 KB
master StringConcatAspectBenchmark net472 300μs 6.25μs 61.9μs 0 0 0 278.53 KB
#6482 StringConcatBenchmark net6.0 60.5μs 666ns 6.59μs 0 0 0 43.44 KB
#6482 StringConcatBenchmark netcoreapp3.1 62.2μs 1μs 9.86μs 0 0 0 42.64 KB
#6482 StringConcatBenchmark net472 38.1μs 188ns 751ns 0 0 0 60.98 KB
#6482 StringConcatAspectBenchmark net6.0 315μs 1.81μs 13.6μs 0 0 0 254.93 KB
#6482 StringConcatAspectBenchmark netcoreapp3.1 365μs 2.01μs 12.2μs 0 0 0 255.94 KB
#6482 StringConcatAspectBenchmark net472 277μs 5.14μs 50.1μs 0 0 0 278.53 KB

@andrewlock
Copy link
Member

andrewlock commented Dec 23, 2024

Benchmarks Report for tracer 🐌

Benchmarks for #6482 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.162
  • All benchmarks have the same 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 7.97μs 42.2ns 263ns 0.0164 0.00818 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10.1μs 55.1ns 297ns 0.02 0.01 0 5.8 KB
master StartStopWithChild net472 16.2μs 54.1ns 209ns 1.05 0.311 0.106 6.21 KB
#6482 StartStopWithChild net6.0 8.29μs 47.5ns 346ns 0.0162 0.00811 0 5.61 KB
#6482 StartStopWithChild netcoreapp3.1 10.1μs 53.9ns 280ns 0.0195 0.00976 0 5.8 KB
#6482 StartStopWithChild net472 16.1μs 54.1ns 210ns 1.03 0.291 0.0945 6.21 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 495μs 114ns 409ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 649μs 514ns 1.99μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 855μs 574ns 2.15μs 0.425 0 0 3.3 KB
#6482 WriteAndFlushEnrichedTraces net6.0 503μs 396ns 1.53μs 0 0 0 2.7 KB
#6482 WriteAndFlushEnrichedTraces netcoreapp3.1 675μs 613ns 2.37μs 0 0 0 2.7 KB
#6482 WriteAndFlushEnrichedTraces net472 855μs 530ns 2.05μs 0.425 0 0 3.3 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 150μs 866ns 7.04μs 0.14 0 0 14.47 KB
master SendRequest netcoreapp3.1 174μs 1.02μs 9.85μs 0.172 0 0 17.27 KB
master SendRequest net472 0.000839ns 0.000722ns 0.0026ns 0 0 0 0 b
#6482 SendRequest net6.0 147μs 766ns 3.75μs 0.144 0 0 14.47 KB
#6482 SendRequest netcoreapp3.1 174μs 1.15μs 11.4μs 0.178 0 0 17.27 KB
#6482 SendRequest net472 0.00618ns 0.00223ns 0.00862ns 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 575μs 3.07μs 16.5μs 0.553 0 0 41.6 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 671μs 3.56μs 24.1μs 0.321 0 0 41.85 KB
master WriteAndFlushEnrichedTraces net472 820μs 3.94μs 15.8μs 8.12 2.44 0.406 53.32 KB
#6482 WriteAndFlushEnrichedTraces net6.0 591μs 3.29μs 21.4μs 0.576 0 0 41.76 KB
#6482 WriteAndFlushEnrichedTraces netcoreapp3.1 672μs 3.8μs 27.1μs 0.374 0 0 41.79 KB
#6482 WriteAndFlushEnrichedTraces net472 845μs 4.1μs 16.9μs 8.39 2.52 0.419 53.3 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.35μs 1.94ns 7.53ns 0.0141 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.75μs 1.21ns 4.54ns 0.0139 0 0 1.02 KB
master ExecuteNonQuery net472 1.99μs 1.82ns 6.57ns 0.157 0.000997 0 987 B
#6482 ExecuteNonQuery net6.0 1.3μs 1.33ns 5.14ns 0.0142 0 0 1.02 KB
#6482 ExecuteNonQuery netcoreapp3.1 1.77μs 2.01ns 7.8ns 0.0141 0 0 1.02 KB
#6482 ExecuteNonQuery net472 2.14μs 1.93ns 7.22ns 0.157 0.00106 0 987 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.18μs 5.71ns 22.1ns 0.0138 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.49μs 0.875ns 3.39ns 0.0128 0 0 976 B
master CallElasticsearch net472 2.55μs 1.92ns 7.43ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.31μs 0.835ns 3.23ns 0.0131 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.68μs 1.89ns 7.31ns 0.0134 0 0 1.02 KB
master CallElasticsearchAsync net472 2.64μs 1.02ns 3.81ns 0.167 0 0 1.05 KB
#6482 CallElasticsearch net6.0 1.25μs 2ns 7.73ns 0.0136 0 0 976 B
#6482 CallElasticsearch netcoreapp3.1 1.5μs 1.45ns 5.63ns 0.0128 0 0 976 B
#6482 CallElasticsearch net472 2.49μs 1.33ns 4.81ns 0.157 0 0 995 B
#6482 CallElasticsearchAsync net6.0 1.32μs 0.527ns 2.04ns 0.0133 0 0 952 B
#6482 CallElasticsearchAsync netcoreapp3.1 1.65μs 2.15ns 8.33ns 0.0132 0 0 1.02 KB
#6482 CallElasticsearchAsync net472 2.56μs 1.22ns 4.56ns 0.167 0 0 1.05 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.27μs 1.02ns 3.67ns 0.0133 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.65μs 0.631ns 2.36ns 0.0124 0 0 952 B
master ExecuteAsync net472 1.84μs 0.561ns 2.02ns 0.145 0 0 915 B
#6482 ExecuteAsync net6.0 1.23μs 0.447ns 1.67ns 0.0131 0 0 952 B
#6482 ExecuteAsync netcoreapp3.1 1.65μs 0.507ns 1.9ns 0.0123 0 0 952 B
#6482 ExecuteAsync net472 1.79μs 0.536ns 2ns 0.145 0 0 915 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.44μs 1.81ns 6.52ns 0.031 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.32μs 1.22ns 4.72ns 0.0376 0 0 2.85 KB
master SendAsync net472 7.28μs 0.867ns 3.24ns 0.495 0 0 3.12 KB
#6482 SendAsync net6.0 4.49μs 1.43ns 5.55ns 0.0313 0 0 2.31 KB
#6482 SendAsync netcoreapp3.1 5.31μs 1.94ns 7.49ns 0.0372 0 0 2.85 KB
#6482 SendAsync net472 7.39μs 0.971ns 3.36ns 0.494 0 0 3.12 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.58μs 3.38ns 13.1ns 0.0228 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.13μs 1.8ns 6.72ns 0.0224 0 0 1.64 KB
master EnrichedLog net472 2.8μs 2.38ns 9.21ns 0.249 0 0 1.57 KB
#6482 EnrichedLog net6.0 1.63μs 0.586ns 2.11ns 0.0228 0 0 1.64 KB
#6482 EnrichedLog netcoreapp3.1 2.04μs 0.81ns 3.03ns 0.0227 0 0 1.64 KB
#6482 EnrichedLog net472 2.7μs 1.68ns 6.51ns 0.249 0 0 1.57 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 118μs 151ns 585ns 0 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 124μs 184ns 714ns 0.0612 0 0 4.28 KB
master EnrichedLog net472 150μs 176ns 682ns 0.677 0.226 0 4.46 KB
#6482 EnrichedLog net6.0 117μs 133ns 478ns 0.0589 0 0 4.28 KB
#6482 EnrichedLog netcoreapp3.1 120μs 224ns 837ns 0.0605 0 0 4.28 KB
#6482 EnrichedLog net472 152μs 420ns 1.63μs 0.682 0.227 0 4.46 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.02μs 0.821ns 3.07ns 0.0304 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.37μs 1.66ns 6.44ns 0.0284 0 0 2.2 KB
master EnrichedLog net472 4.83μs 2.37ns 9.18ns 0.319 0 0 2.02 KB
#6482 EnrichedLog net6.0 2.96μs 3.76ns 13.6ns 0.031 0 0 2.2 KB
#6482 EnrichedLog netcoreapp3.1 4.37μs 1.12ns 4.33ns 0.029 0 0 2.2 KB
#6482 EnrichedLog net472 4.72μs 0.921ns 3.45ns 0.319 0 0 2.02 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.38μs 1.52ns 5.27ns 0.016 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.84μs 0.788ns 2.84ns 0.0147 0 0 1.14 KB
master SendReceive net472 2.1μs 0.912ns 3.29ns 0.183 0 0 1.16 KB
#6482 SendReceive net6.0 1.32μs 0.291ns 1.01ns 0.0159 0 0 1.14 KB
#6482 SendReceive netcoreapp3.1 1.82μs 0.618ns 2.31ns 0.0155 0 0 1.14 KB
#6482 SendReceive net472 2.12μs 1.88ns 7.28ns 0.183 0 0 1.16 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.8μs 1.26ns 4.88ns 0.0224 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.82μs 1.61ns 6.02ns 0.0212 0 0 1.65 KB
master EnrichedLog net472 4.22μs 5.31ns 20.5ns 0.324 0 0 2.04 KB
#6482 EnrichedLog net6.0 2.72μs 4.34ns 16.8ns 0.0218 0 0 1.6 KB
#6482 EnrichedLog netcoreapp3.1 3.77μs 1.23ns 4.42ns 0.0209 0 0 1.65 KB
#6482 EnrichedLog net472 4.4μs 3.21ns 12.4ns 0.324 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6482

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 1.180 742.77 629.55
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑netcoreapp3.1 1.145 748.06 653.24

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 451ns 0.8ns 3.1ns 0.00812 0 0 576 B
master StartFinishSpan netcoreapp3.1 603ns 0.781ns 3.03ns 0.00751 0 0 576 B
master StartFinishSpan net472 742ns 1ns 3.76ns 0.0918 0 0 578 B
master StartFinishScope net6.0 541ns 0.78ns 3.02ns 0.00976 0 0 696 B
master StartFinishScope netcoreapp3.1 748ns 0.869ns 3.36ns 0.00929 0 0 696 B
master StartFinishScope net472 822ns 1.78ns 6.91ns 0.104 0 0 658 B
#6482 StartFinishSpan net6.0 443ns 0.357ns 1.33ns 0.00801 0 0 576 B
#6482 StartFinishSpan netcoreapp3.1 554ns 0.866ns 3.35ns 0.00784 0 0 576 B
#6482 StartFinishSpan net472 630ns 1.35ns 5.22ns 0.0918 0 0 578 B
#6482 StartFinishScope net6.0 543ns 0.516ns 2ns 0.00985 0 0 696 B
#6482 StartFinishScope netcoreapp3.1 654ns 1.04ns 4.02ns 0.00922 0 0 696 B
#6482 StartFinishScope net472 871ns 0.898ns 3.48ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 635ns 0.871ns 3.37ns 0.00963 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 891ns 1.25ns 4.82ns 0.00951 0 0 696 B
master RunOnMethodBegin net472 1.1μs 2.41ns 9.35ns 0.104 0 0 658 B
#6482 RunOnMethodBegin net6.0 684ns 0.965ns 3.74ns 0.00976 0 0 696 B
#6482 RunOnMethodBegin netcoreapp3.1 858ns 2.01ns 7.78ns 0.00955 0 0 696 B
#6482 RunOnMethodBegin net472 1.08μs 1.95ns 7.56ns 0.104 0 0 658 B

@NachoEchevarria NachoEchevarria changed the title Remove DatabaseIntegration sample. Merge IastController [ASM] Refactor AsnNetCore5DatabaseTests Dec 24, 2024
@NachoEchevarria NachoEchevarria changed the title [ASM] Refactor AsnNetCore5DatabaseTests [ASM] Refactor AspNetCore5DatabaseTests Dec 24, 2024
Copy link
Contributor

github-actions bot commented Dec 24, 2024

Snapshots difference summary

The following differences have been observed in committed snapshots. It is meant to help the reviewer.
The diff is simplistic, so please check some files anyway while we improve it.

1 occurrences of :

-    Service: Samples.Security.AspNetCore5.DatabaseIntegration,
+    Service: Samples.Security.AspNetCore5,
[...]
-      aspnet_core.endpoint: Samples.Security.AspNetCore5.Controllers.DatabaseIntegration.IastController.StoredSqli (Samples.Security.AspNetCore5.DatabaseIntegration),
+      aspnet_core.endpoint: Samples.Security.AspNetCore5.Controllers.IastController.StoredSqli (Samples.Security.AspNetCore5),

1 occurrences of :

-        "path": "Samples.Security.AspNetCore5.Controllers.DatabaseIntegration.IastController",
+        "path": "Samples.Security.AspNetCore5.Controllers.IastController",

3 occurrences of :

-    Service: Samples.Security.AspNetCore5.DatabaseIntegration,
+    Service: Samples.Security.AspNetCore5,

1 occurrences of :

-    Service: Samples.Security.AspNetCore5.DatabaseIntegration,
+    Service: Samples.Security.AspNetCore5,
[...]
-      aspnet_core.endpoint: Samples.Security.AspNetCore5.Controllers.DatabaseIntegration.IastController.StoredXss (Samples.Security.AspNetCore5.DatabaseIntegration),
+      aspnet_core.endpoint: Samples.Security.AspNetCore5.Controllers.IastController.StoredXss (Samples.Security.AspNetCore5),

1 occurrences of :

-    Service: Samples.Security.AspNetCore5.DatabaseIntegration,
+    Service: Samples.Security.AspNetCore5,
[...]
-      aspnet_core.endpoint: Samples.Security.AspNetCore5.Controllers.DatabaseIntegration.IastController.StoredXssEscaped (Samples.Security.AspNetCore5.DatabaseIntegration),
+      aspnet_core.endpoint: Samples.Security.AspNetCore5.Controllers.IastController.StoredXssEscaped (Samples.Security.AspNetCore5),

@NachoEchevarria NachoEchevarria marked this pull request as ready for review December 24, 2024 17:03
@NachoEchevarria NachoEchevarria requested review from a team as code owners December 24, 2024 17:03
Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

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

Mostly just looked at the build bits, but LGTM, thanks 👍

tracer/build/_build/Build.Steps.cs Outdated Show resolved Hide resolved
Comment on lines +17 to +21

/// <summary>
/// Contains both tests that require Docker and tests that do not.
/// </summary>
Mixed,
Copy link
Member

Choose a reason for hiding this comment

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

FYI, I'm working on a PR currently that moves the build to a completely separate stage, and just builds all the samples. That should both speed up the build, and remove some of this complexity. Once I've done that, I think we can just ditch this entirely. It's all fine for now though 👍

@NachoEchevarria
Copy link
Contributor Author

Thanks for your reviews and feedback!

@NachoEchevarria NachoEchevarria merged commit e4e2a1d into master Jan 7, 2025
100 of 103 checks passed
@NachoEchevarria NachoEchevarria deleted the nacho/MergeDatabaseIntegrationMainSample branch January 7, 2025 12:30
@github-actions github-actions bot added this to the vNext-v3 milestone Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:asm area:asm-iast area:tests unit tests, integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants