-
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
Enforce not referencing Datadog.Trace directly in sample projects #5683
Enforce not referencing Datadog.Trace directly in sample projects #5683
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.
Nice!
Datadog ReportBranch report: ✅ 0 Failed, 348637 Passed, 2158 Skipped, 22h 28m 34.73s 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 (5683) - mean (75ms) : 60, 91
. : milestone, 75,
master - mean (73ms) : 66, 80
. : milestone, 73,
section CallTarget+Inlining+NGEN
This PR (5683) - mean (1,006ms) : 983, 1030
. : milestone, 1006,
master - mean (1,010ms) : 990, 1029
. : milestone, 1010,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5683) - mean (110ms) : 107, 114
. : milestone, 110,
master - mean (109ms) : 105, 113
. : milestone, 109,
section CallTarget+Inlining+NGEN
This PR (5683) - mean (718ms) : 689, 747
. : milestone, 718,
master - mean (712ms) : 690, 735
. : milestone, 712,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5683) - mean (92ms) : 89, 96
. : milestone, 92,
master - mean (92ms) : 90, 95
. : milestone, 92,
section CallTarget+Inlining+NGEN
This PR (5683) - mean (665ms) : 642, 688
. : milestone, 665,
master - mean (669ms) : 646, 691
. : milestone, 669,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5683) - mean (191ms) : 188, 194
. : milestone, 191,
master - mean (191ms) : 187, 194
. : milestone, 191,
section CallTarget+Inlining+NGEN
This PR (5683) - mean (1,098ms) : 1069, 1127
. : milestone, 1098,
master - mean (1,099ms) : 1078, 1121
. : milestone, 1099,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5683) - mean (276ms) : 273, 280
. : milestone, 276,
master - mean (276ms) : 272, 279
. : milestone, 276,
section CallTarget+Inlining+NGEN
This PR (5683) - mean (896ms) : 873, 919
. : milestone, 896,
master - mean (899ms) : 874, 925
. : milestone, 899,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5683) - mean (266ms) : 263, 270
. : milestone, 266,
master - mean (265ms) : 260, 270
. : milestone, 265,
section CallTarget+Inlining+NGEN
This PR (5683) - mean (879ms) : 852, 906
. : milestone, 879,
master - mean (878ms) : 854, 903
. : milestone, 878,
|
Throughput/Crank Report:zap: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 (5683) (11.392M) : 0, 11392332
master (11.559M) : 0, 11559447
benchmarks/2.9.0 (11.627M) : 0, 11626549
section Automatic
This PR (5683) (7.689M) : 0, 7688578
master (7.850M) : 0, 7849728
benchmarks/2.9.0 (8.152M) : 0, 8152375
section Trace stats
master (8.099M) : 0, 8099150
section Manual
This PR (5683) (9.734M) : 0, 9733548
master (9.854M) : 0, 9853955
section Manual + Automatic
This PR (5683) (7.221M) : 0, 7220914
master (7.295M) : 0, 7295073
section Version Conflict
master (6.517M) : 0, 6517481
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (5683) (9.371M) : 0, 9370522
master (9.476M) : 0, 9475757
benchmarks/2.9.0 (9.556M) : 0, 9555681
section Automatic
This PR (5683) (6.544M) : 0, 6543963
master (6.724M) : 0, 6723830
section Trace stats
master (6.935M) : 0, 6934501
section Manual
This PR (5683) (8.455M) : 0, 8455106
master (8.345M) : 0, 8345357
section Manual + Automatic
This PR (5683) (6.193M) : 0, 6192868
master (6.290M) : 0, 6289651
section Version Conflict
master (5.639M) : 0, 5638885
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (5683) (10.172M) : 0, 10171613
master (10.075M) : 0, 10074879
benchmarks/2.9.0 (10.130M) : 0, 10129519
section Automatic
This PR (5683) (7.278M) : 0, 7277689
master (7.058M) : 0, 7058398
benchmarks/2.9.0 (7.456M) : 0, 7456006
section Trace stats
master (7.435M) : 0, 7435275
section Manual
This PR (5683) (9.091M) : 0, 9090985
master (8.837M) : 0, 8837025
section Manual + Automatic
This PR (5683) (6.998M) : 0, 6997917
master (6.888M) : 0, 6887732
section Version Conflict
master (6.128M) : 0, 6127636
|
Benchmarks Report for tracer 🐌Benchmarks for #5683 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 - Faster 🎉 Same allocations ✔️
|
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net6.0 | 1.126 | 1,237.52 | 1,099.50 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | ExecuteNonQuery |
net6.0 | 1.24μs | 1.11ns | 4.3ns | 0.0113 | 0 | 0 | 808 B |
master | ExecuteNonQuery |
netcoreapp3.1 | 1.46μs | 0.676ns | 2.62ns | 0.0109 | 0 | 0 | 808 B |
master | ExecuteNonQuery |
net472 | 1.68μs | 0.481ns | 1.86ns | 0.122 | 0 | 0 | 770 B |
#5683 | ExecuteNonQuery |
net6.0 | 1.1μs | 0.31ns | 1.16ns | 0.011 | 0 | 0 | 808 B |
#5683 | ExecuteNonQuery |
netcoreapp3.1 | 1.49μs | 2.69ns | 10.4ns | 0.0108 | 0 | 0 | 808 B |
#5683 | ExecuteNonQuery |
net472 | 1.76μs | 1.45ns | 5.62ns | 0.122 | 0 | 0 | 770 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.25μs | 0.29ns | 1.08ns | 0.0138 | 0 | 0 | 976 B |
master | CallElasticsearch |
netcoreapp3.1 | 1.47μs | 0.748ns | 2.8ns | 0.0132 | 0 | 0 | 976 B |
master | CallElasticsearch |
net472 | 2.56μs | 1.66ns | 6.44ns | 0.158 | 0 | 0 | 995 B |
master | CallElasticsearchAsync |
net6.0 | 1.2μs | 0.43ns | 1.61ns | 0.0132 | 0 | 0 | 952 B |
master | CallElasticsearchAsync |
netcoreapp3.1 | 1.63μs | 0.874ns | 3.15ns | 0.0137 | 0 | 0 | 1.02 KB |
master | CallElasticsearchAsync |
net472 | 2.51μs | 1.7ns | 6.6ns | 0.167 | 0.00125 | 0 | 1.05 KB |
#5683 | CallElasticsearch |
net6.0 | 1.16μs | 0.827ns | 3.2ns | 0.0134 | 0 | 0 | 976 B |
#5683 | CallElasticsearch |
netcoreapp3.1 | 1.6μs | 3.79ns | 14.7ns | 0.0129 | 0 | 0 | 976 B |
#5683 | CallElasticsearch |
net472 | 2.44μs | 1.32ns | 4.95ns | 0.157 | 0.00124 | 0 | 995 B |
#5683 | CallElasticsearchAsync |
net6.0 | 1.23μs | 1.27ns | 4.91ns | 0.0129 | 0 | 0 | 952 B |
#5683 | CallElasticsearchAsync |
netcoreapp3.1 | 1.62μs | 0.79ns | 3.06ns | 0.0139 | 0 | 0 | 1.02 KB |
#5683 | CallElasticsearchAsync |
net472 | 2.58μs | 1.09ns | 4.23ns | 0.166 | 0 | 0 | 1.05 KB |
Benchmarks.Trace.GraphQLBenchmark - Faster 🎉 Same allocations ✔️
Faster 🎉 in #5683
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0
1.142
1,430.18
1,252.43
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0 | 1.142 | 1,430.18 | 1,252.43 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | ExecuteAsync |
net6.0 | 1.43μs | 0.498ns | 1.93ns | 0.0129 | 0 | 0 | 952 B |
master | ExecuteAsync |
netcoreapp3.1 | 1.58μs | 1.13ns | 4.39ns | 0.0127 | 0 | 0 | 952 B |
master | ExecuteAsync |
net472 | 1.74μs | 0.698ns | 2.61ns | 0.145 | 0 | 0 | 915 B |
#5683 | ExecuteAsync |
net6.0 | 1.25μs | 0.34ns | 1.27ns | 0.0132 | 0 | 0 | 952 B |
#5683 | ExecuteAsync |
netcoreapp3.1 | 1.68μs | 0.512ns | 1.91ns | 0.0126 | 0 | 0 | 952 B |
#5683 | ExecuteAsync |
net472 | 1.76μs | 0.957ns | 3.71ns | 0.145 | 0.000872 | 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.04μs | 1.26ns | 4.72ns | 0.0304 | 0 | 0 | 2.22 KB |
master | SendAsync |
netcoreapp3.1 | 5.11μs | 2.29ns | 8.57ns | 0.0359 | 0 | 0 | 2.76 KB |
master | SendAsync |
net472 | 7.67μs | 2.89ns | 11.2ns | 0.499 | 0 | 0 | 3.15 KB |
#5683 | SendAsync |
net6.0 | 4.2μs | 1.82ns | 6.79ns | 0.0294 | 0 | 0 | 2.22 KB |
#5683 | SendAsync |
netcoreapp3.1 | 5.14μs | 4.21ns | 16.3ns | 0.036 | 0 | 0 | 2.76 KB |
#5683 | SendAsync |
net472 | 7.64μs | 2.17ns | 8.12ns | 0.499 | 0 | 0 | 3.15 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.52μs | 0.864ns | 3.23ns | 0.0228 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
netcoreapp3.1 | 2.31μs | 1.66ns | 5.98ns | 0.0225 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
net472 | 2.53μs | 1.1ns | 4.11ns | 0.25 | 0 | 0 | 1.57 KB |
#5683 | EnrichedLog |
net6.0 | 1.56μs | 0.576ns | 2.16ns | 0.0226 | 0 | 0 | 1.64 KB |
#5683 | EnrichedLog |
netcoreapp3.1 | 2.15μs | 0.893ns | 3.34ns | 0.0215 | 0 | 0 | 1.64 KB |
#5683 | EnrichedLog |
net472 | 2.53μs | 1.06ns | 4.1ns | 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 | 93.6ns | 362ns | 0.0564 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
netcoreapp3.1 | 118μs | 177ns | 685ns | 0 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
net472 | 146μs | 173ns | 670ns | 0.656 | 0.219 | 0 | 4.46 KB |
#5683 | EnrichedLog |
net6.0 | 113μs | 97.6ns | 365ns | 0.0564 | 0 | 0 | 4.28 KB |
#5683 | EnrichedLog |
netcoreapp3.1 | 118μs | 186ns | 719ns | 0.0588 | 0 | 0 | 4.28 KB |
#5683 | EnrichedLog |
net472 | 146μs | 54.1ns | 210ns | 0.654 | 0.218 | 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 | 2.98μs | 1.71ns | 6.38ns | 0.0312 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.29μs | 3.18ns | 12.3ns | 0.03 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
net472 | 4.9μs | 1.62ns | 6.06ns | 0.318 | 0 | 0 | 2.02 KB |
#5683 | EnrichedLog |
net6.0 | 3.1μs | 1.91ns | 7.16ns | 0.0302 | 0 | 0 | 2.2 KB |
#5683 | EnrichedLog |
netcoreapp3.1 | 4.26μs | 1.8ns | 6.73ns | 0.0276 | 0 | 0 | 2.2 KB |
#5683 | EnrichedLog |
net472 | 4.89μs | 1.83ns | 7.07ns | 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.29μs | 0.454ns | 1.7ns | 0.0161 | 0 | 0 | 1.14 KB |
master | SendReceive |
netcoreapp3.1 | 1.71μs | 0.969ns | 3.63ns | 0.0153 | 0 | 0 | 1.14 KB |
master | SendReceive |
net472 | 2.11μs | 1.13ns | 4.37ns | 0.183 | 0.00105 | 0 | 1.16 KB |
#5683 | SendReceive |
net6.0 | 1.35μs | 2.7ns | 10.5ns | 0.0163 | 0 | 0 | 1.14 KB |
#5683 | SendReceive |
netcoreapp3.1 | 1.75μs | 1.29ns | 4.99ns | 0.0151 | 0 | 0 | 1.14 KB |
#5683 | SendReceive |
net472 | 2.07μs | 1.17ns | 4.53ns | 0.183 | 0.001 | 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.84μs | 2.86ns | 11.1ns | 0.0213 | 0 | 0 | 1.6 KB |
master | EnrichedLog |
netcoreapp3.1 | 3.93μs | 1.37ns | 4.93ns | 0.0218 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
net472 | 4.34μs | 1.94ns | 7.27ns | 0.324 | 0 | 0 | 2.04 KB |
#5683 | EnrichedLog |
net6.0 | 2.71μs | 1ns | 3.76ns | 0.0231 | 0 | 0 | 1.6 KB |
#5683 | EnrichedLog |
netcoreapp3.1 | 3.81μs | 1.45ns | 5.62ns | 0.0209 | 0 | 0 | 1.65 KB |
#5683 | EnrichedLog |
net472 | 4.49μs | 3.3ns | 12.4ns | 0.324 | 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 | 391ns | 0.142ns | 0.552ns | 0.00808 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 638ns | 0.519ns | 2.01ns | 0.00777 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 689ns | 0.369ns | 1.33ns | 0.0915 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 475ns | 0.182ns | 0.682ns | 0.00986 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 746ns | 0.852ns | 3.3ns | 0.00948 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 885ns | 0.49ns | 1.9ns | 0.104 | 0 | 0 | 658 B |
#5683 | StartFinishSpan |
net6.0 | 397ns | 0.144ns | 0.558ns | 0.00811 | 0 | 0 | 576 B |
#5683 | StartFinishSpan |
netcoreapp3.1 | 635ns | 0.17ns | 0.66ns | 0.00766 | 0 | 0 | 576 B |
#5683 | StartFinishSpan |
net472 | 636ns | 0.485ns | 1.88ns | 0.0916 | 0 | 0 | 578 B |
#5683 | StartFinishScope |
net6.0 | 478ns | 0.129ns | 0.498ns | 0.00982 | 0 | 0 | 696 B |
#5683 | StartFinishScope |
netcoreapp3.1 | 803ns | 0.219ns | 0.819ns | 0.00949 | 0 | 0 | 696 B |
#5683 | StartFinishScope |
net472 | 804ns | 0.44ns | 1.71ns | 0.104 | 0 | 0 | 658 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster 🎉 Same allocations ✔️
Faster 🎉 in #5683
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net472
1.113
1,140.92
1,025.22
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net472 | 1.113 | 1,140.92 | 1,025.22 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | RunOnMethodBegin |
net6.0 | 637ns | 2.44ns | 9.47ns | 0.00969 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 887ns | 1.85ns | 7.18ns | 0.00963 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.14μs | 0.496ns | 1.92ns | 0.104 | 0 | 0 | 658 B |
#5683 | RunOnMethodBegin |
net6.0 | 638ns | 0.296ns | 1.15ns | 0.00962 | 0 | 0 | 696 B |
#5683 | RunOnMethodBegin |
netcoreapp3.1 | 915ns | 0.662ns | 2.56ns | 0.00907 | 0 | 0 | 696 B |
#5683 | RunOnMethodBegin |
net472 | 1.03μs | 0.579ns | 2.24ns | 0.104 | 0 | 0 | 658 B |
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.
An elegant solution. 👌
a2fcfa9
to
9e2ea7a
Compare
…ally" reference Datadog.Trace
afa0273
to
967b274
Compare
Summary of changes
Samples.CIVisibilityIpc
Reason for change
Implementation details
AllowDatadogTraceReference
in projects we expect to reference Datadog.TraceCallTargetNativeTest
on Windows (.NET FX requires System.Memory, and doesn't have the same implicit conversions betweenReadOnlySpan<char>
andstring
as .NET Core)Test coverage
Should all be covered by existing tests
Other details
This is prerequisite work for some work to speed up/improve CI