Skip to content

Fix framework version regex#2658

Merged
andrewlock merged 1 commit into
masterfrom
andrew/fix-regex
Apr 11, 2022
Merged

Fix framework version regex#2658
andrewlock merged 1 commit into
masterfrom
andrew/fix-regex

Conversation

@andrewlock

Copy link
Copy Markdown
Member

Summary of changes

  • Fixes the Regex used to extract framework version from Location/CodeBase

Reason for change

I was a little hasty merging #2405

Implementation details

As described in this comment

Assembly.CodeBase returns something like

file:///C:/Program Files/dotnet/shared/Microsoft.NETCore.App/6.0.2/System.Private.CoreLib.dll

Assembly.Location returns

C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.2\System.Private.CoreLib.dll

The Regex only worked with the former. Updated it to also work with the latter.

Test coverage

We don't have any coverage for this, but as it worked before and won't actually be hit in net5+, I'm not too worried

@andrewlock andrewlock added the area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) label Apr 8, 2022
@andrewlock
andrewlock requested a review from a team as a code owner April 8, 2022 16:30
@andrewlock

Copy link
Copy Markdown
Member Author

Code Coverage Report 📊

✔️ Merging #2658 into master will not change line coverage
✔️ Merging #2658 into master will not change branch coverage
⛔ Merging #2658 into master will will increase complexity by 6

master #2658 Change
Lines 13438 / 18464 13464 / 18473
Lines % 73% 73% 0% ✔️
Branches 7754 / 11017 7770 / 11017
Branches % 70% 71% 0% ✔️
Complexity 12307 12313 6

View the full report for further details:

Datadog.Trace Breakdown ✔️

master #2658 Change
Lines % 73% 73% 0% ✔️
Branches % 70% 71% 0% ✔️
Complexity 12307 12313 6

The following classes have significant coverage changes.

File Line coverage change Branch coverage change Complexity change
Datadog.Trace.Telemetry.JsonHttpClientTelemetryTransport 26% ✔️ 38% ✔️ 0 ✔️

View the full reports for further details:

@andrewlock

Copy link
Copy Markdown
Member Author

Benchmarks Report 🐌

Benchmarks for #2658 compared to master:

  • 3 benchmarks are faster, with geometric mean 1.411
  • 1 benchmarks are slower, with geometric mean 1.455
  • All benchmarks have the same 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.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net472 1.12ms 6.49μs 56.9μs 0 0 0 3.16 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 808μs 4.29μs 23.9μs 0 0 0 2.57 KB
