Skip to content
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

[Profiler] Add metrics for cpu and walltime profilers #6267

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gleocadie
Copy link
Collaborator

@gleocadie gleocadie commented Nov 9, 2024

Summary of changes

Add metrics on signal-based profilers.

Reason for change

The goal is to provide visibility on discarded or failing at collecting samples for CPU and walltime profilers (signal-based profilers)

Implementation details

  • Add an enum DiscardReason which reflects the reason a sample could be discarded
  • Add a class DiscardMetrics which is partially templated on DiscardReason and encapsulates one metrics per enum item

Test coverage

Add unit tests.

Other details

@github-actions github-actions bot added the area:profiler Issues related to the continous-profiler label Nov 9, 2024
@andrewlock
Copy link
Member

andrewlock commented Nov 9, 2024

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 (6267) - mean (72ms)  : 64, 80
     .   : milestone, 72,
    master - mean (72ms)  : 64, 79
     .   : milestone, 72,

    section CallTarget+Inlining+NGEN
    This PR (6267) - mean (1,108ms)  : 1091, 1124
     .   : milestone, 1108,
    master - mean (1,110ms)  : 1096, 1125
     .   : milestone, 1110,

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

    section CallTarget+Inlining+NGEN
    This PR (6267) - mean (768ms)  : 756, 780
     .   : milestone, 768,
    master - mean (775ms)  : 757, 793
     .   : milestone, 775,

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

    section CallTarget+Inlining+NGEN
    This PR (6267) - mean (719ms)  : 704, 734
     .   : milestone, 719,
    master - mean (724ms)  : 711, 736
     .   : milestone, 724,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6267) - mean (191ms)  : 185, 197
     .   : milestone, 191,
    master - mean (191ms)  : 185, 197
     .   : milestone, 191,

    section CallTarget+Inlining+NGEN
    This PR (6267) - mean (1,225ms)  : 1204, 1246
     .   : milestone, 1225,
    master - mean (1,231ms)  : 1206, 1255
     .   : milestone, 1231,

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

    section CallTarget+Inlining+NGEN
    This PR (6267) - mean (942ms)  : 926, 958
     .   : milestone, 942,
    master - mean (948ms)  : 927, 968
     .   : milestone, 948,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6267) - mean (265ms)  : 260, 270
     .   : milestone, 265,
    master - mean (264ms)  : 261, 268
     .   : milestone, 264,

    section CallTarget+Inlining+NGEN
    This PR (6267) - mean (924ms)  : 906, 942
     .   : milestone, 924,
    master - mean (926ms)  : 909, 943
     .   : milestone, 926,

Loading

@andrewlock
Copy link
Member

andrewlock commented Nov 9, 2024

Throughput/Crank Report ⚡

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 (6267) (11.132M)   : 0, 11131982
    master (11.082M)   : 0, 11082495
    benchmarks/2.9.0 (11.033M)   : 0, 11032866

    section Automatic
    This PR (6267) (7.374M)   : 0, 7373818
    master (7.157M)   : 0, 7156676
    benchmarks/2.9.0 (7.786M)   : 0, 7785853

    section Trace stats
    master (7.487M)   : 0, 7486935

    section Manual
    master (11.095M)   : 0, 11094549

    section Manual + Automatic
    This PR (6267) (6.730M)   : 0, 6729982
    master (6.662M)   : 0, 6661600

    section DD_TRACE_ENABLED=0
    master (10.306M)   : 0, 10305980

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6267) (9.587M)   : 0, 9587137
    master (9.147M)   : 0, 9147171
    benchmarks/2.9.0 (9.495M)   : 0, 9494821

    section Automatic
    This PR (6267) (6.548M)   : 0, 6547861
    master (6.241M)   : 0, 6240685

    section Trace stats
    master (6.456M)   : 0, 6455873

    section Manual
    master (9.565M)   : 0, 9564721

    section Manual + Automatic
    This PR (6267) (5.981M)   : 0, 5980919
    master (6.070M)   : 0, 6069625

    section DD_TRACE_ENABLED=0
    master (8.975M)   : 0, 8975239

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6267) (9.488M)   : 0, 9488457
    master (9.861M)   : 0, 9860504
    benchmarks/2.9.0 (10.020M)   : 0, 10019592

    section Automatic
    This PR (6267) (5.928M)   : crit ,0, 5928023
    master (6.281M)   : 0, 6280856
    benchmarks/2.9.0 (7.255M)   : 0, 7255257

    section Trace stats
    master (6.858M)   : 0, 6857519

    section Manual
    master (9.497M)   : 0, 9496807

    section Manual + Automatic
    This PR (6267) (5.797M)   : 0, 5797180
    master (5.679M)   : 0, 5679163

    section DD_TRACE_ENABLED=0
    master (8.903M)   : 0, 8902951

