-
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
[Profiler] Add metrics for cpu and walltime profilers #6267
base: master
Are you sure you want to change the base?
[Profiler] Add metrics for cpu and walltime profilers #6267
Conversation
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 (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,
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,
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,
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,
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,
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,
|
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
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
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
|
Datadog ReportBranch report: ✅ 0 Failed, 72439 Passed, 187 Skipped, 1h 7m 23.06s Total Time |
Benchmarks Report for tracer 🐌Benchmarks for #6267 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 - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SpanBenchmark - Slower
|
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 |
921e600
to
43d067b
Compare
43d067b
to
e729025
Compare
732a203
to
988a478
Compare
988a478
to
574a8d3
Compare
|
||
// 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"); |
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.
_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"); |
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.
_discardMetrics = metricsRegistry.GetOrRegister<DiscardMetrics>("dotnet_cpu_sample_discard"); | |
_discardMetrics = metricsRegistry.GetOrRegister<DiscardMetrics>("dotnet_cpu_sample_discarded"); |
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.
LGTM
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
DiscardReason
which reflects the reason a sample could be discardedDiscardMetrics
which is partially templated onDiscardReason
and encapsulates one metrics per enum itemTest coverage
Add unit tests.
Other details