-
Notifications
You must be signed in to change notification settings - Fork 147
[Test Optimization] Add missing test_session
metric
#6776
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
Conversation
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.
LGTM, just a nit + question
/// <summary> | ||
/// Test session auto injected environment variable | ||
/// </summary> | ||
public const string TestSessionAutoInjectedEnvironmentVariable = "DD_CIVISIBILITY_AUTO_INSTRUMENTATION_PROVIDER"; |
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.
Need a dd-go PR for this setting? I guess not, but then should they be able to set it through other config sources (i.e. should it be "real" config) and if not, you probably need to add it to the "exclude" list in the unit tests?
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.
Because this is a setting that we want to use internally and not expose it to customers I don't think we want to add it to the dd-go settings. This settings will be set by a bash script and only using environment variables.
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 (6776) - mean (69ms) : 66, 72
. : milestone, 69,
master - mean (69ms) : 67, 71
. : milestone, 69,
section CallTarget+Inlining+NGEN
This PR (6776) - mean (1,004ms) : 985, 1023
. : milestone, 1004,
master - mean (1,006ms) : 977, 1034
. : milestone, 1006,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6776) - mean (102ms) : 100, 104
. : milestone, 102,
master - mean (102ms) : 99, 105
. : milestone, 102,
section CallTarget+Inlining+NGEN
This PR (6776) - mean (684ms) : 668, 701
. : milestone, 684,
master - mean (685ms) : 669, 702
. : milestone, 685,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6776) - mean (89ms) : 87, 92
. : milestone, 89,
master - mean (89ms) : 86, 91
. : milestone, 89,
section CallTarget+Inlining+NGEN
This PR (6776) - mean (637ms) : 619, 655
. : milestone, 637,
master - mean (642ms) : 622, 662
. : milestone, 642,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6776) - mean (191ms) : 186, 195
. : milestone, 191,
master - mean (191ms) : 187, 194
. : milestone, 191,
section CallTarget+Inlining+NGEN
This PR (6776) - mean (1,106ms) : 1078, 1133
. : milestone, 1106,
master - mean (1,107ms) : 1085, 1130
. : milestone, 1107,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6776) - mean (269ms) : 265, 273
. : milestone, 269,
master - mean (269ms) : 265, 273
. : milestone, 269,
section CallTarget+Inlining+NGEN
This PR (6776) - mean (876ms) : 847, 906
. : milestone, 876,
master - mean (876ms) : 839, 912
. : milestone, 876,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6776) - mean (262ms) : 258, 265
. : milestone, 262,
master - mean (262ms) : 258, 265
. : milestone, 262,
section CallTarget+Inlining+NGEN
This PR (6776) - mean (853ms) : 824, 883
. : milestone, 853,
master - mean (859ms) : 828, 890
. : milestone, 859,
|
Benchmarks Report for tracer 🐌Benchmarks for #6776 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 - Faster 🎉 Same allocations ✔️
|
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net6.0 | 1.132 | 1,353.23 | 1,195.27 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | CallElasticsearch |
net6.0 | 1.35μs | 0.414ns | 1.6ns | 0.0136 | 0 | 0 | 976 B |
master | CallElasticsearch |
netcoreapp3.1 | 1.66μs | 1.68ns | 6.51ns | 0.0132 | 0 | 0 | 976 B |
master | CallElasticsearch |
net472 | 2.72μs | 6.62ns | 24.8ns | 0.157 | 0 | 0 | 995 B |
master | CallElasticsearchAsync |
net6.0 | 1.25μs | 0.452ns | 1.69ns | 0.0131 | 0 | 0 | 952 B |
master | CallElasticsearchAsync |
netcoreapp3.1 | 1.64μs | 0.872ns | 3.38ns | 0.014 | 0 | 0 | 1.02 KB |
master | CallElasticsearchAsync |
net472 | 2.61μs | 1.9ns | 7.36ns | 0.167 | 0 | 0 | 1.05 KB |
#6776 | CallElasticsearch |
net6.0 | 1.2μs | 0.509ns | 1.9ns | 0.0136 | 0 | 0 | 976 B |
#6776 | CallElasticsearch |
netcoreapp3.1 | 1.56μs | 0.585ns | 2.19ns | 0.0133 | 0 | 0 | 976 B |
#6776 | CallElasticsearch |
net472 | 2.57μs | 1.61ns | 6.02ns | 0.158 | 0 | 0 | 995 B |
#6776 | CallElasticsearchAsync |
net6.0 | 1.25μs | 3.73ns | 14.4ns | 0.013 | 0 | 0 | 952 B |
#6776 | CallElasticsearchAsync |
netcoreapp3.1 | 1.58μs | 0.729ns | 2.63ns | 0.0135 | 0 | 0 | 1.02 KB |
#6776 | CallElasticsearchAsync |
net472 | 2.79μs | 1.67ns | 6.47ns | 0.167 | 0 | 0 | 1.05 KB |
Benchmarks.Trace.GraphQLBenchmark - Faster 🎉 Same allocations ✔️
Faster 🎉 in #6776
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0
1.127
1,362.53
1,208.57
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0 | 1.127 | 1,362.53 | 1,208.57 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | ExecuteAsync |
net6.0 | 1.36μs | 0.462ns | 1.73ns | 0.013 | 0 | 0 | 952 B |
master | ExecuteAsync |
netcoreapp3.1 | 1.63μs | 1.32ns | 4.93ns | 0.0122 | 0 | 0 | 952 B |
master | ExecuteAsync |
net472 | 1.74μs | 0.494ns | 1.85ns | 0.145 | 0 | 0 | 915 B |
#6776 | ExecuteAsync |
net6.0 | 1.21μs | 0.57ns | 2.13ns | 0.0135 | 0 | 0 | 952 B |
#6776 | ExecuteAsync |
netcoreapp3.1 | 1.66μs | 1.17ns | 4.53ns | 0.0124 | 0 | 0 | 952 B |
#6776 | ExecuteAsync |
net472 | 1.78μs | 0.58ns | 2.17ns | 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.45μs | 3.64ns | 13.6ns | 0.0309 | 0 | 0 | 2.31 KB |
master | SendAsync |
netcoreapp3.1 | 5.45μs | 5.27ns | 20.4ns | 0.0381 | 0 | 0 | 2.85 KB |
master | SendAsync |
net472 | 7.4μs | 2.02ns | 7ns | 0.494 | 0 | 0 | 3.12 KB |
#6776 | SendAsync |
net6.0 | 4.38μs | 0.952ns | 3.56ns | 0.0329 | 0 | 0 | 2.31 KB |
#6776 | SendAsync |
netcoreapp3.1 | 5.44μs | 2.18ns | 8.43ns | 0.0381 | 0 | 0 | 2.85 KB |
#6776 | SendAsync |
net472 | 7.55μs | 2.75ns | 10.6ns | 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.57μs | 0.497ns | 1.86ns | 0.0236 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
netcoreapp3.1 | 2.24μs | 1.43ns | 5.37ns | 0.0224 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
net472 | 2.58μs | 0.624ns | 2.25ns | 0.25 | 0 | 0 | 1.57 KB |
#6776 | EnrichedLog |
net6.0 | 1.46μs | 0.385ns | 1.44ns | 0.0227 | 0 | 0 | 1.64 KB |
#6776 | EnrichedLog |
netcoreapp3.1 | 2.31μs | 2.15ns | 7.74ns | 0.0219 | 0 | 0 | 1.64 KB |
#6776 | EnrichedLog |
net472 | 2.54μs | 5.45ns | 20.4ns | 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 | 111μs | 143ns | 553ns | 0.0555 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
netcoreapp3.1 | 117μs | 146ns | 547ns | 0.0588 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
net472 | 149μs | 223ns | 863ns | 0.678 | 0.226 | 0 | 4.46 KB |
#6776 | EnrichedLog |
net6.0 | 112μs | 133ns | 517ns | 0.056 | 0 | 0 | 4.28 KB |
#6776 | EnrichedLog |
netcoreapp3.1 | 117μs | 185ns | 717ns | 0.0588 | 0 | 0 | 4.28 KB |
#6776 | EnrichedLog |
net472 | 149μs | 129ns | 500ns | 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.08μs | 1.22ns | 4.57ns | 0.0308 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.31μs | 4.52ns | 17.5ns | 0.0304 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
net472 | 4.71μs | 1.77ns | 6.87ns | 0.32 | 0 | 0 | 2.02 KB |
#6776 | EnrichedLog |
net6.0 | 3.16μs | 1.21ns | 4.69ns | 0.03 | 0 | 0 | 2.2 KB |
#6776 | EnrichedLog |
netcoreapp3.1 | 4.2μs | 1.17ns | 4.52ns | 0.0297 | 0 | 0 | 2.2 KB |
#6776 | EnrichedLog |
net472 | 4.78μs | 1.28ns | 4.8ns | 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 | 0.903ns | 3.5ns | 0.0158 | 0 | 0 | 1.14 KB |
master | SendReceive |
netcoreapp3.1 | 1.81μs | 0.735ns | 2.85ns | 0.0153 | 0 | 0 | 1.14 KB |
master | SendReceive |
net472 | 2.12μs | 1.37ns | 5.31ns | 0.183 | 0 | 0 | 1.16 KB |
#6776 | SendReceive |
net6.0 | 1.36μs | 0.926ns | 3.59ns | 0.0156 | 0 | 0 | 1.14 KB |
#6776 | SendReceive |
netcoreapp3.1 | 1.73μs | 0.653ns | 2.44ns | 0.0155 | 0 | 0 | 1.14 KB |
#6776 | SendReceive |
net472 | 2.11μs | 2.03ns | 7.32ns | 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.82μs | 1.27ns | 4.74ns | 0.0225 | 0 | 0 | 1.6 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.05μs | 1.57ns | 5.88ns | 0.0221 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
net472 | 4.42μs | 4.31ns | 16.7ns | 0.323 | 0 | 0 | 2.04 KB |
#6776 | EnrichedLog |
net6.0 | 2.63μs | 0.642ns | 2.4ns | 0.0224 | 0 | 0 | 1.6 KB |
#6776 | EnrichedLog |
netcoreapp3.1 | 4.04μs | 4.94ns | 19.1ns | 0.0221 | 0 | 0 | 1.65 KB |
#6776 | EnrichedLog |
net472 | 4.57μs | 3.51ns | 13.1ns | 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 | 402ns | 0.0703ns | 0.263ns | 0.00801 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 577ns | 0.311ns | 1.2ns | 0.00777 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 665ns | 0.277ns | 1.03ns | 0.0915 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 477ns | 0.103ns | 0.398ns | 0.00974 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 742ns | 0.362ns | 1.4ns | 0.00919 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 843ns | 0.172ns | 0.667ns | 0.104 | 0 | 0 | 658 B |
#6776 | StartFinishSpan |
net6.0 | 401ns | 0.13ns | 0.502ns | 0.00807 | 0 | 0 | 576 B |
#6776 | StartFinishSpan |
netcoreapp3.1 | 568ns | 0.462ns | 1.79ns | 0.00768 | 0 | 0 | 576 B |
#6776 | StartFinishSpan |
net472 | 649ns | 0.449ns | 1.74ns | 0.0916 | 0 | 0 | 578 B |
#6776 | StartFinishScope |
net6.0 | 471ns | 0.197ns | 0.762ns | 0.00967 | 0 | 0 | 696 B |
#6776 | StartFinishScope |
netcoreapp3.1 | 713ns | 0.341ns | 1.32ns | 0.00932 | 0 | 0 | 696 B |
#6776 | StartFinishScope |
net472 | 803ns | 0.621ns | 2.32ns | 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 | 639ns | 0.122ns | 0.438ns | 0.00957 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 922ns | 0.391ns | 1.41ns | 0.0093 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.12μs | 0.367ns | 1.42ns | 0.104 | 0 | 0 | 658 B |
#6776 | RunOnMethodBegin |
net6.0 | 618ns | 0.234ns | 0.905ns | 0.00991 | 0 | 0 | 696 B |
#6776 | RunOnMethodBegin |
netcoreapp3.1 | 988ns | 0.611ns | 2.37ns | 0.00887 | 0 | 0 | 696 B |
#6776 | RunOnMethodBegin |
net472 | 1.17μs | 0.233ns | 0.871ns | 0.104 | 0 | 0 | 658 B |
Summary of changes
This PR adds the missing
test_session
telemetry metric.JIRA: https://datadoghq.atlassian.net/browse/SDTEST-1697
Reason for change
The metric was already in the
common_metrics.json
file but the implementation was missing.Implementation details
Test coverage
Other details