Skip to content
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

chore: add arm64 emulation property to perf telemetry #185722

Merged
merged 1 commit into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/vs/platform/native/common/native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export interface ICommonNativeHostService {

isAdmin(): Promise<boolean>;
writeElevated(source: URI, target: URI, options?: { unlock?: boolean }): Promise<void>;
isRunningUnderARM64Translation(): Promise<boolean>;

getOSProperties(): Promise<IOSProperties>;
getOSStatistics(): Promise<IOSStatistics>;
Expand Down
7 changes: 7 additions & 0 deletions src/vs/platform/native/electron-main/nativeHostMainService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,13 @@ export class NativeHostMainService extends Disposable implements INativeHostMain
});
}

async isRunningUnderARM64Translation(): Promise<boolean> {
if (isLinux) {
return false;
}
return app.runningUnderARM64Translation;
}

@memoize
private get cliPath(): string {

Expand Down
5 changes: 4 additions & 1 deletion src/vs/workbench/services/timer/browser/timerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ export interface IMemoryInfo {
"hasAccessibilitySupport" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"isVMLikelyhood" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"emptyWorkbench" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"loadavg" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
"loadavg" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
"isARM64Emulated" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }
}
*/
export interface IStartupMetrics {
Expand Down Expand Up @@ -388,6 +389,7 @@ export interface IStartupMetrics {
readonly meminfo?: IMemoryInfo;
readonly cpus?: { count: number; speed: number; model: string };
readonly loadavg?: number[];
readonly isARM64Emulated?: boolean;
}

export interface ITimerService {
Expand Down Expand Up @@ -727,6 +729,7 @@ export class TimerService extends AbstractTimerService {
}
protected async _extendStartupInfo(info: Writeable<IStartupMetrics>): Promise<void> {
info.isVMLikelyhood = 0;
info.isARM64Emulated = false;
info.platform = navigator.userAgent;
info.release = navigator.appVersion;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ export class TimerService extends AbstractTimerService {

protected async _extendStartupInfo(info: Writeable<IStartupMetrics>): Promise<void> {
try {
const [osProperties, osStatistics, virtualMachineHint] = await Promise.all([
const [osProperties, osStatistics, virtualMachineHint, isARM64Emulated] = await Promise.all([
this._nativeHostService.getOSProperties(),
this._nativeHostService.getOSStatistics(),
this._nativeHostService.getOSVirtualMachineHint()
this._nativeHostService.getOSVirtualMachineHint(),
this._nativeHostService.isRunningUnderARM64Translation()
]);

info.totalmem = osStatistics.totalmem;
Expand All @@ -65,6 +66,7 @@ export class TimerService extends AbstractTimerService {
info.release = osProperties.release;
info.arch = osProperties.arch;
info.loadavg = osStatistics.loadavg;
info.isARM64Emulated = isARM64Emulated;

const processMemoryInfo = await process.getProcessMemoryInfo();
info.meminfo = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export class TestNativeHostService implements INativeHostService {
async setRepresentedFilename(path: string): Promise<void> { }
async isAdmin(): Promise<boolean> { return false; }
async writeElevated(source: URI, target: URI): Promise<void> { }
async isRunningUnderARM64Translation(): Promise<boolean> { return false; }
async getOSProperties(): Promise<IOSProperties> { return Object.create(null); }
async getOSStatistics(): Promise<IOSStatistics> { return Object.create(null); }
async getOSVirtualMachineHint(): Promise<number> { return 0; }
Expand Down