shared process - also log lifecycle state when window errors

This commit is contained in:
Benjamin Pasero
2021-04-27 10:30:18 +02:00
parent d417ef3e79
commit 6ef53c31d9
2 changed files with 7 additions and 1 deletions

View File

@@ -950,6 +950,8 @@ export class CodeApplication extends Disposable {
this.lifecycleMainService.phase = LifecycleMainPhase.AfterWindowOpen;
// Observe shared process for errors
let willShutdown = false;
once(this.lifecycleMainService.onWillShutdown)(() => willShutdown = true);
const telemetryService = accessor.get(ITelemetryService);
this._register(sharedProcess.onDidError(({ type, details }) => {
@@ -967,16 +969,19 @@ export class CodeApplication extends Disposable {
type: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
reason: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
visible: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
shuttingdown: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
};
type SharedProcessErrorEvent = {
type: WindowError;
reason: string | undefined;
visible: boolean;
shuttingdown: boolean;
};
telemetryService.publicLog2<SharedProcessErrorEvent, SharedProcessErrorClassification>('sharedprocesserror', {
type,
reason: typeof details !== 'string' ? details?.reason : undefined,
visible: sharedProcess.isVisible()
visible: sharedProcess.isVisible(),
shuttingdown: willShutdown
});
}));