mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-15 18:46:36 -05:00
This reverts commit d15a3fcc98.
This commit is contained in:
@@ -12,6 +12,7 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/
|
||||
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { isNonEmptyArray } from 'vs/base/common/arrays';
|
||||
import { IUpdateService } from 'vs/platform/update/common/update';
|
||||
import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
|
||||
@@ -22,12 +23,14 @@ import { IAccessibilityService, AccessibilitySupport } from 'vs/platform/accessi
|
||||
/* __GDPR__FRAGMENT__
|
||||
"IMemoryInfo" : {
|
||||
"workingSetSize" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
|
||||
"peakWorkingSetSize": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
|
||||
"privateBytes": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
|
||||
"sharedBytes": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }
|
||||
}
|
||||
*/
|
||||
export interface IMemoryInfo {
|
||||
readonly workingSetSize: number;
|
||||
readonly peakWorkingSetSize: number;
|
||||
readonly privateBytes: number;
|
||||
readonly sharedBytes: number;
|
||||
}
|
||||
@@ -208,7 +211,7 @@ export interface IStartupMetrics {
|
||||
readonly ellapsedWorkspaceServiceInit: number;
|
||||
|
||||
/**
|
||||
* The time it took to load the main-bundle of the workbench, e.g. `workbench.main.js`.
|
||||
* The time it took to load the main-bundle of the workbench, e.g `workbench.main.js`.
|
||||
*
|
||||
* * Happens in the renderer-process
|
||||
* * Measured with the `willLoadWorkbenchMain` and `didLoadWorkbenchMain` performance marks.
|
||||
@@ -352,13 +355,7 @@ class TimerService implements ITimerService {
|
||||
release = os.release();
|
||||
arch = os.arch();
|
||||
loadavg = os.loadavg();
|
||||
|
||||
const processMemoryInfo = await process.getProcessMemoryInfo();
|
||||
meminfo = {
|
||||
workingSetSize: processMemoryInfo.residentSet,
|
||||
privateBytes: processMemoryInfo.private,
|
||||
sharedBytes: processMemoryInfo.shared
|
||||
};
|
||||
meminfo = process.getProcessMemoryInfo();
|
||||
|
||||
isVMLikelyhood = Math.round((virtualMachineHint.value() * 100));
|
||||
|
||||
@@ -431,19 +428,16 @@ export function didUseCachedData(): boolean {
|
||||
if (!Boolean((<any>global).require.getConfig().nodeCachedData)) {
|
||||
return false;
|
||||
}
|
||||
// There are loader events that signal if cached data was missing, rejected,
|
||||
// or used. The former two mean no cached data.
|
||||
let cachedDataFound = 0;
|
||||
for (const event of require.getStats()) {
|
||||
switch (event.type) {
|
||||
case LoaderEventType.CachedDataRejected:
|
||||
return false;
|
||||
case LoaderEventType.CachedDataFound:
|
||||
cachedDataFound += 1;
|
||||
break;
|
||||
}
|
||||
// whenever cached data is produced or rejected a onNodeCachedData-callback is invoked. That callback
|
||||
// stores data in the `MonacoEnvironment.onNodeCachedData` global. See:
|
||||
// https://github.com/Microsoft/vscode/blob/efe424dfe76a492eab032343e2fa4cfe639939f0/src/vs/workbench/electron-browser/bootstrap/index.js#L299
|
||||
if (isNonEmptyArray(MonacoEnvironment.onNodeCachedData)) {
|
||||
return false;
|
||||
}
|
||||
return cachedDataFound > 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
declare type OnNodeCachedDataArgs = [{ errorCode: string, path: string, detail?: string }, { path: string, length: number }];
|
||||
declare const MonacoEnvironment: { onNodeCachedData: OnNodeCachedDataArgs[] };
|
||||
|
||||
//#endregion
|
||||
|
||||
Reference in New Issue
Block a user