Add a Continuous Profiler availability check#7534
Conversation
There was a problem hiding this comment.
Codex Review: Here are some suggestions.
Reply with @codex fix comments to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
0944855 to
b17361c
Compare
chrisnas
left a comment
There was a problem hiding this comment.
LGTM with just a log level question
| // Now we're into fuzzy territory. The CP is not available in some environments | ||
| // - AWS Lambda | ||
| // - Azure Functions where the site extension is _not_ used | ||
| var isUnsupported = EnvironmentHelpers.IsAwsLambda() |
There was a problem hiding this comment.
is it ok if it tries logging here? as this ends up there
otherwise there's this beautiful solution 😅
There was a problem hiding this comment.
Yeah, I originally used your solution, but I can't use IsServerless() as it excludes too much. Also, this isn't used in the critical config loading paths, so I think it's ok for us to log if we have to 🙂
There was a problem hiding this comment.
ok :) also, you probably know already, FrameworkDescription has a static logger field 😅
b17361c to
6ff0c01
Compare
6ff0c01 to
f717f50
Compare
This comment has been minimized.
This comment has been minimized.
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.8)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7534) - mean (72ms) : 71, 73
. : milestone, 72,
master - mean (72ms) : 71, 73
. : milestone, 72,
section Baseline
This PR (7534) - mean (68ms) : 66, 70
. : milestone, 68,
master - mean (68ms) : 66, 70
. : milestone, 68,
section CallTarget+Inlining+NGEN
This PR (7534) - mean (1,001ms) : 977, 1026
. : milestone, 1001,
master - mean (1,003ms) : 980, 1026
. : milestone, 1003,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7534) - mean (106ms) : 105, 107
. : milestone, 106,
master - mean (106ms) : 105, 107
. : milestone, 106,
section Baseline
This PR (7534) - mean (105ms) : 103, 108
. : milestone, 105,
master - mean (105ms) : 103, 108
. : milestone, 105,
section CallTarget+Inlining+NGEN
This PR (7534) - mean (707ms) : 689, 724
. : milestone, 707,
master - mean (714ms) : 699, 729
. : milestone, 714,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7534) - mean (94ms) : 93, 95
. : milestone, 94,
master - mean (94ms) : 93, 95
. : milestone, 94,
section Baseline
This PR (7534) - mean (93ms) : 92, 95
. : milestone, 93,
master - mean (93ms) : 92, 95
. : milestone, 93,
section CallTarget+Inlining+NGEN
This PR (7534) - mean (663ms) : 648, 679
. : milestone, 663,
master - mean (669ms) : 656, 682
. : milestone, 669,
gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7534) - mean (93ms) : 92, 94
. : milestone, 93,
master - mean (93ms) : 92, 94
. : milestone, 93,
section Baseline
This PR (7534) - mean (92ms) : 89, 95
. : milestone, 92,
master - mean (92ms) : 90, 94
. : milestone, 92,
section CallTarget+Inlining+NGEN
This PR (7534) - mean (596ms) : 580, 612
. : milestone, 596,
master - mean (599ms) : 586, 612
. : milestone, 599,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7534) - mean (195ms) : 193, 198
. : milestone, 195,
master - mean (195ms) : 190, 200
. : milestone, 195,
section Baseline
This PR (7534) - mean (192ms) : 188, 195
. : milestone, 192,
master - mean (191ms) : 186, 195
. : milestone, 191,
section CallTarget+Inlining+NGEN
This PR (7534) - mean (1,110ms) : 1085, 1135
. : milestone, 1110,
master - mean (1,104ms) : 1071, 1138
. : milestone, 1104,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7534) - mean (277ms) : 273, 281
. : milestone, 277,
master - mean (274ms) : 269, 279
. : milestone, 274,
section Baseline
This PR (7534) - mean (275ms) : 271, 279
. : milestone, 275,
master - mean (272ms) : 266, 279
. : milestone, 272,
section CallTarget+Inlining+NGEN
This PR (7534) - mean (901ms) : 861, 940
. : milestone, 901,
master - mean (893ms) : 865, 921
. : milestone, 893,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7534) - mean (269ms) : 266, 272
. : milestone, 269,
master - mean (266ms) : 260, 272
. : milestone, 266,
section Baseline
This PR (7534) - mean (268ms) : 264, 272
. : milestone, 268,
master - mean (269ms) : 263, 275
. : milestone, 269,
section CallTarget+Inlining+NGEN
This PR (7534) - mean (877ms) : 846, 908
. : milestone, 877,
master - mean (877ms) : 846, 908
. : milestone, 877,
gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7534) - mean (268ms) : 263, 272
. : milestone, 268,
master - mean (266ms) : 260, 272
. : milestone, 266,
section Baseline
This PR (7534) - mean (268ms) : 263, 272
. : milestone, 268,
master - mean (266ms) : 260, 272
. : milestone, 266,
section CallTarget+Inlining+NGEN
This PR (7534) - mean (789ms) : 762, 815
. : milestone, 789,
master - mean (785ms) : 763, 807
. : milestone, 785,
|
638001b to
a7efcbb
Compare
a7efcbb to
1032927
Compare
Summary of changes
Add a checker to decide whether the profiler is available
Reason for change
We are going to be (and are currently) making P/Invoke calls on startup to call the profiler. If the ClrProfiler is not attached, or the CP file is not available (and so P/Invokes are not re-written) then this can cause additional delays.
Implementation details
Add explicit checks for
Test coverage
If everything still works, this should work
Other details
A blocker for #7287