Skip to content

Commit

Permalink
tweak interfaces, #60332
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Nov 26, 2018
1 parent 0bbbf26 commit b381d64
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,9 @@ export class ExtensionHostProfileService extends Disposable implements IExtensio
return this._unresponsiveProfiles.get(extensionId);
}

setUnresponsiveProfile(extensionId: string, profile: IExtensionHostProfile): boolean {
if (!this._unresponsiveProfiles.has(extensionId)) {
this._unresponsiveProfiles.set(extensionId, profile);
this._setLastProfile(profile);
return true;
}
return false;
setUnresponsiveProfile(extensionId: string, profile: IExtensionHostProfile): void {
this._unresponsiveProfiles.set(extensionId, profile);
this._setLastProfile(profile);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ export class ExtensionsAutoProfiler extends Disposable implements IWorkbenchCont
return;
}

const didPrompt = duration > 5e6 && top!.percentage > 90 && this._extensionProfileService.setUnresponsiveProfile(extension.id, profile);
// add to running extensions view
this._extensionProfileService.setUnresponsiveProfile(extension.id, profile);

const path = join(tmpdir(), `exthost-${Math.random().toString(16).slice(2, 8)}.cpuprofile`);
await writeFile(path, JSON.stringify(profile.data));

Expand All @@ -130,13 +132,11 @@ export class ExtensionsAutoProfiler extends Disposable implements IWorkbenchCont
"exthostunresponsive" : {
"duration" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"data": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
"prompt" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
}
*/
this._telemetryService.publicLog('exthostunresponsive', {
duration,
data,
prompt: didPrompt ? 1 : 0
data
});
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export interface IExtensionHostProfileService {
stopProfiling(): void;

getUnresponsiveProfile(extensionId: string): IExtensionHostProfile;
setUnresponsiveProfile(extensionId: string, profile: IExtensionHostProfile): boolean;
setUnresponsiveProfile(extensionId: string, profile: IExtensionHostProfile): void;
}

interface IExtensionProfileInformation {
Expand Down

0 comments on commit b381d64

Please sign in to comment.