Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 31 additions & 6 deletions src/vs/code/electron-main/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1582,13 +1582,38 @@ export class CodeApplication extends Disposable {

const customApp = app as AppWithNetworkProcessEvents;

this._register(Event.fromNodeEventEmitter<NetworkProcessLaunchedDetails>(customApp, 'network-process-launched', (_event, details) => details)(details => {
this.logService.info(`[network process] launched with pid ${details.pid}`);
}));
instantiationService.invokeFunction(accessor => {
const telemetryService = accessor.get(ITelemetryService);

this._register(Event.fromNodeEventEmitter<NetworkProcessGoneDetails>(customApp, 'network-process-gone', (_event, details) => details)(details => {
this.logService.info(`[network process] gone - pid: ${details.pid}, exitCode: ${details.exitCode}, crashed: ${details.crashed}, crashedPreIPC: ${details.crashedPreIPC}`);
}));
type NetworkProcessLaunchedClassification = {
owner: 'deepak1556';
comment: 'Tracks network process launch events.';
};

type NetworkProcessGoneClassification = {
exitCode: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'The exit code of the network process.' };
crashed: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'Whether the network process crashed.' };
crashedPreIPC: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'Whether the network process crashed before IPC was established.' };
owner: 'deepak1556';
comment: 'Tracks network process gone events for reliability insights.';
};

this._register(Event.fromNodeEventEmitter<NetworkProcessLaunchedDetails>(customApp, 'network-process-launched', (_event, details) => details)(details => {
this.logService.info(`[network process] launched with pid ${details.pid}`);

telemetryService.publicLog2<{}, NetworkProcessLaunchedClassification>('networkProcess.launched', {});
}));

this._register(Event.fromNodeEventEmitter<NetworkProcessGoneDetails>(customApp, 'network-process-gone', (_event, details) => details)(details => {
this.logService.info(`[network process] gone - pid: ${details.pid}, exitCode: ${details.exitCode}, crashed: ${details.crashed}, crashedPreIPC: ${details.crashedPreIPC}`);

telemetryService.publicLog2<{ exitCode: number; crashed: boolean; crashedPreIPC: boolean }, NetworkProcessGoneClassification>('networkProcess.gone', {
exitCode: details.exitCode,
crashed: details.crashed,
crashedPreIPC: details.crashedPreIPC
});
}));
});
}
}

Expand Down
Loading