-
Notifications
You must be signed in to change notification settings - Fork 142
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
Convert WebRequestTests to snapshot tests #6223
Convert WebRequestTests to snapshot tests #6223
Conversation
spans => | ||
spans.OrderBy(x => VerifyHelper.GetRootSpanResourceName(x, spans)) | ||
.ThenBy(x => VerifyHelper.GetSpanDepth(x, spans)) | ||
.ThenBy(x => x.Tags.TryGetValue("http.url", out var url) ? url : string.Empty) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit annoying, but we need to add this extra sorting layer to get stable snapshots
2811fee
to
4e63c00
Compare
Datadog ReportBranch report: ✅ 0 Failed, 389245 Passed, 2780 Skipped, 34h 6m 41.64s Total Time |
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:
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 (6223) - mean (71ms) : 68, 73
. : milestone, 71,
master - mean (70ms) : 68, 72
. : milestone, 70,
section CallTarget+Inlining+NGEN
This PR (6223) - mean (1,114ms) : 1091, 1137
. : milestone, 1114,
master - mean (1,118ms) : 1096, 1140
. : milestone, 1118,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6223) - mean (110ms) : 107, 112
. : milestone, 110,
master - mean (110ms) : 106, 114
. : milestone, 110,
section CallTarget+Inlining+NGEN
This PR (6223) - mean (777ms) : 759, 795
. : milestone, 777,
master - mean (778ms) : 753, 803
. : milestone, 778,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6223) - mean (93ms) : 91, 96
. : milestone, 93,
master - mean (94ms) : 90, 97
. : milestone, 94,
section CallTarget+Inlining+NGEN
This PR (6223) - mean (728ms) : 710, 747
. : milestone, 728,
master - mean (733ms) : 716, 750
. : milestone, 733,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6223) - mean (191ms) : 188, 194
. : milestone, 191,
master - mean (190ms) : 187, 194
. : milestone, 190,
section CallTarget+Inlining+NGEN
This PR (6223) - mean (1,204ms) : 1184, 1225
. : milestone, 1204,
master - mean (1,204ms) : 1181, 1227
. : milestone, 1204,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6223) - mean (277ms) : 273, 280
. : milestone, 277,
master - mean (276ms) : 271, 281
. : milestone, 276,
section CallTarget+Inlining+NGEN
This PR (6223) - mean (944ms) : 930, 957
. : milestone, 944,
master - mean (945ms) : 927, 964
. : milestone, 945,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6223) - mean (265ms) : 262, 269
. : milestone, 265,
master - mean (265ms) : 261, 269
. : milestone, 265,
section CallTarget+Inlining+NGEN
This PR (6223) - mean (928ms) : 906, 950
. : milestone, 928,
master - mean (928ms) : 907, 950
. : milestone, 928,
|
Benchmarks Report for tracer 🐌Benchmarks for #6223 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SpanBenchmark - Slower
|
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 | 1.194 | 544.34 | 649.79 |
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 | 1.169 | 471.32 | 403.14 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 471ns | 0.337ns | 1.26ns | 0.0081 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 544ns | 0.28ns | 1.01ns | 0.00786 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 662ns | 0.729ns | 2.82ns | 0.0915 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 500ns | 0.388ns | 1.5ns | 0.0097 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 796ns | 3.86ns | 15.9ns | 0.0095 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 909ns | 0.415ns | 1.55ns | 0.104 | 0 | 0 | 658 B |
#6223 | StartFinishSpan |
net6.0 | 403ns | 0.212ns | 0.793ns | 0.00808 | 0 | 0 | 576 B |
#6223 | StartFinishSpan |
netcoreapp3.1 | 650ns | 0.406ns | 1.52ns | 0.00773 | 0 | 0 | 576 B |
#6223 | StartFinishSpan |
net472 | 664ns | 0.304ns | 1.18ns | 0.0916 | 0 | 0 | 578 B |
#6223 | StartFinishScope |
net6.0 | 491ns | 0.333ns | 1.29ns | 0.00983 | 0 | 0 | 696 B |
#6223 | StartFinishScope |
netcoreapp3.1 | 750ns | 0.38ns | 1.47ns | 0.00937 | 0 | 0 | 696 B |
#6223 | StartFinishScope |
net472 | 858ns | 0.958ns | 3.71ns | 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 | 669ns | 0.569ns | 2.2ns | 0.00972 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 954ns | 0.395ns | 1.53ns | 0.00913 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.17μs | 0.489ns | 1.89ns | 0.104 | 0 | 0 | 658 B |
#6223 | RunOnMethodBegin |
net6.0 | 676ns | 0.401ns | 1.55ns | 0.00983 | 0 | 0 | 696 B |
#6223 | RunOnMethodBegin |
netcoreapp3.1 | 1.03μs | 3.14ns | 12.2ns | 0.00937 | 0 | 0 | 696 B |
#6223 | RunOnMethodBegin |
net472 | 1.16μs | 0.53ns | 2.05ns | 0.104 | 0 | 0 | 658 B |
Throughput/Crank Report ⚡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 (6223) (11.287M) : 0, 11286734
master (11.037M) : 0, 11037382
benchmarks/2.9.0 (11.081M) : 0, 11080577
section Automatic
This PR (6223) (7.461M) : 0, 7460932
master (7.332M) : 0, 7331545
benchmarks/2.9.0 (7.732M) : 0, 7732233
section Trace stats
master (7.599M) : 0, 7599283
section Manual
master (11.138M) : 0, 11137529
section Manual + Automatic
This PR (6223) (6.831M) : 0, 6831461
master (6.810M) : 0, 6810452
section DD_TRACE_ENABLED=0
master (10.315M) : 0, 10314577
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6223) (9.639M) : 0, 9639332
master (9.239M) : 0, 9238939
benchmarks/2.9.0 (9.798M) : 0, 9798067
section Automatic
This PR (6223) (6.486M) : 0, 6486032
master (6.663M) : 0, 6663078
section Trace stats
master (6.810M) : 0, 6810312
section Manual
master (9.476M) : 0, 9476291
section Manual + Automatic
This PR (6223) (6.220M) : 0, 6220231
master (5.927M) : 0, 5927373
section DD_TRACE_ENABLED=0
master (8.897M) : 0, 8896810
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6223) (9.783M) : 0, 9783431
master (9.875M) : 0, 9874887
benchmarks/2.9.0 (10.067M) : 0, 10067315
section Automatic
This PR (6223) (6.329M) : 0, 6329380
master (6.385M) : 0, 6384926
benchmarks/2.9.0 (7.552M) : 0, 7552193
section Trace stats
master (7.066M) : 0, 7066003
section Manual
master (9.880M) : 0, 9880054
section Manual + Automatic
This PR (6223) (6.065M) : 0, 6064796
master (6.127M) : 0, 6126574
section DD_TRACE_ENABLED=0
master (9.337M) : 0, 9337260
|
Summary of changes
Converts the
WebRequestTests
to use snapshot tests instead of adhoc assertionsReason for change
While working on something else (.NET 9) these tests were failing, but it was really hard to understand why - snapshots make that easy.
Implementation details
Ran locally with .NET FX, .NET 8, and .NET Core 2.1, and checked for differences
Test coverage
Coverage is the same - I'll also do an "all TFMs" run to make sure nothing will break post-merge