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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

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: 19d3882
Test service: dd-trace-dotnet

✅ 0 Failed, 461622 Passed, 2854 Skipped, 20h 14m 1.62s 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 (68ms)  : 66, 71
     .   : milestone, 68,
    master - mean (69ms)  : 65, 72
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (6482) - mean (978ms)  : 951, 1006
     .   : milestone, 978,
    master - mean (977ms)  : 955, 1000
     .   : milestone, 977,

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

    section CallTarget+Inlining+NGEN
    This PR (6482) - mean (675ms)  : 661, 689
     .   : milestone, 675,
    master - mean (679ms)  : 662, 695
     .   : milestone, 679,

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

    section CallTarget+Inlining+NGEN
    This PR (6482) - mean (631ms)  : 615, 648
     .   : milestone, 631,
    master - mean (634ms)  : 614, 654
     .   : milestone, 634,

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, 199
     .   : milestone, 194,
    master - mean (193ms)  : 189, 197
     .   : milestone, 193,

    section CallTarget+Inlining+NGEN
    This PR (6482) - mean (1,098ms)  : 1070, 1126
     .   : milestone, 1098,
    master - mean (1,099ms)  : 1070, 1129
     .   : milestone, 1099,

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

    section CallTarget+Inlining+NGEN
    This PR (6482) - mean (868ms)  : 837, 900
     .   : milestone, 868,
    master - mean (871ms)  : 844, 897
     .   : milestone, 871,

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

    section CallTarget+Inlining+NGEN
    This PR (6482) - mean (845ms)  : 812, 878
     .   : milestone, 845,
    master - mean (855ms)  : 825, 885
     .   : milestone, 855,

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
  • 2 benchmarks have fewer allocations
  • 1 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 203μs 87.5ns 328ns 2.63 0 0 188.73 KB
master AllCycleSimpleBody netcoreapp3.1 306μs 79.5ns 298ns 2.6 0 0 196.06 KB
master AllCycleSimpleBody net472 270μs 163ns 631ns 35.8 2.02 0 225.75 KB
master AllCycleMoreComplexBody net6.0 211μs 215ns 832ns 2.7 0 0 192.23 KB
master AllCycleMoreComplexBody netcoreapp3.1 326μs 90.5ns 313ns 2.77 0 0 199.47 KB
master AllCycleMoreComplexBody net472 275μs 103ns 397ns 36.4 2.06 0 229.27 KB
master ObjectExtractorSimpleBody net6.0 138ns 0.19ns 0.737ns 0.00392 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 187ns 0.109ns 0.407ns 0.00377 0 0 272 B
master ObjectExtractorSimpleBody net472 162ns 0.147ns 0.569ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.89μs 1.71ns 6.61ns 0.0521 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.93μs 3.98ns 14.3ns 0.0513 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.59μs 3.98ns 14.9ns 0.602 0.00536 0 3.8 KB
#6482 AllCycleSimpleBody net6.0 208μs 97.9ns 366ns 2.61 0 0 188.73 KB
#6482 AllCycleSimpleBody netcoreapp3.1 312μs 189ns 709ns 2.64 0 0 196.06 KB
#6482 AllCycleSimpleBody net472 268μs 207ns 773ns 35.8 2.01 0 225.75 KB
#6482 AllCycleMoreComplexBody net6.0 215μs 84.2ns 303ns 2.7 0 0 192.23 KB
#6482 AllCycleMoreComplexBody netcoreapp3.1 314μs 108ns 404ns 2.69 0 0 199.47 KB
#6482 AllCycleMoreComplexBody net472 282μs 1.33μs 5.31μs 36.3 2.08 0 229.27 KB
#6482 ObjectExtractorSimpleBody net6.0 137ns 0.0933ns 0.361ns 0.00398 0 0 280 B
#6482 ObjectExtractorSimpleBody netcoreapp3.1 191ns 0.176ns 0.636ns 0.00373 0 0 272 B
#6482 ObjectExtractorSimpleBody net472 168ns 0.502ns 1.95ns 0.0446 0 0 281 B
#6482 ObjectExtractorMoreComplexBody net6.0 2.88μs 1.49ns 5.57ns 0.0536 0 0 3.78 KB
#6482 ObjectExtractorMoreComplexBody netcoreapp3.1 3.82μs 2.7ns 10.1ns 0.05 0 0 3.69 KB
#6482 ObjectExtractorMoreComplexBody net472 3.62μs 3.67ns 14.2ns 0.602 0.00549 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 37.4μs 15.1ns 56.6ns 0.464 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 54.3μs 46.7ns 175ns 0.431 0 0 32.4 KB
master EncodeArgs net472 66.7μs 78.4ns 304ns 5.14 0.0667 0 32.5 KB
master EncodeLegacyArgs net6.0 74.5μs 43.5ns 169ns 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 107μs 142ns 550ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 156μs 128ns 496ns 0.312 0 0 2.15 KB
#6482 EncodeArgs net6.0 37.6μs 17.5ns 65.5ns 0.452 0 0 32.4 KB
#6482 EncodeArgs netcoreapp3.1 54.1μs 25.9ns 100ns 0.43 0 0 32.4 KB
#6482 EncodeArgs net472 65.8μs 44.3ns 171ns 5.15 0.066 0 32.5 KB
#6482 EncodeLegacyArgs net6.0 73.8μs 93.6ns 363ns 0 0 0 2.14 KB
#6482 EncodeLegacyArgs netcoreapp3.1 107μs 219ns 848ns 0 0 0 2.14 KB
#6482 EncodeLegacyArgs net472 155μs 83.5ns 313ns 0.31 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 171μs 48.1ns 173ns 0 0 0 2.44 KB
master RunWafRealisticBenchmark netcoreapp3.1 186μs 175ns 678ns 0 0 0 2.39 KB
master RunWafRealisticBenchmark net472 199μs 92.2ns 357ns 0.298 0 0 2.46 KB
master RunWafRealisticBenchmarkWithAttack net6.0 116μs 90ns 349ns 0 0 0 1.47 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 123μs 148ns 574ns 0 0 0 1.46 KB
master RunWafRealisticBenchmarkWithAttack net472 133μs 50.2ns 195ns 0.198 0 0 1.49 KB
#6482 RunWafRealisticBenchmark net6.0 175μs 173ns 670ns 0 0 0 2.44 KB
#6482 RunWafRealisticBenchmark netcoreapp3.1 185μs 201ns 778ns 0 0 0 2.39 KB
#6482 RunWafRealisticBenchmark net472 199μs 53.5ns 200ns 0.299 0 0 2.46 KB
#6482 RunWafRealisticBenchmarkWithAttack net6.0 116μs 83.7ns 324ns 0 0 0 1.47 KB
#6482 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 123μs 179ns 693ns 0 0 0 1.46 KB
#6482 RunWafRealisticBenchmarkWithAttack net472 132μs 45.3ns 175ns 0.198 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 55.8 KB 57.29 KB 1.49 KB 2.67%

Fewer allocations 🎉 in #6482

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 263.31 KB 254.08 KB -9.23 KB -3.51%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 263.91 KB 253.17 KB -10.74 KB -4.07%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 56.8μs 820ns 8.03μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 54.2μs 125ns 451ns 0 0 0 42.64 KB
master StringConcatBenchmark net472 37.4μs 112ns 388ns 0 0 0 55.8 KB
master StringConcatAspectBenchmark net6.0 313μs 1.78μs 11.8μs 0 0 0 263.91 KB
master StringConcatAspectBenchmark netcoreapp3.1 349μs 1.48μs 7.97μs 0 0 0 263.31 KB
master StringConcatAspectBenchmark net472 254μs 3.73μs 34.8μs 0 0 0 278.53 KB
#6482 StringConcatBenchmark net6.0 59.1μs 812ns 8.12μs 0 0 0 43.44 KB
#6482 StringConcatBenchmark netcoreapp3.1 56.6μs 617ns 5.95μs 0 0 0 42.64 KB
#6482 StringConcatBenchmark net472 38.5μs 206ns 1.03μs 0 0 0 57.29 KB
#6482 StringConcatAspectBenchmark net6.0 314μs 1.7μs 12.6μs 0 0 0 253.17 KB
#6482 StringConcatAspectBenchmark netcoreapp3.1 346μs 1.9μs 12.7μs 0 0 0 254.08 KB
#6482 StringConcatAspectBenchmark net472 290μs 6.77μs 66.7μ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:

  • All benchmarks have the same speed
  • 1 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.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.15μs 45.4ns 305ns 0.0191 0.00765 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10.3μs 56.7ns 345ns 0.026 0.0104 0 5.8 KB