Loading

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Nov 9, 2024

Datadog Report

Branch report: gleocadie/add-metrics-on-signal-handler-backoff-reason
Commit report: 0b97be0
Test service: dd-trace-dotnet

✅ 0 Failed, 72439 Passed, 187 Skipped, 1h 7m 23.06s Total Time

@andrewlock
Copy link
Member

andrewlock commented Nov 9, 2024

Benchmarks Report for tracer 🐌

Benchmarks for #6267 compared to master:

  • 2 benchmarks are slower, with geometric mean 1.144
  • 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 8.05μs 43.6ns 235ns 0.0158 0.00792 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10.1μs 54.9ns 296ns 0.021 0.0105 0 5.8 KB
master StartStopWithChild net472 16.4μs 43.9ns 170ns 1.03 0.303 0.0901 6.22 KB
#6267 StartStopWithChild net6.0 8.05μs 44.9ns 311ns 0.0194 0.00777 0 5.61 KB
#6267 StartStopWithChild netcoreapp3.1 10μs 53.5ns 273ns 0.0239 0.00955 0 5.8 KB
#6267 StartStopWithChild net472 16.4μs 38.1ns 148ns 1.04 0.31 0.0897 6.21 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 486μs 222ns 799ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 646μs 247ns 955ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 843μs 580ns 2.25μs 0.419 0 0 3.3 KB
#6267 WriteAndFlushEnrichedTraces net6.0 480μs 1.83μs 9.34μs 0 0 0 2.7 KB
#6267 WriteAndFlushEnrichedTraces netcoreapp3.1 667μs 2.38μs 9.22μs 0 0 0 2.7 KB
#6267 WriteAndFlushEnrichedTraces net472 893μs 4.76μs 24.3μs 0.446 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 198μs 1.16μs 10.9μs 0.2 0 0 18.73 KB
master SendRequest netcoreapp3.1 229μs 1.42μs 14μs 0.206 0 0 20.89 KB
master SendRequest net472 8.3E‑05ns 6.89E‑05ns 0.000248ns 0 0 0 0 b
#6267 SendRequest net6.0 191μs 764ns 2.75μs 0.209 0 0 18.73 KB
#6267 SendRequest netcoreapp3.1 215μs 1.15μs 6.21μs 0.23 0 0 20.89 KB
#6267 SendRequest net472 0.000178ns 0.000108ns 0.000404ns 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 602μs 3.43μs 30.9μs 0.558 0 0 41.82 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 676μs 3.26μs 12.6μs 0.349 0 0 41.78 KB
master WriteAndFlushEnrichedTraces net472 867μs 3.74μs 14.5μs 8.25 2.6 0.434 53.27 KB
#6267 WriteAndFlushEnrichedTraces net6.0 595μs 2.87μs 12.5μs 0.566 0 0 41.62 KB
#6267 WriteAndFlushEnrichedTraces netcoreapp3.1 679μs 3.54μs 16.6μs 0.343 0 0 41.67 KB
#6267 WriteAndFlushEnrichedTraces net472 878μs 3.96μs 15.4μs 8.45 2.53 0.422 53.29 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.23μs 1.52ns 5.87ns 0.0145 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.77μs 0.875ns 3.27ns 0.0133 0 0 1.02 KB
master ExecuteNonQuery net472 2.11μs 1.33ns 4.97ns 0.156 0.00106 0 987 B
#6267 ExecuteNonQuery net6.0 1.23μs 0.772ns 2.89ns 0.0143 0 0 1.02 KB
#6267 ExecuteNonQuery netcoreapp3.1 1.76μs 0.919ns 3.56ns 0.0142 0 0 1.02 KB
#6267 ExecuteNonQuery net472 2.02μs 2.53ns 9.81ns 0.156 0.00101 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.23μs 0.403ns 1.51ns 0.0136 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.55μs 0.864ns 3.35ns 0.0131 0 0 976 B
master CallElasticsearch net472 2.48μs 2.6ns 10.1ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.24μs 0.543ns 2.1ns 0.013 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.6μs 0.683ns 2.55ns 0.0137 0 0 1.02 KB
master CallElasticsearchAsync net472 2.61μs 2.81ns 10.9ns 0.167 0 0 1.05 KB
#6267 CallElasticsearch net6.0 1.31μs 2.44ns 9.14ns 0.0137 0 0 976 B
#6267 CallElasticsearch netcoreapp3.1 1.52μs 3.04ns 11.4ns 0.0131 0 0 976 B
#6267 CallElasticsearch net472 2.5μs 2.95ns 11.4ns 0.158 0 0 995 B
#6267 CallElasticsearchAsync net6.0 1.26μs 1.25ns 4.84ns 0.0133 0 0 952 B
#6267 CallElasticsearchAsync netcoreapp3.1 1.65μs 0.684ns 2.56ns 0.0141 0 0 1.02 KB
#6267 CallElasticsearchAsync net472 2.62μs 1.94ns 7.5ns 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.29μs 0.685ns 2.56ns 0.0135 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.67μs 1.73ns 6.47ns 0.0125 0 0 952 B
master ExecuteAsync net472 1.84μs 0.699ns 2.61ns 0.145 0 0 915 B
#6267 ExecuteAsync net6.0 1.24μs 0.296ns 1.11ns 0.0131 0 0 952 B
#6267 ExecuteAsync netcoreapp3.1 1.54μs 1.92ns 7.43ns 0.0124 0 0 952 B
#6267 ExecuteAsync net472 1.85μs 1.04ns 4.05ns 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.46μs 1.22ns 4.57ns 0.0313 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.2μs 1.63ns 6.3ns 0.039 0 0 2.85 KB
master SendAsync net472 7.52μs 2.64ns 10.2ns 0.495 0 0 3.12 KB
#6267 SendAsync net6.0 4.39μs 2.46ns 9.19ns 0.0328 0 0 2.31 KB
#6267 SendAsync netcoreapp3.1 5.33μs 1.96ns 7.34ns 0.0375 0 0 2.85 KB
#6267 SendAsync net472 7.66μs 1.86ns 7.2ns 0.494 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.48μs 1ns 3.76ns 0.0231 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.32μs 1.88ns 7.05ns 0.022 0 0 1.64 KB
master EnrichedLog net472 2.64μs 2ns 7.74ns 0.249 0 0 1.57 KB
#6267 EnrichedLog net6.0 1.5μs 0.94ns 3.64ns 0.0231 0 0 1.64 KB
#6267 EnrichedLog netcoreapp3.1 2.29μs 2.68ns 10.4ns 0.0216 0 0 1.64 KB
#6267 EnrichedLog net472 2.7μs 1.55ns 5.57ns 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 119μs 95.3ns 369ns 0.0594 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 122μs 175ns 632ns 0 0 0 4.28 KB
master EnrichedLog net472 154μs 177ns 685ns 0.688 0.229 0 4.46 KB
#6267 EnrichedLog net6.0 120μs 157ns 607ns 0.0604 0 0 4.28 KB
#6267 EnrichedLog netcoreapp3.1 125μs 282ns 1.09μs 0 0 0 4.28 KB
#6267 EnrichedLog net472 153μs 138ns 499ns 0.701 0.234 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.04μs 13.8ns 55.2ns 0.0302 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.23μs 3.92ns 15.2ns 0.0295 0 0 2.2 KB
master EnrichedLog net472 4.91μs 1.62ns 6.27ns 0.32 0 0 2.02 KB
#6267 EnrichedLog net6.0 3.11μs 1.2ns 4.63ns 0.0312 0 0 2.2 KB
#6267 EnrichedLog netcoreapp3.1 4.11μs 0.802ns 2.78ns 0.0288 0 0 2.2 KB
#6267 EnrichedLog net472 4.62μs 1.6ns 6.2ns 0.32 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.45μs 0.771ns 2.99ns 0.0159 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.78μs 0.775ns 3ns 0.0151 0 0 1.14 KB
master SendReceive net472 2.17μs 4.16ns 16.1ns 0.183 0 0 1.16 KB
#6267 SendReceive net6.0 1.37μs 0.96ns 3.72ns 0.0158 0 0 1.14 KB
#6267 SendReceive netcoreapp3.1 1.86μs 0.514ns 1.99ns 0.0158 0 0 1.14 KB
#6267 SendReceive net472 2.15μs 0.933ns 3.61ns 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.8μs 1.58ns 5.9ns 0.0224 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.9μs 2.96ns 11.5ns 0.0214 0 0 1.65 KB
master EnrichedLog net472 4.39μs 2.57ns 9.96ns 0.323 0 0 2.04 KB
#6267 EnrichedLog net6.0 2.75μs 0.939ns 3.51ns 0.0221 0 0 1.6 KB
#6267 EnrichedLog netcoreapp3.1 4.03μs 1.07ns 3.86ns 0.0221 0 0 1.65 KB
#6267 EnrichedLog net472 4.45μs 2.72ns 10.5ns 0.323 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6267

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 1.172 491.41 576.03
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.116 405.27 452.45

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 406ns 0.284ns 1.1ns 0.00803 0 0 576 B
master StartFinishSpan netcoreapp3.1 640ns 0.846ns 3.28ns 0.00779 0 0 576 B
master StartFinishSpan net472 733ns 0.76ns 2.63ns 0.0916 0 0 578 B
master StartFinishScope net6.0 492ns 0.575ns 2.07ns 0.00976 0 0 696 B
master StartFinishScope netcoreapp3.1 736ns 0.596ns 2.31ns 0.00911 0 0 696 B
master StartFinishScope net472 873ns 1.52ns 5.48ns 0.104 0 0 658 B
#6267 StartFinishSpan net6.0 452ns 0.572ns 2.21ns 0.00799 0 0 576 B
#6267 StartFinishSpan netcoreapp3.1 597ns 0.538ns 2.09ns 0.00777 0 0 576 B
#6267 StartFinishSpan net472 729ns 0.998ns 3.87ns 0.0915 0 0 578 B
#6267 StartFinishScope net6.0 576ns 0.446ns 1.67ns 0.00959 0 0 696 B
#6267 StartFinishScope netcoreapp3.1 802ns 0.864ns 3.35ns 0.00945 0 0 696 B
#6267 StartFinishScope net472 874ns 2.08ns 8.05ns 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 600ns 0.444ns 1.72ns 0.00965 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 954ns 1.8ns 6.98ns 0.00911 0 0 696 B
master RunOnMethodBegin net472 1.12μs 0.714ns 2.76ns 0.104 0 0 658 B
#6267 RunOnMethodBegin net6.0 647ns 0.395ns 1.48ns 0.00973 0 0 696 B
#6267 RunOnMethodBegin netcoreapp3.1 914ns 0.78ns 3.02ns 0.00917 0 0 696 B
#6267 RunOnMethodBegin net472 1.14μs 0.953ns 3.69ns 0.104 0 0 658 B

