Skip to content

[Debugger] Allow double interval for diagnostics uploads #6828

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shurivich
Copy link
Contributor

@shurivich shurivich commented Apr 7, 2025

Summary of Changes

Updated DiagnosticsIntervalSeconds to support double values instead of only integers.

Reason for Change

Allowing sub-second intervals can significantly improve system testing by enabling more frequent diagnostics. Rather than introducing a new variable or renaming the existing one, this change maintains compatibility while extending functionality in a simple and effective way.

Implementation details

Test coverage

Other details

@github-actions github-actions bot added area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) area:debugger labels Apr 7, 2025
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Apr 7, 2025

Datadog Report

All test runs bf88fdb 🔗

2 Total Test Services: 0 Failed, 2 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Test Service View
dd-trace-dotnet 0 0 0 253798 3473 34h 40m 14.99s Link
exploration_tests 0 0 0 22085 3 1h 25m 0.94s Link

@andrewlock
Copy link
Member

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:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

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 (6828) - mean (69ms)  : 66, 72
     .   : milestone, 69,
    master - mean (69ms)  : 67, 71
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (6828) - mean (1,008ms)  : 984, 1032
     .   : milestone, 1008,
    master - mean (1,005ms)  : 983, 1027
     .   : milestone, 1005,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6828) - mean (103ms)  : 101, 105
     .   : milestone, 103,
    master - mean (102ms)  : 100, 104
     .   : milestone, 102,

    section CallTarget+Inlining+NGEN
    This PR (6828) - mean (687ms)  : 671, 703
     .   : milestone, 687,
    master - mean (688ms)  : 670, 706
     .   : milestone, 688,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6828) - mean (90ms)  : 88, 92
     .   : milestone, 90,
    master - mean (89ms)  : 87, 92
     .   : milestone, 89,

    section CallTarget+Inlining+NGEN
    This PR (6828) - mean (646ms)  : 630, 663
     .   : milestone, 646,
    master - mean (644ms)  : 626, 661
     .   : milestone, 644,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6828) - mean (190ms)  : 186, 193
     .   : milestone, 190,
    master - mean (189ms)  : 186, 193
     .   : milestone, 189,

    section CallTarget+Inlining+NGEN
    This PR (6828) - mean (1,105ms)  : 1075, 1136
     .   : milestone, 1105,
    master - mean (1,104ms)  : 1077, 1130
     .   : milestone, 1104,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6828) - mean (269ms)  : 266, 272
     .   : milestone, 269,
    master - mean (268ms)  : 263, 272
     .   : milestone, 268,

    section CallTarget+Inlining+NGEN
    This PR (6828) - mean (873ms)  : 840, 907
     .   : milestone, 873,
    master - mean (873ms)  : 838, 908
     .   : milestone, 873,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6828) - mean (262ms)  : 257, 266
     .   : milestone, 262,
    master - mean (261ms)  : 258, 265
     .   : milestone, 261,

    section CallTarget+Inlining+NGEN
    This PR (6828) - mean (860ms)  : 827, 894
     .   : milestone, 860,
    master - mean (860ms)  : 826, 894
     .   : milestone, 860,

Loading

@shurivich shurivich self-assigned this Apr 8, 2025
@andrewlock
Copy link
Member

Benchmarks Report for tracer 🐌

Benchmarks for #6828 compared to master:

  • 4 benchmarks are faster, with geometric mean 1.177
  • 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.ActivityBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 7.79μs 43.2ns 266ns 0.0156 0.00389 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10.2μs 55.4ns 333ns 0.0294 0.0147 0 5.8 KB
master StartStopWithChild net472 16.2μs 44.5ns 172ns 1.06 0.325 0.106 6.21 KB
#6828 StartStopWithChild net6.0 8.33μs 47.5ns 343ns 0.0119 0.00795 0 5.61 KB
#6828 StartStopWithChild netcoreapp3.1 9.64μs 46.7ns 204ns 0.0238 0.00954 0 5.8 KB
#6828 StartStopWithChild net472 16.1μs 63.9ns 247ns 1.05 0.315 0.102 6.2 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 495μs 352ns 1.32μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 678μs 423ns 1.64μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 865μs 1.15μs 4.46μs 0.428 0 0 3.3 KB
#6828 WriteAndFlushEnrichedTraces net6.0 498μs 761ns 2.95μs 0 0 0 2.7 KB
#6828 WriteAndFlushEnrichedTraces netcoreapp3.1 643μs 455ns 1.76μs 0 0 0 2.7 KB
#6828 WriteAndFlushEnrichedTraces net472 861μs 970ns 3.76μs 0.431 0 0 3.3 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 net6.0 127μs 466ns 1.81μs 0.193 0 0 14.47 KB
master SendRequest netcoreapp3.1 148μs 226ns 874ns 0.222 0 0 17.27 KB
master SendRequest net472 0.000478ns 0.000296ns 0.00111ns 0 0 0 0 b
#6828 SendRequest net6.0 130μs 407ns 1.58μs 0.194 0 0 14.47 KB
#6828 SendRequest netcoreapp3.1 149μs 158ns 610ns 0.223 0 0 17.27 KB
#6828 SendRequest net472 0.000108ns 7.83E‑05ns 0.000303ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 588μs 3.24μs 25.9μs 0.604 0 0 41.6 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 718μs 4.13μs 34.3μs 0.336 0 0 41.79 KB
master WriteAndFlushEnrichedTraces net472 844μs 3μs 11.2μs 8.13 2.57 0.428 53.29 KB
#6828 WriteAndFlushEnrichedTraces net6.0 564μs 3.19μs 21.4μs 0.571 0 0 41.45 KB
#6828 WriteAndFlushEnrichedTraces netcoreapp3.1 749μs 4.38μs 39.7μs 0.347 0 0 41.78 KB
#6828 WriteAndFlushEnrichedTraces net472 873μs 4.52μs 21.7μs 8.56 2.57 0.428 53.32 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 net6.0 1.33μs 1.13ns 4.36ns 0.014 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.78μs 2.19ns 8.48ns 0.0133 0 0 1.02 KB
master ExecuteNonQuery net472 2.11μs 3.07ns 11.9ns 0.157 0.00105 0 987 B
#6828 ExecuteNonQuery net6.0 1.42μs 1.52ns 5.89ns 0.0142 0 0 1.02 KB
#6828 ExecuteNonQuery netcoreapp3.1 1.83μs 2.64ns 9.89ns 0.0138 0 0 1.02 KB
#6828 ExecuteNonQuery net472 2.08μs 3.27ns 12.7ns 0.156 0.00103 0 987 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.22μs 0.529ns 1.98ns 0.0133 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.64μs 0.798ns 3.09ns 0.0124 0 0 976 B
master CallElasticsearch net472 2.74μs 1.06ns 3.97ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.39μs 0.701ns 2.62ns 0.0133 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.64μs 0.725ns 2.71ns 0.0132 0 0 1.02 KB
master CallElasticsearchAsync net472 2.58μs 0.806ns 3.12ns 0.167 0 0 1.05 KB
#6828 CallElasticsearch net6.0 1.1μs 0.456ns 1.71ns 0.0138 0 0 976 B
#6828 CallElasticsearch netcoreapp3.1 1.66μs 0.546ns 2.12ns 0.0125 0 0 976 B
#6828 CallElasticsearch net472 2.62μs 1.5ns 5.8ns 0.158 0 0 995 B
#6828 CallElasticsearchAsync net6.0 1.37μs 0.394ns 1.47ns 0.0136 0 0 952 B
#6828 CallElasticsearchAsync netcoreapp3.1 1.68μs 0.964ns 3.73ns 0.0134 0 0 1.02 KB
#6828 CallElasticsearchAsync net472 2.66μs 1.19ns 4.62ns 0.166 0 0 1.05 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.659ns 2.46ns 0.0134 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.56μs 1.98ns 7.13ns 0.013 0 0 952 B
master ExecuteAsync net472 1.76μs 0.55ns 2.06ns 0.145 0 0 915 B
#6828 ExecuteAsync net6.0 1.21μs 0.653ns 2.44ns 0.0132 0 0 952 B
#6828 ExecuteAsync netcoreapp3.1 1.67μs 0.614ns 2.3ns 0.0127 0 0 952 B
#6828 ExecuteAsync net472 1.81μs 0.392ns 1.52ns 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.3μs 2.96ns 10.7ns 0.0322 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.41μs 3.58ns 13.9ns 0.0377 0 0 2.85 KB
master SendAsync net472 7.45μs 2.74ns 10.6ns 0.495 0 0 3.12 KB
#6828 SendAsync net6.0 4.29μs 0.827ns 3.09ns 0.0322 0 0 2.31 KB
#6828 SendAsync netcoreapp3.1 5.31μs 2.89ns 11.2ns 0.037 0 0 2.85 KB
#6828 SendAsync net472 7.43μs 1.99ns 7.72ns 0.496 0 0 3.12 KB
Benchmarks.Trace.ILoggerBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6828

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ILoggerBenchmark.EnrichedLog‑net6.0 1.194 1,777.42 1,488.02

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.78μs 1.56ns 5.39ns 0.023 0 0 1.69 KB
master EnrichedLog netcoreapp3.1 2.23μs 0.957ns 3.71ns 0.0224 0 0 1.69 KB
master EnrichedLog net472 2.67μs 1.67ns 6.47ns 0.257 0 0 1.62 KB
#6828 EnrichedLog net6.0 1.49μs 0.622ns 2.24ns 0.0239 0 0 1.69 KB
#6828 EnrichedLog netcoreapp3.1 2.36μs 2.15ns 8.03ns 0.0225 0 0 1.69 KB
#6828 EnrichedLog net472 2.54μs 1.79ns 6.93ns 0.258 0 0 1.62 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 112μs 133ns 516ns 0.0561 0 0 4.3 KB
master EnrichedLog netcoreapp3.1 118μs 160ns 618ns 0.0588 0 0 4.3 KB
master EnrichedLog net472 151μs 151ns 563ns 0.676 0.225 0 4.49 KB
#6828 EnrichedLog net6.0 112μs 171ns 664ns 0.056 0 0 4.3 KB
#6828 EnrichedLog netcoreapp3.1 118μs 152ns 588ns 0.0584 0 0 4.3 KB
#6828 EnrichedLog net472 150μs 136ns 525ns 0.673 0.224 0 4.49 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.13μs 1.31ns 4.88ns 0.0313 0 0 2.25 KB
master EnrichedLog netcoreapp3.1 4.33μs 1.27ns 4.93ns 0.0301 0 0 2.25 KB
master EnrichedLog net472 4.8μs 1.22ns 4.71ns 0.33 0 0 2.07 KB
#6828 EnrichedLog net6.0 3.21μs 0.817ns 3.16ns 0.0322 0 0 2.25 KB
#6828 EnrichedLog netcoreapp3.1 4.24μs 1.55ns 5.99ns 0.0297 0 0 2.25 KB
#6828 EnrichedLog net472 4.81μs 2.02ns 7.84ns 0.329 0 0 2.07 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.31μs 0.833ns 3.23ns 0.0157 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.9μs 3.1ns 12ns 0.016 0 0 1.14 KB
master SendReceive net472 2.08μs 0.643ns 2.32ns 0.183 0 0 1.16 KB
#6828 SendReceive net6.0 1.36μs 1.43ns 5.53ns 0.0162 0 0 1.14 KB
#6828 SendReceive netcoreapp3.1 1.79μs 1.89ns 7.32ns 0.015 0 0 1.14 KB
#6828 SendReceive net472 2.07μs 2.05ns 7.65ns 0.184 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.94μs 8.74ns 33.9ns 0.0218 0 0 1.62 KB
master EnrichedLog netcoreapp3.1 4.15μs 1.75ns 6.76ns 0.0208 0 0 1.67 KB
master EnrichedLog net472 4.49μs 1.72ns 6.65ns 0.328 0 0 2.07 KB
#6828 EnrichedLog net6.0 2.75μs 0.45ns 1.68ns 0.0219 0 0 1.62 KB
#6828 EnrichedLog netcoreapp3.1 3.92μs 1.07ns 4.15ns 0.0219 0 0 1.67 KB
#6828 EnrichedLog net472 4.52μs 1.58ns 6.11ns 0.328 0 0 2.07 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6828

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net472 1.113 906.34 814.41

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 460ns 0.288ns 1.11ns 0.00807 0 0 576 B
master StartFinishSpan netcoreapp3.1 645ns 0.454ns 1.7ns 0.00775 0 0 576 B
master StartFinishSpan net472 690ns 0.439ns 1.7ns 0.0916 0 0 578 B
master StartFinishScope net6.0 542ns 0.253ns 0.946ns 0.00972 0 0 696 B
master StartFinishScope netcoreapp3.1 684ns 0.379ns 1.47ns 0.00955 0 0 696 B
master StartFinishScope net472 907ns 0.319ns 1.24ns 0.104 0 0 658 B
#6828 StartFinishSpan net6.0 418ns 0.149ns 0.578ns 0.00815 0 0 576 B
#6828 StartFinishSpan netcoreapp3.1 641ns 1.15ns 4.46ns 0.00775 0 0 576 B
#6828 StartFinishSpan net472 690ns 0.697ns 2.7ns 0.0916 0 0 578 B
#6828 StartFinishScope net6.0 592ns 0.284ns 1.1ns 0.00988 0 0 696 B
#6828 StartFinishScope netcoreapp3.1 731ns 0.358ns 1.39ns 0.00945 0 0 696 B
#6828 StartFinishScope net472 815ns 0.486ns 1.88ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6828

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.297 776.10 598.52
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net472 1.115 1,150.95 1,032.46

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 776ns 0.275ns 1.06ns 0.00973 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 937ns 0.265ns 1.02ns 0.00909 0 0 696 B
master RunOnMethodBegin net472 1.15μs 0.607ns 2.35ns 0.104 0 0 658 B
#6828 RunOnMethodBegin net6.0 599ns 0.199ns 0.744ns 0.00983 0 0 696 B
#6828 RunOnMethodBegin netcoreapp3.1 932ns 1.56ns 5.85ns 0.00923 0 0 696 B
#6828 RunOnMethodBegin net472 1.03μs 0.174ns 0.602ns 0.104 0 0 658 B

@shurivich shurivich marked this pull request as ready for review April 8, 2025 12:28
@shurivich shurivich requested a review from a team as a code owner April 8, 2025 12:28
@shurivich shurivich marked this pull request as draft April 8, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:debugger 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