master StartStopWithChild net472 16.4μs 58.8ns 228ns 1.04 0.311 0.0901 6.21 KB
#6482 StartStopWithChild net6.0 8.1μs 44.9ns 294ns 0.0162 0.00812 0 5.61 KB
#6482 StartStopWithChild netcoreapp3.1 9.91μs 55.4ns 346ns 0.0198 0.00494 0 5.8 KB
#6482 StartStopWithChild net472 16.5μs 61ns 228ns 1.04 0.314 0.0993 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 485μs 354ns 1.37μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 648μs 504ns 1.89μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 853μs 631ns 2.28μs 0.425 0 0 3.3 KB
#6482 WriteAndFlushEnrichedTraces net6.0 492μs 565ns 2.12μs 0 0 0 2.7 KB
#6482 WriteAndFlushEnrichedTraces netcoreapp3.1 649μs 861ns 3.34μs 0 0 0 2.7 KB
#6482 WriteAndFlushEnrichedTraces net472 849μs 539ns 2.02μ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 153μs 1.2μs 11.9μs 0.14 0 0 14.47 KB
master SendRequest netcoreapp3.1 178μs 1.2μs 11.9μs 0.166 0 0 17.27 KB
master SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
#6482 SendRequest net6.0 160μs 999ns 9.74μs 0.147 0 0 14.47 KB
#6482 SendRequest netcoreapp3.1 171μs 988ns 8.38μs 0.155 0 0 17.27 KB
#6482 SendRequest net472 0.00324ns 0.00142ns 0.0055ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #6482

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 41.52 KB 41.76 KB 242 B 0.58%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 557μs 2.53μs 9.78μs 0.551 0 0 41.52 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 700μs 3.9μs 25.6μs 0.329 0 0 41.86 KB
master WriteAndFlushEnrichedTraces net472 819μs 2μs 7.5μs 8.17 2.45 0.408 53.32 KB
#6482 WriteAndFlushEnrichedTraces net6.0 613μs 3.58μs 35μs 0.576 0 0 41.76 KB
#6482 WriteAndFlushEnrichedTraces netcoreapp3.1 649μs 3.26μs 14.2μs 0.322 0 0 41.72 KB
#6482 WriteAndFlushEnrichedTraces net472 839μs 3.4μs 12.7μs 8.39 2.52 0.419 53.28 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.28μs 1.4ns 5.43ns 0.0142 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.81μs 1.73ns 6.71ns 0.0135 0 0 1.02 KB
master ExecuteNonQuery net472 2.1μs 3.89ns 14.6ns 0.157 0.00104 0 987 B
#6482 ExecuteNonQuery net6.0 1.26μs 2.01ns 7.79ns 0.0145 0 0 1.02 KB
#6482 ExecuteNonQuery netcoreapp3.1 1.86μs 2.99ns 11.6ns 0.0133 0 0 1.02 KB
#6482 ExecuteNonQuery net472 2.2μs 0.901ns 3.37ns 0.156 0.0011 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.23μs 1.08ns 4.03ns 0.0137 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.58μs 0.773ns 2.99ns 0.0127 0 0 976 B
master CallElasticsearch net472 2.58μs 0.927ns 3.47ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.34μs 0.45ns 1.68ns 0.0134 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.69μs 0.547ns 2.05ns 0.0137 0 0 1.02 KB
master CallElasticsearchAsync net472 2.66μs 1.14ns 4.27ns 0.167 0 0 1.05 KB
#6482 CallElasticsearch net6.0 1.25μs 0.419ns 1.51ns 0.0133 0 0 976 B
#6482 CallElasticsearch netcoreapp3.1 1.57μs 1.5ns 5.8ns 0.0134 0 0 976 B
#6482 CallElasticsearch net472 2.49μs 2.23ns 8.65ns 0.157 0 0 995 B
#6482 CallElasticsearchAsync net6.0 1.39μs 0.491ns 1.9ns 0.0131 0 0 952 B
#6482 CallElasticsearchAsync netcoreapp3.1 1.75μs 2.5ns 9.01ns 0.0138 0 0 1.02 KB
#6482 CallElasticsearchAsync net472 2.63μs 2.01ns 7.77ns 0.166 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.34μs 0.771ns 2.89ns 0.0134 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.63μs 1.16ns 4.34ns 0.0122 0 0 952 B
master ExecuteAsync net472 1.77μs 0.599ns 2.32ns 0.145 0 0 915 B
#6482 ExecuteAsync net6.0 1.22μs 1.94ns 7.51ns 0.0136 0 0 952 B
#6482 ExecuteAsync netcoreapp3.1 1.76μs 1.15ns 4.14ns 0.0123 0 0 952 B
#6482 ExecuteAsync net472 1.8μs 0.539ns 2.09ns 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.34μs 2.62ns 9.8ns 0.0324 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.35μs 2.18ns 8.15ns 0.0373 0 0 2.85 KB
master SendAsync net472 7.36μs 2.92ns 11.3ns 0.493 0 0 3.12 KB
#6482 SendAsync net6.0 4.52μs 1.98ns 7.43ns 0.0314 0 0 2.31 KB
#6482 SendAsync netcoreapp3.1 5.25μs 1.92ns 6.64ns 0.037 0 0 2.85 KB
#6482 SendAsync net472 7.28μs 1.74ns 6.52ns 0.495 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.53μs 0.58ns 2.17ns 0.023 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.22μs 3.9ns 14.6ns 0.0222 0 0 1.64 KB
master EnrichedLog net472 2.72μs 1.05ns 3.93ns 0.25 0 0 1.57 KB
#6482 EnrichedLog net6.0 1.47μs 2.57ns 9.63ns 0.0229 0 0 1.64 KB
#6482 EnrichedLog netcoreapp3.1 2.42μs 2.13ns 8.26ns 0.0218 0 0 1.64 KB
#6482 EnrichedLog net472 2.71μs 1.15ns 4.46ns 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 115μs 170ns 657ns 0.0576 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 121μs 199ns 746ns 0 0 0 4.28 KB
master EnrichedLog net472 150μs 150ns 560ns 0.673 0.224 0 4.46 KB
#6482 EnrichedLog net6.0 117μs 175ns 678ns 0 0 0 4.28 KB
#6482 EnrichedLog netcoreapp3.1 121μs 229ns 856ns 0 0 0 4.28 KB
#6482 EnrichedLog net472 151μs 187ns 723ns 0.67 0.223 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.04μs 0.838ns 3.25ns 0.0303 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.2μs 3.31ns 12.8ns 0.0294 0 0 2.2 KB
master EnrichedLog net472 4.84μs 1.46ns 5.65ns 0.319 0 0 2.02 KB
#6482 EnrichedLog net6.0 3.12μs 3.24ns 12.6ns 0.0314 0 0 2.2 KB
#6482 EnrichedLog netcoreapp3.1 4.1μs 0.892ns 3.34ns 0.0288 0 0 2.2 KB
#6482 EnrichedLog net472 4.83μs 1.48ns 5.54ns 0.321 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.31μs 0.659ns 2.47ns 0.0164 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.71μs 1.84ns 7.12ns 0.0153 0 0 1.14 KB
master SendReceive net472 2.07μs 0.844ns 2.92ns 0.183 0 0 1.16 KB
#6482 SendReceive net6.0 1.38μs 0.857ns 3.32ns 0.0159 0 0 1.14 KB
#6482 SendReceive netcoreapp3.1 1.72μs 1.02ns 3.96ns 0.0155 0 0 1.14 KB
#6482 SendReceive net472 2.1μs 1.24ns 4.63ns 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.71μs 0.7ns 2.71ns 0.0217 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.81μs 1.59ns 5.95ns 0.0208 0 0 1.65 KB
master EnrichedLog net472 4.4μs 0.843ns 3.04ns 0.322 0 0 2.04 KB
#6482 EnrichedLog net6.0 2.64μs 1.16ns 4.33ns 0.0224 0 0 1.6 KB
#6482 EnrichedLog netcoreapp3.1 3.71μs 1.77ns 6.87ns 0.0224 0 0 1.65 KB
#6482 EnrichedLog net472 4.33μs 3.7ns 13.8ns 0.323 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 399ns 0.25ns 0.967ns 0.00805 0 0 576 B
master StartFinishSpan netcoreapp3.1 597ns 0.33ns 1.28ns 0.00752 0 0 576 B
master StartFinishSpan net472 656ns 0.281ns 1.05ns 0.0917 0 0 578 B
master StartFinishScope net6.0 483ns 0.227ns 0.849ns 0.00965 0 0 696 B
master StartFinishScope netcoreapp3.1 676ns 0.441ns 1.71ns 0.00949 0 0 696 B
master StartFinishScope net472 872ns 0.728ns 2.82ns 0.104 0 0 658 B
#6482 StartFinishSpan net6.0 418ns 0.231ns 0.894ns 0.00806 0 0 576 B
#6482 StartFinishSpan netcoreapp3.1 565ns 0.373ns 1.44ns 0.00786 0 0 576 B
#6482 StartFinishSpan net472 713ns 0.418ns 1.62ns 0.0915 0 0 578 B
#6482 StartFinishScope net6.0 491ns 0.412ns 1.6ns 0.00983 0 0 696 B
#6482 StartFinishScope netcoreapp3.1 693ns 0.801ns 3.1ns 0.00938 0 0 696 B
#6482 StartFinishScope net472 887ns 0.566ns 2.19ns 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 634ns 0.299ns 1.12ns 0.00988 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 906ns 0.326ns 1.26ns 0.00898 0 0 696 B
master RunOnMethodBegin net472 1.07μs 0.503ns 1.95ns 0.104 0 0 658 B
#6482 RunOnMethodBegin net6.0 668ns 0.337ns 1.3ns 0.00978 0 0 696 B
#6482 RunOnMethodBegin netcoreapp3.1 856ns 0.308ns 1.19ns 0.00935 0 0 696 B
#6482 RunOnMethodBegin net472 1.03μs 0.588ns 2.28ns 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 👍

@@ -1888,7 +1888,7 @@ void RunWindowsIisIntegrationTests(Project project)
(null, _) => true,
(_, null) => true,
(_, { } p) when !string.IsNullOrWhiteSpace(SampleName) => p.Name.Contains(SampleName, StringComparison.OrdinalIgnoreCase),
(false, { } p) => p.RequiresDockerDependency() == DockerDependencyType.None,
(false, { } p) => p.RequiresDockerDependency() == DockerDependencyType.None || p.RequiresDockerDependency() == DockerDependencyType.Mixed,
Copy link
Member

Choose a reason for hiding this comment

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

nit (for brevity)

Suggested change
(false, { } p) => p.RequiresDockerDependency() == DockerDependencyType.None || p.RequiresDockerDependency() == DockerDependencyType.Mixed,
(false, { } p) => p.RequiresDockerDependency() is DockerDependencyType.None or DockerDependencyType.Mixed,

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 👍

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