@gleocadie gleocadie force-pushed the gleocadie/add-metrics-on-signal-handler-backoff-reason branch from 921e600 to 43d067b Compare November 12, 2024 08:41
@gleocadie gleocadie force-pushed the gleocadie/add-metrics-on-signal-handler-backoff-reason branch from 43d067b to e729025 Compare November 13, 2024 10:06
@gleocadie gleocadie marked this pull request as ready for review November 13, 2024 10:14
@gleocadie gleocadie requested a review from a team as a code owner November 13, 2024 10:14
@gleocadie gleocadie force-pushed the gleocadie/add-metrics-on-signal-handler-backoff-reason branch from 732a203 to 988a478 Compare November 13, 2024 10:35
@gleocadie gleocadie force-pushed the gleocadie/add-metrics-on-signal-handler-backoff-reason branch from 988a478 to 574a8d3 Compare November 13, 2024 11:16

// For now have one metric for both walltime and cpu (naive)
_samplingRequest = metricsRegistry.GetOrRegister<CounterMetric>("dotnet_walltime_cpu_sampling_requests");
_discardMetrics = metricsRegistry.GetOrRegister<DiscardMetrics>("dotnet_walltime_cpu_sample_discard");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_discardMetrics = metricsRegistry.GetOrRegister<DiscardMetrics>("dotnet_walltime_cpu_sample_discard");
_discardMetrics = metricsRegistry.GetOrRegister<DiscardMetrics>("dotnet_walltime_cpu_sample_discarded");

@@ -32,6 +34,8 @@ TimerCreateCpuProfiler::TimerCreateCpuProfiler(
{
Log::Info("Cpu profiling interval: ", _samplingInterval.count(), "ms");
Log::Info("timer_create Cpu profiler is enabled");
_totalSampling = metricsRegistry.GetOrRegister<CounterMetric>("dotnet_cpu_sampling_requests");
_discardMetrics = metricsRegistry.GetOrRegister<DiscardMetrics>("dotnet_cpu_sample_discard");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_discardMetrics = metricsRegistry.GetOrRegister<DiscardMetrics>("dotnet_cpu_sample_discard");
_discardMetrics = metricsRegistry.GetOrRegister<DiscardMetrics>("dotnet_cpu_sample_discarded");

Copy link
Contributor

@chrisnas chrisnas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:profiler Issues related to the continous-profiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants