dd-trace-dotnet icon indicating copy to clipboard operation
dd-trace-dotnet copied to clipboard

[Dynamic Instrumentation] DEBUG-2323 Add support for `typeof` expression in EL

Open dudikeleti opened this issue 1 year ago • 5 comments

Summary of changes

Add the support to use typeof(val). This will return the full name of the variable type.

Test coverage

See tests in this PR

dudikeleti avatar May 07 '24 16:05 dudikeleti

Datadog Report

Branch report: dudik/el-typeof Commit report: dfe90b6 Test service: dd-trace-dotnet

:white_check_mark: 0 Failed, 297628 Passed, 1900 Skipped, 21h 20m 33.41s Total Time

datadog-ddstaging[bot] avatar May 07 '24 16:05 datadog-ddstaging[bot]

Execution-Time Benchmarks Report :stopwatch:

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 (5539) - mean (73ms)  : 68, 78
     .   : milestone, 73,
    master - mean (70ms)  : 67, 74
     .   : milestone, 70,

    section CallTarget+Inlining+NGEN
    This PR (5539) - mean (1,083ms)  : 1057, 1109
     .   : milestone, 1083,
    master - mean (1,083ms)  : 1051, 1116
     .   : milestone, 1083,

gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5539) - mean (110ms)  : 106, 113
     .   : milestone, 110,
    master - mean (109ms)  : 107, 111
     .   : milestone, 109,

    section CallTarget+Inlining+NGEN
    This PR (5539) - mean (755ms)  : 729, 781
     .   : milestone, 755,
    master - mean (750ms)  : 733, 766
     .   : milestone, 750,

gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5539) - mean (93ms)  : 90, 97
     .   : milestone, 93,
    master - mean (94ms)  : 90, 98
     .   : milestone, 94,

    section CallTarget+Inlining+NGEN
    This PR (5539) - mean (717ms)  : 667, 766
     .   : milestone, 717,
    master - mean (699ms)  : 682, 716
     .   : milestone, 699,

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

    section CallTarget+Inlining+NGEN
    This PR (5539) - mean (1,157ms)  : 1138, 1176
     .   : milestone, 1157,
    master - mean (1,159ms)  : 1134, 1184
     .   : milestone, 1159,

gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5539) - mean (275ms)  : 270, 280
     .   : milestone, 275,
    master - mean (276ms)  : 271, 282
     .   : milestone, 276,

    section CallTarget+Inlining+NGEN
    This PR (5539) - mean (920ms)  : 893, 946
     .   : milestone, 920,
    master - mean (917ms)  : 899, 936
     .   : milestone, 917,

gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5539) - mean (266ms)  : 261, 270
     .   : milestone, 266,
    master - mean (264ms)  : 259, 269
     .   : milestone, 264,

    section CallTarget+Inlining+NGEN
    This PR (5539) - mean (901ms)  : 879, 923
     .   : milestone, 901,
    master - mean (897ms)  : 879, 916
     .   : milestone, 897,

andrewlock avatar May 07 '24 16:05 andrewlock

Benchmarks Report for tracer :snail:

Benchmarks for #5539 compared to master:

  • 1 benchmarks are slower, with geometric mean 1.138
  • 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 :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 7.52μs 41.3ns 261ns 0.0189 0.00755 0 5.43 KB
