-
Notifications
You must be signed in to change notification settings - Fork 4k
Az.Tools.Predictor refactor and performance improvement. #13669
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Improve the comment and its format. - Create a concret class type to replace Tuple and ValueTuple. - Verify method parameter values.
- Combine the error telemetry event with the non-error one. - Collect if the http request is canceled when we send http request.
- Refactor the telemetry and use a class for the collected data in each telemetry event. - Now we only get basic information and push them to the data flow. - A thread from thread pool handles the data, transform them, and send it.
- Updated the test after the refactor. - Add more test cases. - We don't set SuggestionSource on the suggestion in some cases. This is revealed in the unit tests. They're fixed.
- We have two CommandLinePredictor in AzurePredictorService. The CommandLinePredictor needs to extract from the user input the command name, parameter set etc. It's duplicate if we do that in both CommandLinePredictor. Move that extraction to AzurePredictorService and the CommandLinePredictor will not need to do it.
- Remove the string manipulation. - Pre-allocate the collections for the result. - Remove invariant check in "readonly" properties.
mirdaki
reviewed
Dec 4, 2020
Looks good to me! |
mirdaki
approved these changes
Dec 14, 2020
baopingz
reviewed
Dec 14, 2020
/// <returns>true if allowed.</returns> | ||
private static bool IsDataCollectionAllowed() | ||
{ | ||
if (AzurePSDataCollectionProfile.Instance.EnableAzureDataCollection == true) |
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.
nit: just return AzurePSDataCollectionProfile.Instance.EnableAzureDataCollection
baopingz
approved these changes
Dec 14, 2020
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.
looks good.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
There are a few things going on during the refactor: telemetry, readability, and performance.
Checklist
CONTRIBUTING.md
ChangeLog.md
file(s) has been updated:ChangeLog.md
file can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
## Upcoming Release
header -- no new version header should be added