#2658 WriteAndFlushEnrichedTraces net472 983μs 2.48μs 8.94μs 0 0 0 3.17 KB
#2658 WriteAndFlushEnrichedTraces netcoreapp3.1 771μs 4.35μs 28.5μs 0 0 0 2.57 KB
Benchmarks.Trace.AppSecBodyBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #2658

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net472 1.202 367.53 305.83 bimodal

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net472 317ns 1.57ns 7.36ns 0.052 0 0 329 B
master AllCycleSimpleBody netcoreapp3.1 382ns 1.56ns 6.04ns 0.00454 0 0 328 B
master AllCycleMoreComplexBody net472 405ns 7.16ns 71.6ns 0.0482 0 0 305 B
master AllCycleMoreComplexBody netcoreapp3.1 368ns 1.04ns 3.88ns 0.00417 0 0 304 B
master BodyExtractorSimpleBody net472 488ns 2.38ns 10.4ns 0.0569 0 0 361 B
master BodyExtractorSimpleBody netcoreapp3.1 444ns 2.2ns 10.1ns 0.00375 0 0 272 B
master BodyExtractorMoreComplexBody net472 33μs 704ns 7.04μs 1.18 0.0136 0 7.62 KB
master BodyExtractorMoreComplexBody netcoreapp3.1 21.8μs 121ns 973ns 0.0943 0 0 6.75 KB
#2658 AllCycleSimpleBody net472 303ns 1.39ns 5.2ns 0.052 0 0 329 B
#2658 AllCycleSimpleBody netcoreapp3.1 395ns 2.12ns 11ns 0.00463 0 0 328 B
#2658 AllCycleMoreComplexBody net472 310ns 1.74ns 13.3ns 0.0481 0 0 305 B
#2658 AllCycleMoreComplexBody netcoreapp3.1 386ns 2.11ns 11.6ns 0.00419 0 0 304 B
#2658 BodyExtractorSimpleBody net472 447ns 2.16ns 9.41ns 0.057 0 0 361 B
#2658 BodyExtractorSimpleBody netcoreapp3.1 454ns 2.21ns 9.63ns 0.00365 0 0 272 B
#2658 BodyExtractorMoreComplexBody net472 24.9μs 116ns 449ns 1.18 0.0126 0 7.62 KB
#2658 BodyExtractorMoreComplexBody netcoreapp3.1 22.4μs 130ns 1.1μs 0.0946 0 0 6.75 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 net472 0ns 0ns 0ns 0 0 0 0 b
master SendRequest netcoreapp3.1 338μs 1.39μs 5.2μs 0.171 0 0 19.74 KB
#2658 SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
#2658 SendRequest netcoreapp3.1 339μs 1.48μs 7.25μs 0.166 0 0 19.74 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 net472 1.84μs 5.48ns 20.5ns 0.094 0.000904 0 594 B
master ExecuteNonQuery netcoreapp3.1 1.54μs 7.1ns 31ns 0.00896 0 0 632 B
#2658 ExecuteNonQuery net472 1.85μs 10.4ns 67.4ns 0.0938 0.00091 0 594 B
#2658 ExecuteNonQuery netcoreapp3.1 1.54μs 7.43ns 28.8ns 0.00854 0 0 632 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 net472 2.98μs 17.9ns 177ns 0.124 0 0 802 B
master CallElasticsearch netcoreapp3.1 1.79μs 8.31ns 32.2ns 0.0112 0 0 792 B
master CallElasticsearchAsync net472 3.27μs 13.7ns 70ns 0.149 0.00173 0 939 B
master CallElasticsearchAsync netcoreapp3.1 1.96μs 11.2ns 80.9ns 0.0128 0 0 912 B
#2658 CallElasticsearch net472 2.78μs 13.4ns 56.7ns 0.126 0 0 803 B
#2658 CallElasticsearch netcoreapp3.1 1.75μs 7.81ns 30.3ns 0.0112 0 0 792 B
#2658 CallElasticsearchAsync net472 2.99μs 13.7ns 53.2ns 0.149 0 0 939 B
#2658 CallElasticsearchAsync netcoreapp3.1 1.88μs 7.36ns 27.5ns 0.0123 0 0 912 B
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net472 3.18μs 15.2ns 58.8ns 0.168 0.00158 0 1.06 KB
master ExecuteAsync netcoreapp3.1 2.1μs 10.3ns 43.5ns 0.0143 0 0 1.03 KB
#2658 ExecuteAsync net472 3.25μs 15.1ns 56.4ns 0.167 0.00164 0 1.06 KB
#2658 ExecuteAsync netcoreapp3.1 2.19μs 9.68ns 34.9ns 0.0146 0 0 1.03 KB
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net472 7.15μs 31.8ns 123ns 0.36 0 0 2.28 KB
master SendAsync netcoreapp3.1 5.37μs 26ns 114ns 0.0314 0 0 2.21 KB
#2658 SendAsync net472 7.55μs 46ns 446ns 0.353 0 0 2.28 KB
#2658 SendAsync netcoreapp3.1 5.44μs 29.3ns 166ns 0.031 0 0 2.21 KB
Benchmarks.Trace.ILoggerBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #2658

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ILoggerBenchmark.EnrichedLog‑net472 1.455 3,631.25 5,283.58 bimodal

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net472 3.62μs 16.8ns 65.2ns 0.228 0 0 1.45 KB
master EnrichedLog netcoreapp3.1 3.32μs 18.9ns 135ns 0.0208 0 0 1.53 KB
#2658 EnrichedLog net472 4.99μs 85.1ns 851ns 0.227 0 0 1.45 KB
#2658 EnrichedLog netcoreapp3.1 3.45μs 32.6ns 297ns 0.0209 0 0 1.53 KB
Benchmarks.Trace.Log4netBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #2658

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Log4netBenchmark.EnrichedLog‑netcoreapp3.1 1.365 330,048.26 241,734.65

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net472 362μs 5.13μs 51.3μs 0.315 0.158 0 4.33 KB
master EnrichedLog netcoreapp3.1 330μs 833ns 3.23μs 0 0 0 4.21 KB
#2658 EnrichedLog net472 298μs 1.49μs 6.31μs 0.43 0.143 0 4.33 KB
#2658 EnrichedLog netcoreapp3.1 242μs 1.35μs 9.06μs 0 0 0 4.21 KB
Benchmarks.Trace.NLogBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #2658

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.NLogBenchmark.EnrichedLog‑net472 1.714 13,397.02 7,817.64

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net472 13.4μs 70.3ns 391ns 0.497 0 0 3.23 KB
master EnrichedLog netcoreapp3.1 6.6μs 34.1ns 156ns 0.0492 0 0 3.6 KB
#2658 EnrichedLog net472 7.84μs 18.4ns 66.3ns 0.506 0 0 3.23 KB
#2658 EnrichedLog netcoreapp3.1 6.4μs 24.4ns 145ns 0.0477 0 0 3.6 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 net472 2.45μs 8.64ns 33.4ns 0.16 0.00122 0 1.01 KB
master SendReceive netcoreapp3.1 2.13μs 5.36ns 20.1ns 0.0141 0 0 1.01 KB
#2658 SendReceive net472 2.33μs 8.73ns 32.7ns 0.16 0.00117 0 1.01 KB
#2658 SendReceive netcoreapp3.1 1.97μs 7.97ns 28.7ns 0.0138 0 0 1.01 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 net472 6.17μs 24.4ns 91.3ns 0.292 0 0 1.87 KB
master EnrichedLog netcoreapp3.1 5.26μs 25.3ns 110ns 0.0207 0 0 1.49 KB
#2658 EnrichedLog net472 5.9μs 17.7ns 61.3ns 0.292 0 0 1.87 KB
#2658 EnrichedLog netcoreapp3.1 5.07μs 14.1ns 54.7ns 0.0199 0 0 1.49 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 net472 945ns 4.14ns 17.1ns 0.0719 0 0 457 B
master StartFinishSpan netcoreapp3.1 917ns 5.13ns 32ns 0.00604 0 0 456 B
master StartFinishScope net472 1.22μs 7.13ns 65ns 0.0842 0 0 538 B
master StartFinishScope netcoreapp3.1 1.07μs 4.06ns 15.7ns 0.00815 0 0 576 B
#2658 StartFinishSpan net472 968ns 5.09ns 27.9ns 0.0716 0 0 457 B
#2658 StartFinishSpan netcoreapp3.1 879ns 3.3ns 12.4ns 0.00612 0 0 456 B
#2658 StartFinishScope net472 1.15μs 6.64ns 63.3ns 0.0844 0 0 538 B
#2658 StartFinishScope netcoreapp3.1 1.06μs 5.99ns 38.4ns 0.00789 0 0 576 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 net472 1.36μs 6.89ns 48.2ns 0.0839 0 0 538 B
master RunOnMethodBegin netcoreapp3.1 1.22μs 5.56ns 20.8ns 0.00774 0 0 576 B
#2658 RunOnMethodBegin net472 1.28μs 5.16ns 20ns 0.0842 0 0 538 B
#2658 RunOnMethodBegin netcoreapp3.1 1.16μs 6.36ns 36.5ns 0.00801 0 0 576 B

@andrewlock
andrewlock merged commit 3dcc9aa into master Apr 11, 2022
@andrewlock
andrewlock deleted the andrew/fix-regex branch April 11, 2022 08:36
@github-actions github-actions Bot added this to the vNext milestone Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants