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
WIP: Add PSConfig.json field to override threshold for slow profile loading msg #17330
WIP: Add PSConfig.json field to override threshold for slow profile loading msg #17330
Conversation
| int showMessageThresholdMs = 500; | ||
|
|
||
| int thresholdMs = PowerShellConfig.Instance.GetSlowProfileLoadingMessageThreshold(ConfigScope.AllUsers); | ||
| if (thresholdMs > 0) |
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.
What if the config contains 0 or -1 value?
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.
The current impl would ignore <= 0 so you'd get the default 500 milliseconds. I suppose I could change that to threshold >= 0 so if the user set it to 0, you'd always see the slow profile loading message. That's a bit odd because then it is no longer about slow profile loading but is instead "always show my profile load time". Then again a threshold of 1 ms is more or less the same.
Part of the problem with this approach to current user setting overriding the global setting is that I'm relying on a default value of 0 to indicate the setting is not set in that config file. I should probably just make the PowerShellConfig property return int? and use that instead to see if the value was set in the corresponding config file. Then 0 could literally mean the threshold is 0 ms and any negative number could mean the threshold is infinite.
|
PR to fix container failure: #17338 |
|
/rebase |
6098e5e
to
cdf0234
Compare
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
|
@daxian-dbw Any thoughts on whether this PR is something the team would be interested in taking? |
|
The |
|
@rkeithhill Given the comment #16929 (comment), you may want to close this PR. |


PR Summary
This PR adds a field to the powershell.config.json file to allow the end user to set the time threshold for showing the "slow profile loading" message. Fixes #16929.
This is WIP because I haven't looked into the test impact yet (and have not written any new tests). Before I do that I'd like to get a nod that the PR would be accepted.
I also expect some debate on what the JSON field should be named. The proposed name is descriptive but perhaps a bit too long -
SlowProfileLoadingMessageThreshold.PR Context
To address and fix issue #16929. See the issue for the complete rationale for this PR.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).