-
Notifications
You must be signed in to change notification settings - Fork 676
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
Add PythonProfilderCommandService to support new profiler #8150
Conversation
@rchiodo Could you also take a look when you get a chance? Just to get a second opinion on it before passing it to the VS team. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Quality Gate passedIssues Measures |
I’ve finished addressing all the feedback, updated the PR description to reflect the new file and interface naming, and did all the tests again to ensure that the expected values are returned. I’ll let the insertion PR run first since it takes about a day to complete, but please take another look whenever you have a chance tomorrow @AdamYoblick before I merge this into the VS main branch. The service call works as intended within PTVS. By MEF exporting the service interface and the returned interface, the Diagnostics Hub team should be able to compile without issues using MEF. When passing this to the Diagnostics Hub team, I will share the following details, but let me know if there’s anything else you want to add. Thanks!
|
Insertion PR is at https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/606517 |
Implementation:
The
IPythonProfilerCommandService
interface is where the core functionality is. The VS team can use MEF to import this type into their codebase and callGetCommandArgsFromUserInput
to retrieve aPythonProfilingCommandArgs
. This object includes properties such asPythonExePath
,WorkingDir
,ScriptPath
,Args
, andEnvVars
, basically all the arguments required by the Diagnostics Hub team to run the command that invokes theetwtrace
package.When the
GetCommandArgsFromUserInput
inPythonProfilerCommandService
is called, first,UserInputDialog.ShowDialog()
displays a user input dialog, allowing users to specify script arguments. Then,CommandArgumentBuilder.BuildCommandArgsFromTarget()
is called to construct the command arguments from user input and returns the result to the service caller.Testing:
Current testing is performed manually by calling the service from the existing profiling dialog. A breakpoint is set in
PythonProfilingPackages.cs
right after the user opens the Python profiler window to verify that the expected object is returned.Unit tests will be added later, but for now, the focus is on rapid iteration and validation.
For example,
Here's user input in the dialog
Here's the value the service returns