@codingame/monaco-vscode-performance-service-override 30.0.1 → 31.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/performance/browser/inputLatencyContrib.d.ts +1 -6
- package/vscode/src/vs/workbench/contrib/performance/browser/inputLatencyContrib.js +40 -24
- package/vscode/src/vs/workbench/contrib/performance/browser/performance.contribution.js +35 -12
- package/vscode/src/vs/workbench/contrib/performance/browser/perfviewEditor.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-performance-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "31.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - performance service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "31.0.0"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|
|
@@ -2,14 +2,9 @@ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/l
|
|
|
2
2
|
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
3
3
|
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
4
4
|
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
5
|
-
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
6
5
|
export declare class InputLatencyContrib extends Disposable implements IWorkbenchContribution {
|
|
7
6
|
private readonly _configurationService;
|
|
8
|
-
private readonly _editorService;
|
|
9
7
|
private readonly _telemetryService;
|
|
10
|
-
|
|
11
|
-
private readonly _scheduler;
|
|
12
|
-
constructor(_configurationService: IConfigurationService, _editorService: IEditorService, _telemetryService: ITelemetryService);
|
|
13
|
-
private _setupListener;
|
|
8
|
+
constructor(_configurationService: IConfigurationService, _telemetryService: ITelemetryService);
|
|
14
9
|
private _logSamples;
|
|
15
10
|
}
|
|
@@ -1,46 +1,62 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { inputLatency } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/performance';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { Disposable, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
7
6
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
7
|
+
import { observableConfigValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/platformObservableUtils';
|
|
8
8
|
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
9
|
-
import {
|
|
9
|
+
import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
|
|
10
|
+
import { throttledObservable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils/utils';
|
|
11
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
10
12
|
|
|
11
13
|
let InputLatencyContrib = class InputLatencyContrib extends Disposable {
|
|
12
|
-
constructor(_configurationService,
|
|
14
|
+
constructor(_configurationService, _telemetryService) {
|
|
13
15
|
super();
|
|
14
16
|
this._configurationService = _configurationService;
|
|
15
|
-
this._editorService = _editorService;
|
|
16
17
|
this._telemetryService = _telemetryService;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
this.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
const probability = observableConfigValue(
|
|
19
|
+
"telemetry.performance.inputLatencySamplingProbability",
|
|
20
|
+
0,
|
|
21
|
+
this._configurationService
|
|
22
|
+
);
|
|
23
|
+
const sessionRandom = Math.random();
|
|
24
|
+
const shouldReport = derived(reader => sessionRandom < probability.read(reader));
|
|
25
|
+
const throttled = throttledObservable(derived(reader => ({
|
|
26
|
+
sampleCount: inputLatency.sampleCount.read(reader),
|
|
27
|
+
shouldReport: shouldReport.read(reader)
|
|
28
|
+
})), 60_000);
|
|
29
|
+
this._register(autorun(reader => {
|
|
30
|
+
const {
|
|
31
|
+
shouldReport
|
|
32
|
+
} = throttled.read(reader);
|
|
33
|
+
const measurements = inputLatency.getAndClearMeasurements();
|
|
34
|
+
if (!measurements) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (shouldReport) {
|
|
38
|
+
this._logSamples(measurements);
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
25
41
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
if (!measurements) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
42
|
+
_logSamples(measurements) {
|
|
43
|
+
const memory = performance.memory;
|
|
44
|
+
const usedJSHeapSize = memory?.usedJSHeapSize ?? -1;
|
|
45
|
+
const jsHeapSizeLimit = memory?.jsHeapSizeLimit ?? -1;
|
|
46
|
+
const jsHeapUsagePercentage = (usedJSHeapSize >= 0 && jsHeapSizeLimit > 0) ? Math.round(usedJSHeapSize / jsHeapSizeLimit * 100) : -1;
|
|
34
47
|
this._telemetryService.publicLog2("performance.inputLatency", {
|
|
35
48
|
keydown: measurements.keydown,
|
|
36
49
|
input: measurements.input,
|
|
37
50
|
render: measurements.render,
|
|
38
51
|
total: measurements.total,
|
|
39
52
|
sampleCount: measurements.sampleCount,
|
|
40
|
-
gpuAcceleration: this._configurationService.getValue("editor.experimentalGpuAcceleration") === "on"
|
|
53
|
+
gpuAcceleration: this._configurationService.getValue("editor.experimentalGpuAcceleration") === "on",
|
|
54
|
+
usedJSHeapSize,
|
|
55
|
+
jsHeapSizeLimit,
|
|
56
|
+
jsHeapUsagePercentage
|
|
41
57
|
});
|
|
42
58
|
}
|
|
43
59
|
};
|
|
44
|
-
InputLatencyContrib = ( __decorate([( __param(0, IConfigurationService)), ( __param(1,
|
|
60
|
+
InputLatencyContrib = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, ITelemetryService))], InputLatencyContrib));
|
|
45
61
|
|
|
46
62
|
export { InputLatencyContrib };
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import {
|
|
3
|
+
import { EventProfiling } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
4
|
+
import { setDisposableTracker, GCBasedDisposableTracker } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import { localize2, localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
6
|
+
import { Categories } from '@codingame/monaco-vscode-api/vscode/vs/platform/action/common/actionCommonCategories';
|
|
4
7
|
import { registerAction2, Action2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
8
|
+
import { Extensions as Extensions$1 } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
9
|
+
import { IEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service';
|
|
5
10
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
6
|
-
import {
|
|
11
|
+
import { InstantiationService, Trace } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiationService';
|
|
7
12
|
import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
|
|
8
|
-
import { Categories } from '@codingame/monaco-vscode-api/vscode/vs/platform/action/common/actionCommonCategories';
|
|
9
13
|
import { registerWorkbenchContribution2, Extensions, WorkbenchPhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions';
|
|
10
14
|
import { EditorExtensions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
|
|
11
|
-
import { PerfviewContrib, PerfviewInput } from './perfviewEditor.js';
|
|
12
15
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
13
|
-
import {
|
|
14
|
-
import { EventProfiling } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
16
|
+
import { LifecyclePhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
15
17
|
import { InputLatencyContrib } from './inputLatencyContrib.js';
|
|
16
|
-
import {
|
|
17
|
-
import { setDisposableTracker, GCBasedDisposableTracker } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
18
|
+
import { PerfviewContrib, PerfviewInput } from './perfviewEditor.js';
|
|
18
19
|
|
|
19
20
|
registerWorkbenchContribution2(PerfviewContrib.ID, PerfviewContrib, {
|
|
20
21
|
lazy: true
|
|
@@ -34,7 +35,7 @@ registerAction2(class extends Action2 {
|
|
|
34
35
|
constructor() {
|
|
35
36
|
super({
|
|
36
37
|
id: "perfview.show",
|
|
37
|
-
title: ( localize2(
|
|
38
|
+
title: ( localize2(11726, "Startup Performance")),
|
|
38
39
|
category: Categories.Developer,
|
|
39
40
|
f1: true
|
|
40
41
|
});
|
|
@@ -51,7 +52,7 @@ registerAction2(class PrintServiceCycles extends Action2 {
|
|
|
51
52
|
constructor() {
|
|
52
53
|
super({
|
|
53
54
|
id: "perf.insta.printAsyncCycles",
|
|
54
|
-
title: ( localize2(
|
|
55
|
+
title: ( localize2(11727, "Print Service Cycles")),
|
|
55
56
|
category: Categories.Developer,
|
|
56
57
|
f1: true
|
|
57
58
|
});
|
|
@@ -72,7 +73,7 @@ registerAction2(class PrintServiceTraces extends Action2 {
|
|
|
72
73
|
constructor() {
|
|
73
74
|
super({
|
|
74
75
|
id: "perf.insta.printTraces",
|
|
75
|
-
title: ( localize2(
|
|
76
|
+
title: ( localize2(11728, "Print Service Traces")),
|
|
76
77
|
category: Categories.Developer,
|
|
77
78
|
f1: true
|
|
78
79
|
});
|
|
@@ -91,7 +92,7 @@ registerAction2(class PrintEventProfiling extends Action2 {
|
|
|
91
92
|
constructor() {
|
|
92
93
|
super({
|
|
93
94
|
id: "perf.event.profiling",
|
|
94
|
-
title: ( localize2(
|
|
95
|
+
title: ( localize2(11729, "Print Emitter Profiles")),
|
|
95
96
|
category: Categories.Developer,
|
|
96
97
|
f1: true
|
|
97
98
|
});
|
|
@@ -109,6 +110,28 @@ registerAction2(class PrintEventProfiling extends Action2 {
|
|
|
109
110
|
}
|
|
110
111
|
});
|
|
111
112
|
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(InputLatencyContrib, LifecyclePhase.Eventually);
|
|
113
|
+
( Registry.as(Extensions$1.Configuration)).registerConfiguration({
|
|
114
|
+
id: "performance",
|
|
115
|
+
order: 101,
|
|
116
|
+
title: ( localize(11730, "Performance")),
|
|
117
|
+
type: "object",
|
|
118
|
+
properties: {
|
|
119
|
+
"telemetry.performance.inputLatencySamplingProbability": {
|
|
120
|
+
type: "number",
|
|
121
|
+
default: 0,
|
|
122
|
+
minimum: 0,
|
|
123
|
+
maximum: 1,
|
|
124
|
+
tags: ["experimental"],
|
|
125
|
+
markdownDescription: ( localize(
|
|
126
|
+
11731,
|
|
127
|
+
"Probability (0 to 1) that input latency telemetry is reported for this session. Set to 0 to disable, 1 to always report."
|
|
128
|
+
)),
|
|
129
|
+
experiment: {
|
|
130
|
+
mode: "auto"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
});
|
|
112
135
|
let DisposableTracking = class DisposableTracking {
|
|
113
136
|
static {
|
|
114
137
|
this.Id = "perf.disposableTracking";
|
|
@@ -80,7 +80,7 @@ let PerfviewInput = class PerfviewInput extends TextResourceEditorInput {
|
|
|
80
80
|
textResourceConfigurationService,
|
|
81
81
|
customEditorLabelService
|
|
82
82
|
) {
|
|
83
|
-
super(PerfviewContrib.get().getInputUri(), ( localize(
|
|
83
|
+
super(PerfviewContrib.get().getInputUri(), ( localize(11732, "Startup Performance")), undefined, undefined, undefined, textModelResolverService, textFileService, editorService, fileService, labelService, filesConfigurationService, textResourceConfigurationService, customEditorLabelService);
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
86
|
PerfviewInput = PerfviewInput_1 = ( __decorate([( __param(0, ITextModelService)), ( __param(1, ITextFileService)), ( __param(2, IEditorService)), ( __param(3, IFileService)), ( __param(4, ILabelService)), ( __param(5, IFilesConfigurationService)), ( __param(6, ITextResourceConfigurationService)), ( __param(7, ICustomEditorLabelService))], PerfviewInput));
|