-
Notifications
You must be signed in to change notification settings - Fork 140
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
[CI Visibility] - Fix ITR Code Coverage collector attach algorithm #5412
[CI Visibility] - Fix ITR Code Coverage collector attach algorithm #5412
Conversation
var isVsTestCommand = string.Equals(program, "VSTest.Console", StringComparison.OrdinalIgnoreCase); | ||
foreach (var arg in args.Skip(1)) | ||
// Try to find the test command type: `dotnet test` or `dotnet vstest` | ||
var isDotnetTestCommand = false; |
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.
Or did you mean to reset the isVsTestCommand
here too? 🤔
// Check if we are running dotnet process | ||
if (string.Equals(program, "dotnet", StringComparison.OrdinalIgnoreCase) || | ||
string.Equals(program, "VSTest.Console", StringComparison.OrdinalIgnoreCase)) | ||
if (isDotnetCommand || isVsTestCommand) |
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.
Will we ever have isDotnetCommand == true
and isVsTestCommand == true
? Is VSTest.Console test
a thing you're looking for? If not, then I assume you don't need || isVsTestCommand
here? 🤔
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.
I need that ||
because the code to attach the collector is inside that condition.
We need to attach the collector, and there's two mode of attach:
dotnet test
: Mode 1dotnet vstest
: Mode 2vstest.console
: Mode 2
So when I detect dotnet
I need to look further for test
or vstest
to select the mode.
That's why initially I have if (isDotnetCommand || isVsTestCommand)
(we need to attach the collector if we can) and later the if (isDotnetCommand)
to look into the arguments (to decide if we have test or vstest to attach to).
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.
But I mean, if you have vstest.console
and not dotnet
, then you're doing Mode2 no matter what, right? 🤔
In other words, which mode should be doing for these?
vstest.console test myproj.project
vstest.console vstest myproj.project
Or, while we're at it, what about these?
vstest.console myproj.project -- extra args test
dotnet test myproj.project -- extra args vstest
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.
If the answer to 1 and 2 about are both "Mode 2", then I think we should skip the arg checking if isVsTestCommand == true
🤔
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.
done in f287b66
Datadog ReportBranch report: ✅ 0 Failed, 326558 Passed, 1580 Skipped, 42m 13.2s Wall 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 (5412) - mean (73ms) : 65, 82
. : milestone, 73,
master - mean (74ms) : 61, 87
. : milestone, 74,
section CallTarget+Inlining+NGEN
This PR (5412) - mean (998ms) : 973, 1022
. : milestone, 998,
master - mean (995ms) : 979, 1010
. : milestone, 995,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5412) - mean (109ms) : 107, 112
. : milestone, 109,
master - mean (109ms) : 105, 113
. : milestone, 109,
section CallTarget+Inlining+NGEN
This PR (5412) - mean (713ms) : 689, 737
. : milestone, 713,
master - mean (715ms) : 689, 741
. : milestone, 715,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5412) - mean (94ms) : 91, 97
. : milestone, 94,
master - mean (93ms) : 90, 96
. : milestone, 93,
section CallTarget+Inlining+NGEN
This PR (5412) - mean (669ms) : 642, 695
. : milestone, 669,
master - mean (665ms) : 642, 689
. : milestone, 665,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5412) - mean (186ms) : 184, 189
. : milestone, 186,
master - mean (187ms) : 185, 190
. : milestone, 187,
section CallTarget+Inlining+NGEN
This PR (5412) - mean (1,074ms) : 1046, 1101
. : milestone, 1074,
master - mean (1,077ms) : 1049, 1105
. : milestone, 1077,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5412) - mean (270ms) : 263, 276
. : milestone, 270,
master - mean (271ms) : 268, 275
. : milestone, 271,
section CallTarget+Inlining+NGEN
This PR (5412) - mean (872ms) : 849, 896
. : milestone, 872,
master - mean (877ms) : 852, 902
. : milestone, 877,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5412) - mean (259ms) : 252, 266
. : milestone, 259,
master - mean (259ms) : 254, 264
. : milestone, 259,
section CallTarget+Inlining+NGEN
This PR (5412) - mean (850ms) : 824, 877
. : milestone, 850,
master - mean (851ms) : 830, 872
. : milestone, 851,
|
Benchmarks Report for tracer 🐌Benchmarks for #5412 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 - Slower
|
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net6.0 | 1.121 | 1,083.43 | 1,214.82 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | ExecuteNonQuery |
net6.0 | 1.08μs | 0.249ns | 0.964ns | 0.0109 | 0 | 0 | 784 B |
master | ExecuteNonQuery |
netcoreapp3.1 | 1.51μs | 2.37ns | 9.17ns | 0.0105 | 0 | 0 | 784 B |
master | ExecuteNonQuery |
net472 | 1.83μs | 0.359ns | 1.34ns | 0.118 | 0 | 0 | 746 B |
#5412 | ExecuteNonQuery |
net6.0 | 1.22μs | 0.372ns | 1.34ns | 0.0109 | 0 | 0 | 784 B |
#5412 | ExecuteNonQuery |
netcoreapp3.1 | 1.47μs | 0.491ns | 1.9ns | 0.0107 | 0 | 0 | 784 B |
#5412 | ExecuteNonQuery |
net472 | 1.73μs | 0.698ns | 2.7ns | 0.118 | 0 | 0 | 746 B |
Benchmarks.Trace.ElasticsearchBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #5412
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net6.0
1.127
1,273.11
1,434.45
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net6.0 | 1.127 | 1,273.11 | 1,434.45 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | CallElasticsearch |
net6.0 | 1.25μs | 0.342ns | 1.28ns | 0.0145 | 0 | 0 | 1.01 KB |
master | CallElasticsearch |
netcoreapp3.1 | 1.71μs | 1.86ns | 7.19ns | 0.0135 | 0 | 0 | 1.01 KB |
master | CallElasticsearch |
net472 | 2.59μs | 1.77ns | 6.6ns | 0.162 | 0 | 0 | 1.02 KB |
master | CallElasticsearchAsync |
net6.0 | 1.27μs | 0.52ns | 2.02ns | 0.0135 | 0 | 0 | 984 B |
master | CallElasticsearchAsync |
netcoreapp3.1 | 1.76μs | 0.811ns | 2.92ns | 0.0141 | 0 | 0 | 1.06 KB |
master | CallElasticsearchAsync |
net472 | 2.58μs | 1.65ns | 6.41ns | 0.17 | 0 | 0 | 1.08 KB |
#5412 | CallElasticsearch |
net6.0 | 1.29μs | 0.49ns | 1.9ns | 0.0143 | 0 | 0 | 1.01 KB |
#5412 | CallElasticsearch |
netcoreapp3.1 | 1.62μs | 0.481ns | 1.8ns | 0.0137 | 0 | 0 | 1.01 KB |
#5412 | CallElasticsearch |
net472 | 2.58μs | 1.93ns | 7.49ns | 0.161 | 0.00129 | 0 | 1.02 KB |
#5412 | CallElasticsearchAsync |
net6.0 | 1.43μs | 0.441ns | 1.65ns | 0.0136 | 0 | 0 | 984 B |
#5412 | CallElasticsearchAsync |
netcoreapp3.1 | 1.73μs | 0.775ns | 2.9ns | 0.0146 | 0 | 0 | 1.06 KB |
#5412 | CallElasticsearchAsync |
net472 | 2.63μs | 1.48ns | 5.75ns | 0.17 | 0 | 0 | 1.08 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.97ns | 3.76ns | 0.0127 | 0 | 0 | 928 B |
master | ExecuteAsync |
netcoreapp3.1 | 1.69μs | 0.918ns | 3.43ns | 0.0129 | 0 | 0 | 928 B |
master | ExecuteAsync |
net472 | 1.92μs | 4.05ns | 14.6ns | 0.141 | 0 | 0 | 891 B |
#5412 | ExecuteAsync |
net6.0 | 1.22μs | 0.544ns | 2.04ns | 0.0129 | 0 | 0 | 928 B |
#5412 | ExecuteAsync |
netcoreapp3.1 | 1.7μs | 0.419ns | 1.62ns | 0.0126 | 0 | 0 | 928 B |
#5412 | ExecuteAsync |
net472 | 1.91μs | 1.2ns | 4.66ns | 0.141 | 0 | 0 | 891 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.05μs | 1.03ns | 3.72ns | 0.0303 | 0 | 0 | 2.16 KB |
master | SendAsync |
netcoreapp3.1 | 4.97μs | 2.48ns | 9.61ns | 0.0346 | 0 | 0 | 2.7 KB |
master | SendAsync |
net472 | 7.72μs | 8.52ns | 31.9ns | 0.484 | 0 | 0 | 3.05 KB |
#5412 | SendAsync |
net6.0 | 4.2μs | 1.12ns | 4.02ns | 0.0315 | 0 | 0 | 2.16 KB |
#5412 | SendAsync |
netcoreapp3.1 | 5.09μs | 1.9ns | 7.11ns | 0.0357 | 0 | 0 | 2.7 KB |
#5412 | SendAsync |
net472 | 7.87μs | 3.48ns | 13.5ns | 0.482 | 0 | 0 | 3.05 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 | 2.96ns | 11.5ns | 0.0233 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
netcoreapp3.1 | 2.16μs | 0.907ns | 3.39ns | 0.0219 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
net472 | 2.83μs | 1.16ns | 4.35ns | 0.249 | 0 | 0 | 1.57 KB |
#5412 | EnrichedLog |
net6.0 | 1.5μs | 1.14ns | 4.42ns | 0.0232 | 0 | 0 | 1.65 KB |
#5412 | EnrichedLog |
netcoreapp3.1 | 2.21μs | 0.798ns | 2.99ns | 0.0224 | 0 | 0 | 1.65 KB |
#5412 | EnrichedLog |
net472 | 2.72μs | 1.48ns | 5.54ns | 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 | 113μs | 218ns | 845ns | 0.0565 | 0 | 0 | 4.23 KB |
master | EnrichedLog |
netcoreapp3.1 | 118μs | 139ns | 519ns | 0 | 0 | 0 | 4.23 KB |
master | EnrichedLog |
net472 | 147μs | 131ns | 507ns | 0.659 | 0.22 | 0 | 4.41 KB |
#5412 | EnrichedLog |
net6.0 | 111μs | 68ns | 263ns | 0.056 | 0 | 0 | 4.23 KB |
#5412 | EnrichedLog |
netcoreapp3.1 | 117μs | 150ns | 581ns | 0 | 0 | 0 | 4.23 KB |
#5412 | EnrichedLog |
net472 | 146μs | 47.6ns | 178ns | 0.658 | 0.219 | 0 | 4.41 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 | 1.87ns | 7.25ns | 0.0303 | 0 | 0 | 2.21 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.2μs | 2.12ns | 7.93ns | 0.0297 | 0 | 0 | 2.21 KB |
master | EnrichedLog |
net472 | 4.81μs | 5.36ns | 20.8ns | 0.321 | 0 | 0 | 2.02 KB |
#5412 | EnrichedLog |
net6.0 | 3.09μs | 1.09ns | 4.08ns | 0.031 | 0 | 0 | 2.21 KB |
#5412 | EnrichedLog |
netcoreapp3.1 | 4.32μs | 1.09ns | 4.22ns | 0.0281 | 0 | 0 | 2.21 KB |
#5412 | EnrichedLog |
net472 | 4.88μs | 2.15ns | 8.34ns | 0.32 | 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.54μs | 1.05ns | 3.92ns | 0.0162 | 0 | 0 | 1.18 KB |
master | SendReceive |
netcoreapp3.1 | 1.91μs | 0.803ns | 2.9ns | 0.0161 | 0 | 0 | 1.18 KB |
master | SendReceive |
net472 | 2.37μs | 1.09ns | 4.21ns | 0.186 | 0 | 0 | 1.18 KB |
#5412 | SendReceive |
net6.0 | 1.42μs | 0.325ns | 1.26ns | 0.0163 | 0 | 0 | 1.18 KB |
#5412 | SendReceive |
netcoreapp3.1 | 1.78μs | 0.793ns | 2.97ns | 0.0155 | 0 | 0 | 1.18 KB |
#5412 | SendReceive |
net472 | 2.26μs | 1.23ns | 4.76ns | 0.187 | 0.00113 | 0 | 1.18 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.78μs | 0.912ns | 3.53ns | 0.0222 | 0 | 0 | 1.55 KB |
master | EnrichedLog |
netcoreapp3.1 | 3.88μs | 2.19ns | 8.19ns | 0.0213 | 0 | 0 | 1.6 KB |
master | EnrichedLog |
net472 | 4.39μs | 1.81ns | 7.01ns | 0.314 | 0 | 0 | 1.99 KB |
#5412 | EnrichedLog |
net6.0 | 2.74μs | 1.33ns | 5.15ns | 0.0206 | 0 | 0 | 1.55 KB |
#5412 | EnrichedLog |
netcoreapp3.1 | 3.98μs | 1.24ns | 4.29ns | 0.0198 | 0 | 0 | 1.6 KB |
#5412 | EnrichedLog |
net472 | 4.49μs | 2.14ns | 8.28ns | 0.316 | 0 | 0 | 1.99 KB |
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #5412
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0
1.176
533.26
627.02
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 | 1.176 | 533.26 | 627.02 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 526ns | 1.29ns | 5ns | 0.00771 | 0 | 0 | 552 B |
master | StartFinishSpan |
netcoreapp3.1 | 728ns | 1.4ns | 5.43ns | 0.0074 | 0 | 0 | 552 B |
master | StartFinishSpan |
net472 | 680ns | 0.921ns | 3.57ns | 0.0877 | 0 | 0 | 554 B |
master | StartFinishScope |
net6.0 | 534ns | 0.99ns | 3.83ns | 0.00946 | 0 | 0 | 672 B |
master | StartFinishScope |
netcoreapp3.1 | 925ns | 1.46ns | 5.64ns | 0.00875 | 0 | 0 | 672 B |
master | StartFinishScope |
net472 | 977ns | 1.67ns | 6.25ns | 0.101 | 0 | 0 | 634 B |
#5412 | StartFinishSpan |
net6.0 | 521ns | 0.908ns | 3.52ns | 0.00762 | 0 | 0 | 552 B |
#5412 | StartFinishSpan |
netcoreapp3.1 | 695ns | 2.87ns | 11.1ns | 0.00737 | 0 | 0 | 552 B |
#5412 | StartFinishSpan |
net472 | 736ns | 1.01ns | 3.92ns | 0.0879 | 0 | 0 | 554 B |
#5412 | StartFinishScope |
net6.0 | 627ns | 1.09ns | 4.23ns | 0.00944 | 0 | 0 | 672 B |
#5412 | StartFinishScope |
netcoreapp3.1 | 925ns | 1.11ns | 4.29ns | 0.00892 | 0 | 0 | 672 B |
#5412 | StartFinishScope |
net472 | 948ns | 1.83ns | 7.07ns | 0.1 | 0 | 0 | 634 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster 🎉 Same allocations ✔️
Faster 🎉 in #5412
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net472
1.127
1,167.53
1,036.25
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net472 | 1.127 | 1,167.53 | 1,036.25 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | RunOnMethodBegin |
net6.0 | 640ns | 1.19ns | 4.6ns | 0.00941 | 0 | 0 | 672 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 946ns | 1.64ns | 6.35ns | 0.00861 | 0 | 0 | 672 B |
master | RunOnMethodBegin |
net472 | 1.17μs | 3.27ns | 12.7ns | 0.101 | 0 | 0 | 634 B |
#5412 | RunOnMethodBegin |
net6.0 | 659ns | 0.529ns | 1.98ns | 0.00954 | 0 | 0 | 672 B |
#5412 | RunOnMethodBegin |
netcoreapp3.1 | 961ns | 1.53ns | 5.92ns | 0.00897 | 0 | 0 | 672 B |
#5412 | RunOnMethodBegin |
net472 | 1.03μs | 1.96ns | 7.59ns | 0.1 | 0 | 0 | 634 B |
Summary of changes
This PR changes the algorithm to attach the ITR code coverage datacollector by:
.exe
suffix.dotnet test
command.Reason for change
Currently we are not attaching the collector if the command finishes with the
.exe
suffix.