master StartStopWithChild netcoreapp3.1 9.96μs 53.9ns 290ns 0.0196 0.00978 0 5.61 KB
master StartStopWithChild net472 16.1μs 44.4ns 172ns 1.01 0.291 0.0889 6.07 KB
#5539 StartStopWithChild net6.0 7.8μs 43ns 269ns 0.0158 0.00395 0 5.43 KB
#5539 StartStopWithChild netcoreapp3.1 10.2μs 54.3ns 321ns 0.0203 0.0101 0 5.62 KB
#5539 StartStopWithChild net472 16.1μs 56.5ns 219ns 1.02 0.309 0.0976 6.07 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 473μs 129ns 484ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 628μs 211ns 789ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 853μs 365ns 1.41μs 0.425 0 0 3.3 KB
#5539 WriteAndFlushEnrichedTraces net6.0 467μs 257ns 995ns 0 0 0 2.7 KB
#5539 WriteAndFlushEnrichedTraces netcoreapp3.1 635μs 332ns 1.29μs 0 0 0 2.7 KB
#5539 WriteAndFlushEnrichedTraces net472 839μs 475ns 1.84μs 0.417 0 0 3.3 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 193μs 1.09μs 7.24μs 0.183 0 0 18.45 KB
master SendRequest netcoreapp3.1 214μs 1.21μs 8.81μs 0.2 0 0 20.61 KB
master SendRequest net472 5.87E‑05ns 5.87E‑05ns 0.000212ns 0 0 0 0 b
#5539 SendRequest net6.0 192μs 940ns 6.09μs 0.203 0 0 18.45 KB
#5539 SendRequest netcoreapp3.1 210μs 1.15μs 7.08μs 0.208 0 0 20.61 KB
#5539 SendRequest net472 0.000857ns 0.000358ns 0.00134ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 548μs 1.6μs 5.99μs 0.561 0 0 41.59 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 689μs 3.79μs 22.4μs 0.34 0 0 41.71 KB
master WriteAndFlushEnrichedTraces net472 868μs 3.25μs 11.7μs 8.3 2.62 0.437 53.3 KB
#5539 WriteAndFlushEnrichedTraces net6.0 566μs 1.65μs 5.97μs 0.563 0 0 41.59 KB
#5539 WriteAndFlushEnrichedTraces netcoreapp3.1 662μs 2.33μs 8.73μs 0.334 0 0 41.83 KB
#5539 WriteAndFlushEnrichedTraces net472 847μs 3.31μs 12.4μs 8.39 2.52 0.419 53.29 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.28μs 1.48ns 5.72ns 0.0142 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.72μs 1.54ns 5.98ns 0.0136 0 0 1.02 KB
master ExecuteNonQuery net472 1.98μs 1.53ns 5.94ns 0.156 0 0 987 B
#5539 ExecuteNonQuery net6.0 1.18μs 1.17ns 4.52ns 0.0142 0 0 1.02 KB
#5539 ExecuteNonQuery netcoreapp3.1 1.74μs 1.06ns 4.09ns 0.0133 0 0 1.02 KB
#5539 ExecuteNonQuery net472 1.95μs 1.84ns 6.89ns 0.157 0 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.22μs 0.885ns 3.31ns 0.0134 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.54μs 1.19ns 4.46ns 0.0133 0 0 976 B
master CallElasticsearch net472 2.51μs 9.7ns 36.3ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.33μs 0.986ns 3.69ns 0.0133 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.68μs 0.944ns 3.53ns 0.0137 0 0 1.02 KB
master CallElasticsearchAsync net472 2.6μs 4.59ns 17.8ns 0.166 0 0 1.05 KB
#5539 CallElasticsearch net6.0 1.32μs 0.93ns 3.6ns 0.0137 0 0 976 B
#5539 CallElasticsearch netcoreapp3.1 1.61μs 0.962ns 3.6ns 0.0131 0 0 976 B
#5539 CallElasticsearch net472 2.55μs 1.85ns 7.16ns 0.158 0 0 995 B
#5539 CallElasticsearchAsync net6.0 1.31μs 0.472ns 1.83ns 0.0131 0 0 952 B
#5539 CallElasticsearchAsync netcoreapp3.1 1.63μs 1.34ns 5.01ns 0.0139 0 0 1.02 KB
#5539 CallElasticsearchAsync net472 2.52μs 1.35ns 4.86ns 0.166 0 0 1.05 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.34μs 0.737ns 2.85ns 0.0134 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.72μs 0.568ns 2.12ns 0.0129 0 0 952 B
master ExecuteAsync net472 1.75μs 1.31ns 4.89ns 0.145 0 0 915 B
#5539 ExecuteAsync net6.0 1.33μs 1.37ns 5.29ns 0.0134 0 0 952 B
#5539 ExecuteAsync netcoreapp3.1 1.67μs 0.776ns 2.9ns 0.0125 0 0 952 B
#5539 ExecuteAsync net472 1.78μs 0.669ns 2.59ns 0.145 0 0 915 B
Benchmarks.Trace.HttpClientBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 4.34μs 2.45ns 9.5ns 0.0304 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.1μs 2.27ns 8.48ns 0.038 0 0 2.76 KB
master SendAsync net472 7.86μs 1.64ns 6.14ns 0.5 0 0 3.15 KB
#5539 SendAsync net6.0 4.27μs 2.01ns 7.26ns 0.0301 0 0 2.22 KB
#5539 SendAsync netcoreapp3.1 5.04μs 1.53ns 5.93ns 0.0378 0 0 2.76 KB
#5539 SendAsync net472 7.76μs 1.86ns 6.95ns 0.497 0 0 3.15 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.47μs 0.572ns 2.14ns 0.0228 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.42μs 1.18ns 4.56ns 0.0216 0 0 1.64 KB
master EnrichedLog net472 2.69μs 1.14ns 4.4ns 0.249 0 0 1.57 KB
#5539 EnrichedLog net6.0 1.46μs 0.706ns 2.64ns 0.0234 0 0 1.64 KB
#5539 EnrichedLog netcoreapp3.1 2.31μs 4.26ns 15.9ns 0.0215 0 0 1.64 KB
#5539 EnrichedLog net472 2.71μs 1.2ns 4.49ns 0.249 0 0 1.57 KB
Benchmarks.Trace.Log4netBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 117μs 231ns 894ns 0.0579 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 121μs 318ns 1.19μs 0 0 0 4.28 KB
master EnrichedLog net472 151μs 252ns 976ns 0.676 0.225 0 4.46 KB
#5539 EnrichedLog net6.0 115μs 222ns 860ns 0.0575 0 0 4.28 KB
#5539 EnrichedLog netcoreapp3.1 122μs 276ns 1.07μs 0 0 0 4.28 KB
#5539 EnrichedLog net472 150μs 210ns 813ns 0.668 0.223 0 4.46 KB
Benchmarks.Trace.NLogBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 3.15μs 0.726ns 2.81ns 0.0307 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.21μs 1.27ns 4.92ns 0.0296 0 0 2.2 KB
master EnrichedLog net472 4.92μs 1.4ns 5.44ns 0.32 0 0 2.02 KB
#5539 EnrichedLog net6.0 3.07μs 0.762ns 2.75ns 0.0308 0 0 2.2 KB
#5539 EnrichedLog netcoreapp3.1 4.17μs 2.15ns 8.03ns 0.029 0 0 2.2 KB
#5539 EnrichedLog net472 4.87μs 1.34ns 5.19ns 0.32 0 0 2.02 KB
Benchmarks.Trace.RedisBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.35μs 0.913ns 3.54ns 0.0156 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.85μs 1.21ns 4.67ns 0.0156 0 0 1.14 KB
master SendReceive net472 2.18μs 1.75ns 6.79ns 0.183 0 0 1.16 KB
#5539 SendReceive net6.0 1.27μs 0.434ns 1.62ns 0.0159 0 0 1.14 KB
#5539 SendReceive netcoreapp3.1 1.79μs 1.29ns 4.98ns 0.0155 0 0 1.14 KB
#5539 SendReceive net472 2.12μs 1.4ns 5.23ns 0.183 0.00106 0 1.16 KB
Benchmarks.Trace.SerilogBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.86μs 0.697ns 2.61ns 0.0215 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.77μs 1.42ns 5.3ns 0.0207 0 0 1.65 KB
master EnrichedLog net472 4.5μs 3.2ns 12.4ns 0.322 0 0 2.04 KB
#5539 EnrichedLog net6.0 2.84μs 0.776ns 3ns 0.0226 0 0 1.6 KB
#5539 EnrichedLog netcoreapp3.1 3.84μs 3.83ns 14.8ns 0.0213 0 0 1.65 KB
#5539 EnrichedLog net472 4.45μs 2.41ns 9.35ns 0.322 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower :warning: Same allocations :heavy_check_mark:

Slower :warning: in #5539

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 1.138 494.76 563.25

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 399ns 0.0943ns 0.34ns 0.00803 0 0 576 B
master StartFinishSpan netcoreapp3.1 557ns 1.16ns 4.49ns 0.00796 0 0 576 B
master StartFinishSpan net472 635ns 0.427ns 1.65ns 0.0915 0 0 578 B
master StartFinishScope net6.0 493ns 1.19ns 4.62ns 0.00964 0 0 696 B
master StartFinishScope netcoreapp3.1 748ns 0.514ns 1.99ns 0.0094 0 0 696 B
master StartFinishScope net472 888ns 2.64ns 10.2ns 0.104 0 0 658 B
#5539 StartFinishSpan net6.0 401ns 0.91ns 3.52ns 0.00811 0 0 576 B
#5539 StartFinishSpan netcoreapp3.1 579ns 1.75ns 6.79ns 0.00773 0 0 576 B
#5539 StartFinishSpan net472 639ns 0.318ns 1.23ns 0.0916 0 0 578 B
#5539 StartFinishScope net6.0 563ns 0.233ns 0.903ns 0.00964 0 0 696 B
#5539 StartFinishScope netcoreapp3.1 795ns 1.06ns 3.96ns 0.00956 0 0 696 B
#5539 StartFinishScope net472 941ns 1.04ns 4.04ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 595ns 0.204ns 0.765ns 0.00967 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 966ns 0.499ns 1.93ns 0.00923 0 0 696 B
master RunOnMethodBegin net472 1.11μs 0.454ns 1.57ns 0.104 0 0 658 B
#5539 RunOnMethodBegin net6.0 605ns 0.449ns 1.74ns 0.00969 0 0 696 B
#5539 RunOnMethodBegin netcoreapp3.1 990ns 0.974ns 3.77ns 0.00946 0 0 696 B
#5539 RunOnMethodBegin net472 1.07μs 1.22ns 4.71ns 0.104 0 0 658 B

