-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
Report workspace stats in shared process #75291
Conversation
Adding @joaomoreno to review the related changes for allowing to send data to the shared process via IPC. |
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.
@RMacfarlane I see we have now added back the previously commented (rather expensive) code to collectWorkspaceStats
and it is being called from the shared process as suggested. However, I see this method also called from other contexts (e.g. remote, client), so my understanding is that the performance issue would come back in these contexts? I think we should maybe add a flag to this method to indicate if we want the expensive scanning or not and then only do so when run from the shared process?
Alternatively, even better: can we remove collectWorkspaceStats
from being used anywhere except from the shared process?
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.
This makes it that the renderer sends the info over to main which just passes it along to the shared process. Every renderer already has an open connection to the shared process, we should send it via that instead. Example: telemetry service.
Since workspace stats is so much related to telemetry, why not simply add a method on the telemetry service for this?
@@ -371,6 +371,10 @@ export class WindowsService implements IWindowsService, IURLHandler, IDisposable | |||
|
|||
} | |||
|
|||
async sendToSharedProcess(channel: string, ...args: any[]): Promise<void> { |
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 whole point of the IPC abstraction is that we stop using strings. This should be reportWorkspaceStats(workspace: IWorkspace)
instead.
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.
I hit Approve
when I wanted to hit Request changes
.
@RMacfarlane one additional thought: can we not simply move the entire |
@bpasero There are two parts to collectWorkspaceStats - collecting the number of different file types in a workspace, walking the directory for up to 20000 files, and reading the types within the launch configs in the workspace. The expensive walk was never removed from this path, what I added back was collecting launch config data. This does not walk, it only loops over the folders in the workspace and looks for a The other places this is called are
In these cases, the workspace stats aren't meant to be logged by telemetry, but reported to the user/us to help understand problems. If we think this isn't valuable to collect, we can remove them. I think moving this to the telemetry service would only make sense if collectWorkspaceStats wasn't used in these other places. |
I'm wondering if it makes sense to move the entire diagnosticsService into the shared process. Here's how communication currently works in the other collectWorkspaceStatsCases:
So, if diagnosticsService moves to the shared process
|
@RMacfarlane yes I like your proposal from #75291 (comment) very much. I think in all cases the shared process will be up and ready because |
e703475
to
e9a8c4e
Compare
OK, I've moved the diagnostic service implementation to be in the shared process. Getting the remote diagnostics is a little clumsy still, I couldn't find an example of using a channel in a bi-directional way. So instead of fetching the remote info from the shared process, I just pass it over. |
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.
@RMacfarlane going into a good direction, moving this over to shared process 👍
Can we make sure that the IDiagnosticsService
is not being contributed in general (to workbench.main.ts
) but rather only as part of the workbench stats contribution? That seems like the only client of this service and otherwise you would need to provide some stub for the web version where we probably need a different solution.
…vice in workspace stats
I removed the |
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.
IPC looks good to me. 👍
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.
@RMacfarlane generally OK to me, some feedback:
- noticed you had to move a bit of code to
electron-browser
due to some weird direct dependency toworkspaceStats
, I filed WorkspaceStat.TAGS asks for trouble #76002 as follow up - I noticed launch service is now in
common
which is rather unlikely to ever happen, can we only moveIMainProcessInfo
if that is the only thing that is needed?
@bpasero |
This adds back some workspace metadata telemetry, collected in the shared process on start up. I didn't move any of the other reporting there, not sure if we want to shift that as well.