Skip to content

Commit dcd6209

Browse files
authored
chore: add arm64 emulation property to perf telemetry (microsoft#185722)
1 parent 1eabca5 commit dcd6209

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

src/vs/platform/native/common/native.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export interface ICommonNativeHostService {
116116

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

120121
getOSProperties(): Promise<IOSProperties>;
121122
getOSStatistics(): Promise<IOSStatistics>;

src/vs/platform/native/electron-main/nativeHostMainService.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,13 @@ export class NativeHostMainService extends Disposable implements INativeHostMain
521521
});
522522
}
523523

524+
async isRunningUnderARM64Translation(): Promise<boolean> {
525+
if (isLinux) {
526+
return false;
527+
}
528+
return app.runningUnderARM64Translation;
529+
}
530+
524531
@memoize
525532
private get cliPath(): string {
526533

src/vs/workbench/services/timer/browser/timerService.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ export interface IMemoryInfo {
7878
"hasAccessibilitySupport" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
7979
"isVMLikelyhood" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
8080
"emptyWorkbench" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
81-
"loadavg" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
81+
"loadavg" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
82+
"isARM64Emulated" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }
8283
}
8384
*/
8485
export interface IStartupMetrics {
@@ -388,6 +389,7 @@ export interface IStartupMetrics {
388389
readonly meminfo?: IMemoryInfo;
389390
readonly cpus?: { count: number; speed: number; model: string };
390391
readonly loadavg?: number[];
392+
readonly isARM64Emulated?: boolean;
391393
}
392394

393395
export interface ITimerService {
@@ -727,6 +729,7 @@ export class TimerService extends AbstractTimerService {
727729
}
728730
protected async _extendStartupInfo(info: Writeable<IStartupMetrics>): Promise<void> {
729731
info.isVMLikelyhood = 0;
732+
info.isARM64Emulated = false;
730733
info.platform = navigator.userAgent;
731734
info.release = navigator.appVersion;
732735
}

src/vs/workbench/services/timer/electron-sandbox/timerService.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ export class TimerService extends AbstractTimerService {
5353

5454
protected async _extendStartupInfo(info: Writeable<IStartupMetrics>): Promise<void> {
5555
try {
56-
const [osProperties, osStatistics, virtualMachineHint] = await Promise.all([
56+
const [osProperties, osStatistics, virtualMachineHint, isARM64Emulated] = await Promise.all([
5757
this._nativeHostService.getOSProperties(),
5858
this._nativeHostService.getOSStatistics(),
59-
this._nativeHostService.getOSVirtualMachineHint()
59+
this._nativeHostService.getOSVirtualMachineHint(),
60+
this._nativeHostService.isRunningUnderARM64Translation()
6061
]);
6162

6263
info.totalmem = osStatistics.totalmem;
@@ -65,6 +66,7 @@ export class TimerService extends AbstractTimerService {
6566
info.release = osProperties.release;
6667
info.arch = osProperties.arch;
6768
info.loadavg = osStatistics.loadavg;
69+
info.isARM64Emulated = isARM64Emulated;
6870

6971
const processMemoryInfo = await process.getProcessMemoryInfo();
7072
info.meminfo = {

src/vs/workbench/test/electron-sandbox/workbenchTestServices.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export class TestNativeHostService implements INativeHostService {
107107
async setRepresentedFilename(path: string): Promise<void> { }
108108
async isAdmin(): Promise<boolean> { return false; }
109109
async writeElevated(source: URI, target: URI): Promise<void> { }
110+
async isRunningUnderARM64Translation(): Promise<boolean> { return false; }
110111
async getOSProperties(): Promise<IOSProperties> { return Object.create(null); }
111112
async getOSStatistics(): Promise<IOSStatistics> { return Object.create(null); }
112113
async getOSVirtualMachineHint(): Promise<number> { return 0; }

0 commit comments

Comments
 (0)