andrewlock avatar May 07 '24 16:05 andrewlock

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 (5539) (7.646M)   : 0, 7646327
    master (11.626M)   : 0, 11625669
    benchmarks/2.9.0 (11.606M)   : 0, 11605731

    section Automatic
    This PR (5539) (7.836M)   : 0, 7835582
    master (7.741M)   : 0, 7740587
    benchmarks/2.9.0 (8.043M)   : 0, 8042658

    section Trace stats
    master (8.083M)   : 0, 8082727

    section Manual
    master (11.551M)   : 0, 11551010

    section Manual + Automatic
    This PR (5539) (7.207M)   : 0, 7207226
    master (7.207M)   : 0, 7206578

    section DD_TRACE_ENABLED=0
    master (10.731M)   : 0, 10731443

gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5539) (9.502M)   : 0, 9501770

    section Automatic
    This PR (5539) (6.692M)   : 0, 6691853

    section Manual + Automatic
    This PR (5539) (6.156M)   : 0, 6156120

gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5539) (10.129M)   : 0, 10129288
    benchmarks/2.9.0 (10.148M)   : 0, 10147897

    section Automatic
    This PR (5539) (6.591M)   : 0, 6591255
    benchmarks/2.9.0 (7.517M)   : 0, 7517128

    section Manual + Automatic
    This PR (5539) (6.111M)   : 0, 6110565

andrewlock avatar May 07 '24 17:05 andrewlock

Datadog Report

Branch report: dudik/el-typeof Commit report: 3843b26 Test service: dd-trace-dotnet

:white_check_mark: 0 Failed, 275397 Passed, 2068 Skipped, 21h 55m 43.53s Total Time :snowflake: 1 New Flaky

New Flaky Tests (1)

  • TestTemplates - Datadog.Trace.Tests.Debugger.DebuggerExpressionLanguageTests - Last Failure

    Expand for error
    esults do not match.
    ifferences:
    eceived: DebuggerExpressionLanguageTests.TypeofString.received.txt
    erified: DebuggerExpressionLanguageTests.TypeofString.verified.txt
    eceived Content:
    emplate:
    egments: 
    
    
     "typeof": [
    ..
    

datadog-ddstaging[bot] avatar May 28 '24 15:05 datadog-ddstaging[bot]

Datadog Report

Branch report: dudik/el-typeof Commit report: ae715df Test service: dd-trace-dotnet

:white_check_mark: 0 Failed, 31508 Passed, 72 Skipped, 44m 15.46s Total Time

datadog-ddstaging[bot] avatar Jul 23 '24 11:07 datadog-ddstaging[bot]