@hydranium/client-theia 1.0.0-next.5 → 1.0.0-next.51
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/README.md +2 -2
- package/lib/browser/memory-diagnostics-contribution.d.ts +40 -4
- package/lib/browser/memory-diagnostics-contribution.d.ts.map +1 -1
- package/lib/browser/memory-diagnostics-contribution.js +161 -31
- package/lib/browser/memory-diagnostics-contribution.js.map +1 -1
- package/package.json +7 -7
- package/src/browser/memory-diagnostics-contribution.ts +268 -45
package/README.md
CHANGED
|
@@ -59,8 +59,8 @@ declared peer dependencies are:
|
|
|
59
59
|
| Peer | Range |
|
|
60
60
|
| --------------------- | ------------- |
|
|
61
61
|
| `@hydranium/protocol` | `^1.0.0-next` |
|
|
62
|
-
| `@theia/core` | `^1.
|
|
63
|
-
| `@theia/output` | `^1.
|
|
62
|
+
| `@theia/core` | `^1.70.0` |
|
|
63
|
+
| `@theia/output` | `^1.70.0` |
|
|
64
64
|
| `inversify` | `^6.0.0` |
|
|
65
65
|
|
|
66
66
|
`@theia/output` is easy to miss: the memory-diagnostics commands and the channel
|
|
@@ -43,6 +43,15 @@ export declare const MemoryDiagnosticsService: unique symbol;
|
|
|
43
43
|
*/
|
|
44
44
|
export type HostMemoryDiagnosticsService = HostDiagnosticsProtocol;
|
|
45
45
|
export declare const HostMemoryDiagnosticsService: unique symbol;
|
|
46
|
+
/**
|
|
47
|
+
* What a `report` call captured, as a code rather than a prose fragment. The
|
|
48
|
+
* sentences it appears in are authored once per code, because a fragment
|
|
49
|
+
* substituted into a sentence is itself translatable text and a translator
|
|
50
|
+
* given the sentence alone cannot inflect around a hole.
|
|
51
|
+
*/
|
|
52
|
+
export type DiagnosticsSubject = 'server-state' | 'pod-memory' | 'latency' | 'backend-state' | 'profile';
|
|
53
|
+
/** Which process a heap snapshot is taken of; a code, for the reason {@link DiagnosticsSubject} is one. */
|
|
54
|
+
export type HeapSnapshotTarget = 'server' | 'backend';
|
|
46
55
|
/**
|
|
47
56
|
* Memory-diagnostics commands, one per layer reachable from the frontend. Full
|
|
48
57
|
* multi-line snapshots are appended to the configured output channel; a one-line
|
|
@@ -77,14 +86,28 @@ export declare class MemoryDiagnosticsContribution implements CommandContributio
|
|
|
77
86
|
*/
|
|
78
87
|
protected readonly stopProfilingLabel: string;
|
|
79
88
|
registerCommands(registry: CommandRegistry): void;
|
|
80
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Takes an object rather than positional arguments so that `label` — the one
|
|
91
|
+
* user-facing member — is addressable by name. A lint rule guarding the
|
|
92
|
+
* localization of labels has only syntax to work with, and a selector for an
|
|
93
|
+
* argument position would equally catch `id`, which must stay a bare literal.
|
|
94
|
+
*/
|
|
95
|
+
protected command(spec: {
|
|
96
|
+
id: string;
|
|
97
|
+
label: string;
|
|
98
|
+
category: string;
|
|
99
|
+
}): Command;
|
|
100
|
+
/** The record window as whole seconds, for the label and the toast that must agree on it. */
|
|
101
|
+
protected recordDurationSeconds(): number;
|
|
81
102
|
/** Run a snapshot call, append the full result to the channel, toast the first matching summary line. */
|
|
82
|
-
protected report(
|
|
83
|
-
protected writeSnapshot(target:
|
|
103
|
+
protected report(subject: DiagnosticsSubject, produce: () => Promise<string>, summaryKeys: string[]): Promise<void>;
|
|
104
|
+
protected writeSnapshot(target: HeapSnapshotTarget, produce: (label: string) => Promise<string>): Promise<void>;
|
|
84
105
|
/** Begin an open-ended capture; the toast's stop action ends it and reports. */
|
|
85
106
|
protected startProfiling(): Promise<void>;
|
|
86
107
|
/** End the capture and report it. Shared, so the toast action and the command cannot diverge in behaviour. */
|
|
87
108
|
protected stopProfiling(): Promise<void>;
|
|
109
|
+
/** One authored sentence for both start paths; identical literals in two places drift apart under translation. */
|
|
110
|
+
protected startProfilingFailedMessage(detail: string): string;
|
|
88
111
|
/** Capture a fixed-length window: start, wait, stop, and report the result. */
|
|
89
112
|
protected recordProfile(): Promise<void>;
|
|
90
113
|
/** Isolated so tests can drive the record window without a real timer. */
|
|
@@ -92,7 +115,20 @@ export declare class MemoryDiagnosticsContribution implements CommandContributio
|
|
|
92
115
|
protected dumpFrontendState(): Promise<void>;
|
|
93
116
|
protected channel(): OutputChannel;
|
|
94
117
|
/** Pull the first line starting with one of `keys` for a one-line toast; full text is in the channel. */
|
|
95
|
-
protected summarize(snapshot: string,
|
|
118
|
+
protected summarize(snapshot: string, subject: DiagnosticsSubject, keys: string[]): string;
|
|
119
|
+
/**
|
|
120
|
+
* The captured-with-detail toast. The detail is a machine-formatted figure,
|
|
121
|
+
* so it is safe as a substitution parameter; the subject is not, hence one
|
|
122
|
+
* authored sentence per subject.
|
|
123
|
+
*/
|
|
124
|
+
protected capturedDetailMessage(subject: DiagnosticsSubject, detail: string): string;
|
|
125
|
+
/** The captured-without-detail toast; the channel name is adopter branding, not translatable text. */
|
|
126
|
+
protected capturedChannelMessage(subject: DiagnosticsSubject): string;
|
|
127
|
+
/** The failed-to-dump toast; the detail is a technical error string, safe as a parameter. */
|
|
128
|
+
protected dumpFailedMessage(subject: DiagnosticsSubject, detail: string): string;
|
|
129
|
+
protected writingSnapshotMessage(target: HeapSnapshotTarget): string;
|
|
130
|
+
protected wroteSnapshotMessage(target: HeapSnapshotTarget, filePath: string): string;
|
|
131
|
+
protected writeSnapshotFailedMessage(target: HeapSnapshotTarget, detail: string): string;
|
|
96
132
|
protected errorMessage(error: unknown): string;
|
|
97
133
|
}
|
|
98
134
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-diagnostics-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/memory-diagnostics-contribution.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAEJ,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,mBAAmB,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"memory-diagnostics-contribution.d.ts","sourceRoot":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AO,CAAC,IAAI,CAAC;IAmB9C,0EAA0E;IAC1E,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;cAI1B,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAMlD,SAAS,CAAC,OAAO,IAAI,aAAa;IAMlC,yGAAyG;IACzG,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM;IAW1F;;;;OAIG;IACH,SAAS,CAAC,qBAAqB,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAepF,sGAAsG;IACtG,SAAS,CAAC,sBAAsB,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM;IAoCrE,6FAA6F;IAC7F,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAehF,SAAS,CAAC,sBAAsB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM;IAepE,SAAS,CAAC,oBAAoB,CAAC,MAAM,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IASpF,SAAS,CAAC,0BAA0B,CAAC,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAiBxF,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM;CAGhD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAIpG"}
|
|
@@ -59,71 +59,123 @@ let MemoryDiagnosticsContribution = class MemoryDiagnosticsContribution {
|
|
|
59
59
|
* localized apart, leaving a button or an instruction that names a command
|
|
60
60
|
* the user cannot find.
|
|
61
61
|
*/
|
|
62
|
-
stopProfilingLabel = 'Stop Profiling (Server)';
|
|
62
|
+
stopProfilingLabel = core_1.nls.localize('hydranium/client-theia/command-stop-profiling-server', 'Stop Profiling (Server)');
|
|
63
63
|
registerCommands(registry) {
|
|
64
64
|
const { category } = this.options;
|
|
65
|
-
registry.registerCommand(this.command(
|
|
66
|
-
|
|
65
|
+
registry.registerCommand(this.command({
|
|
66
|
+
id: 'dumpServerState',
|
|
67
|
+
label: core_1.nls.localize('hydranium/client-theia/command-dump-server-state', 'Dump Server State'),
|
|
68
|
+
category
|
|
69
|
+
}), {
|
|
70
|
+
execute: () => this.report('server-state', () => this.diagnostics.dumpServerState({ label: new Date().toISOString() }), ['heap'])
|
|
67
71
|
});
|
|
68
|
-
registry.registerCommand(this.command(
|
|
69
|
-
|
|
72
|
+
registry.registerCommand(this.command({
|
|
73
|
+
id: 'dumpPodMemory',
|
|
74
|
+
label: core_1.nls.localize('hydranium/client-theia/command-dump-pod-memory', 'Dump Pod Memory'),
|
|
75
|
+
category
|
|
76
|
+
}), {
|
|
77
|
+
execute: () => this.report('pod-memory', () => this.diagnostics.dumpPodMemory(), ['current', 'rss sum'])
|
|
70
78
|
});
|
|
71
|
-
registry.registerCommand(this.command(
|
|
79
|
+
registry.registerCommand(this.command({
|
|
80
|
+
id: 'dumpFrontendState',
|
|
81
|
+
label: core_1.nls.localize('hydranium/client-theia/command-dump-frontend-state', 'Dump Frontend State'),
|
|
82
|
+
category
|
|
83
|
+
}), {
|
|
72
84
|
execute: () => this.dumpFrontendState()
|
|
73
85
|
});
|
|
74
|
-
registry.registerCommand(this.command(
|
|
86
|
+
registry.registerCommand(this.command({
|
|
87
|
+
id: 'writeHeapSnapshot',
|
|
88
|
+
label: core_1.nls.localize('hydranium/client-theia/command-write-heap-snapshot-server', 'Write Heap Snapshot (Server)'),
|
|
89
|
+
category
|
|
90
|
+
}), {
|
|
75
91
|
execute: () => this.writeSnapshot('server', label => this.diagnostics.writeHeapSnapshot({ label }))
|
|
76
92
|
});
|
|
77
93
|
// Sampled profiling of the server process — sampling does NOT pause it (unlike
|
|
78
94
|
// the heap snapshot). Start/Stop are the manual pair; Record wraps a fixed window.
|
|
79
|
-
registry.registerCommand(this.command(
|
|
95
|
+
registry.registerCommand(this.command({
|
|
96
|
+
id: 'startProfiling',
|
|
97
|
+
label: core_1.nls.localize('hydranium/client-theia/command-start-profiling-server', 'Start Profiling (Server)'),
|
|
98
|
+
category
|
|
99
|
+
}), {
|
|
80
100
|
execute: () => this.startProfiling()
|
|
81
101
|
});
|
|
82
|
-
registry.registerCommand(this.command('stopProfiling', this.stopProfilingLabel, category), {
|
|
102
|
+
registry.registerCommand(this.command({ id: 'stopProfiling', label: this.stopProfilingLabel, category }), {
|
|
83
103
|
execute: () => this.stopProfiling()
|
|
84
104
|
});
|
|
85
|
-
registry.registerCommand(this.command(
|
|
105
|
+
registry.registerCommand(this.command({
|
|
106
|
+
id: 'recordProfile',
|
|
107
|
+
// The window length rides the substitution path rather than a
|
|
108
|
+
// template literal: an extractor reads the source text, so an
|
|
109
|
+
// interpolated default is never in the catalogue at all.
|
|
110
|
+
label: core_1.nls.localize('hydranium/client-theia/command-record-profile', 'Record Performance Profile (Server, {0}s)', this.recordDurationSeconds()),
|
|
111
|
+
category
|
|
112
|
+
}), {
|
|
86
113
|
execute: () => this.recordProfile()
|
|
87
114
|
});
|
|
88
|
-
registry.registerCommand(this.command(
|
|
89
|
-
|
|
115
|
+
registry.registerCommand(this.command({
|
|
116
|
+
id: 'dumpLatency',
|
|
117
|
+
label: core_1.nls.localize('hydranium/client-theia/command-dump-latency', 'Dump RPC/LSP Latency (Server)'),
|
|
118
|
+
category
|
|
119
|
+
}), {
|
|
120
|
+
execute: () => this.report('latency', async () => (0, protocol_1.formatLatencyReport)(await this.diagnostics.getLatency()), ['window'])
|
|
90
121
|
});
|
|
91
122
|
// Host (Theia backend) process commands — registered only when the
|
|
92
123
|
// optional host-diagnostics service is bound (see HostMemoryDiagnosticsService).
|
|
93
124
|
const hostDiagnostics = this.hostDiagnostics;
|
|
94
125
|
if (hostDiagnostics) {
|
|
95
|
-
registry.registerCommand(this.command(
|
|
96
|
-
|
|
126
|
+
registry.registerCommand(this.command({
|
|
127
|
+
id: 'dumpBackendState',
|
|
128
|
+
label: core_1.nls.localize('hydranium/client-theia/command-dump-backend-state', 'Dump Backend State'),
|
|
129
|
+
category
|
|
130
|
+
}), {
|
|
131
|
+
execute: () => this.report('backend-state', () => hostDiagnostics.dumpHostState({ label: new Date().toISOString() }), ['heap'])
|
|
97
132
|
});
|
|
98
|
-
registry.registerCommand(this.command(
|
|
133
|
+
registry.registerCommand(this.command({
|
|
134
|
+
id: 'writeBackendHeapSnapshot',
|
|
135
|
+
label: core_1.nls.localize('hydranium/client-theia/command-write-heap-snapshot-backend', 'Write Heap Snapshot (Backend)'),
|
|
136
|
+
category
|
|
137
|
+
}), {
|
|
99
138
|
execute: () => this.writeSnapshot('backend', label => hostDiagnostics.writeHostHeapSnapshot({ label }))
|
|
100
139
|
});
|
|
101
140
|
}
|
|
102
141
|
}
|
|
103
|
-
|
|
104
|
-
|
|
142
|
+
/**
|
|
143
|
+
* Takes an object rather than positional arguments so that `label` — the one
|
|
144
|
+
* user-facing member — is addressable by name. A lint rule guarding the
|
|
145
|
+
* localization of labels has only syntax to work with, and a selector for an
|
|
146
|
+
* argument position would equally catch `id`, which must stay a bare literal.
|
|
147
|
+
*/
|
|
148
|
+
command(spec) {
|
|
149
|
+
return { id: `${this.options.commandIdPrefix}.${spec.id}`, label: spec.label, category: spec.category };
|
|
150
|
+
}
|
|
151
|
+
/** The record window as whole seconds, for the label and the toast that must agree on it. */
|
|
152
|
+
recordDurationSeconds() {
|
|
153
|
+
return Math.round(this.recordDurationMs / 1000);
|
|
105
154
|
}
|
|
106
155
|
/** Run a snapshot call, append the full result to the channel, toast the first matching summary line. */
|
|
107
|
-
async report(
|
|
156
|
+
async report(subject, produce, summaryKeys) {
|
|
108
157
|
try {
|
|
109
158
|
const snapshot = await produce();
|
|
110
159
|
this.channel().appendLine(snapshot);
|
|
111
160
|
this.channel().appendLine('');
|
|
112
|
-
this.messageService.info(this.summarize(snapshot,
|
|
161
|
+
this.messageService.info(this.summarize(snapshot, subject, summaryKeys), { timeout: 5000 });
|
|
113
162
|
}
|
|
114
163
|
catch (error) {
|
|
115
|
-
this.messageService.error(
|
|
164
|
+
this.messageService.error(this.dumpFailedMessage(subject, this.errorMessage(error)));
|
|
116
165
|
}
|
|
117
166
|
}
|
|
118
167
|
async writeSnapshot(target, produce) {
|
|
119
168
|
try {
|
|
120
|
-
this.messageService.info(
|
|
169
|
+
this.messageService.info(this.writingSnapshotMessage(target), { timeout: 3000 });
|
|
121
170
|
const filePath = await produce(new Date().toISOString());
|
|
122
|
-
|
|
123
|
-
|
|
171
|
+
// One sentence, shown in both places: two literals of equal value can be
|
|
172
|
+
// localized apart, leaving the channel and the toast naming different files.
|
|
173
|
+
const written = this.wroteSnapshotMessage(target, filePath);
|
|
174
|
+
this.channel().appendLine(written);
|
|
175
|
+
this.messageService.info(written, { timeout: 8000 });
|
|
124
176
|
}
|
|
125
177
|
catch (error) {
|
|
126
|
-
this.messageService.error(
|
|
178
|
+
this.messageService.error(this.writeSnapshotFailedMessage(target, this.errorMessage(error)));
|
|
127
179
|
}
|
|
128
180
|
}
|
|
129
181
|
/** Begin an open-ended capture; the toast's stop action ends it and reports. */
|
|
@@ -132,14 +184,14 @@ let MemoryDiagnosticsContribution = class MemoryDiagnosticsContribution {
|
|
|
132
184
|
await this.diagnostics.startProfiling(this.profileDimensions);
|
|
133
185
|
}
|
|
134
186
|
catch (error) {
|
|
135
|
-
this.messageService.error(
|
|
187
|
+
this.messageService.error(this.startProfilingFailedMessage(this.errorMessage(error)));
|
|
136
188
|
return;
|
|
137
189
|
}
|
|
138
190
|
// No timeout: the capture runs as long as the user wants it to, and an
|
|
139
191
|
// auto-dismissing toast takes the stop affordance with it. Awaiting the
|
|
140
192
|
// toast is what keeps the action live, so this resolves only once the
|
|
141
193
|
// user acts on it or dismisses it.
|
|
142
|
-
const chosen = await this.messageService.info('Server profiling started — sampling does not stop the process.', { timeout: 0 }, this.stopProfilingLabel);
|
|
194
|
+
const chosen = await this.messageService.info(core_1.nls.localize('hydranium/client-theia/profiling-started', 'Server profiling started — sampling does not stop the process.'), { timeout: 0 }, this.stopProfilingLabel);
|
|
143
195
|
if (chosen === this.stopProfilingLabel) {
|
|
144
196
|
await this.stopProfiling();
|
|
145
197
|
}
|
|
@@ -148,16 +200,20 @@ let MemoryDiagnosticsContribution = class MemoryDiagnosticsContribution {
|
|
|
148
200
|
stopProfiling() {
|
|
149
201
|
return this.report('profile', () => this.diagnostics.stopProfiling({ label: new Date().toISOString() }), ['duration']);
|
|
150
202
|
}
|
|
203
|
+
/** One authored sentence for both start paths; identical literals in two places drift apart under translation. */
|
|
204
|
+
startProfilingFailedMessage(detail) {
|
|
205
|
+
return core_1.nls.localize('hydranium/client-theia/error-start-profiling', 'Failed to start profiling: {0}', detail);
|
|
206
|
+
}
|
|
151
207
|
/** Capture a fixed-length window: start, wait, stop, and report the result. */
|
|
152
208
|
async recordProfile() {
|
|
153
209
|
try {
|
|
154
210
|
await this.diagnostics.startProfiling(this.profileDimensions);
|
|
155
211
|
}
|
|
156
212
|
catch (error) {
|
|
157
|
-
this.messageService.error(
|
|
213
|
+
this.messageService.error(this.startProfilingFailedMessage(this.errorMessage(error)));
|
|
158
214
|
return;
|
|
159
215
|
}
|
|
160
|
-
this.messageService.info(
|
|
216
|
+
this.messageService.info(core_1.nls.localize('hydranium/client-theia/recording-profile', 'Recording a {0}s server performance profile...', this.recordDurationSeconds()), { timeout: 4000 });
|
|
161
217
|
await this.delay(this.recordDurationMs);
|
|
162
218
|
await this.stopProfiling();
|
|
163
219
|
}
|
|
@@ -176,15 +232,89 @@ let MemoryDiagnosticsContribution = class MemoryDiagnosticsContribution {
|
|
|
176
232
|
return channel;
|
|
177
233
|
}
|
|
178
234
|
/** Pull the first line starting with one of `keys` for a one-line toast; full text is in the channel. */
|
|
179
|
-
summarize(snapshot,
|
|
235
|
+
summarize(snapshot, subject, keys) {
|
|
180
236
|
const lines = snapshot.split('\n');
|
|
181
237
|
for (const key of keys) {
|
|
182
238
|
const line = lines.find(entry => entry.trim().startsWith(key));
|
|
183
239
|
if (line) {
|
|
184
|
-
return
|
|
240
|
+
return this.capturedDetailMessage(subject, line.replace(new RegExp(`^\\s*${key}\\s*`), ` ${key} `));
|
|
185
241
|
}
|
|
186
242
|
}
|
|
187
|
-
return
|
|
243
|
+
return this.capturedChannelMessage(subject);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* The captured-with-detail toast. The detail is a machine-formatted figure,
|
|
247
|
+
* so it is safe as a substitution parameter; the subject is not, hence one
|
|
248
|
+
* authored sentence per subject.
|
|
249
|
+
*/
|
|
250
|
+
capturedDetailMessage(subject, detail) {
|
|
251
|
+
switch (subject) {
|
|
252
|
+
case 'server-state':
|
|
253
|
+
return core_1.nls.localize('hydranium/client-theia/captured-server-state-detail', 'Captured server state —{0}', detail);
|
|
254
|
+
case 'pod-memory':
|
|
255
|
+
return core_1.nls.localize('hydranium/client-theia/captured-pod-memory-detail', 'Captured pod memory —{0}', detail);
|
|
256
|
+
case 'latency':
|
|
257
|
+
return core_1.nls.localize('hydranium/client-theia/captured-latency-detail', 'Captured RPC/LSP latency —{0}', detail);
|
|
258
|
+
case 'backend-state':
|
|
259
|
+
return core_1.nls.localize('hydranium/client-theia/captured-backend-state-detail', 'Captured backend state —{0}', detail);
|
|
260
|
+
case 'profile':
|
|
261
|
+
return core_1.nls.localize('hydranium/client-theia/captured-profile-detail', 'Captured profile —{0}', detail);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/** The captured-without-detail toast; the channel name is adopter branding, not translatable text. */
|
|
265
|
+
capturedChannelMessage(subject) {
|
|
266
|
+
const channelName = this.options.channelName;
|
|
267
|
+
switch (subject) {
|
|
268
|
+
case 'server-state':
|
|
269
|
+
return core_1.nls.localize('hydranium/client-theia/captured-server-state-channel', 'Captured server state (see the {0} output channel)', channelName);
|
|
270
|
+
case 'pod-memory':
|
|
271
|
+
return core_1.nls.localize('hydranium/client-theia/captured-pod-memory-channel', 'Captured pod memory (see the {0} output channel)', channelName);
|
|
272
|
+
case 'latency':
|
|
273
|
+
return core_1.nls.localize('hydranium/client-theia/captured-latency-channel', 'Captured RPC/LSP latency (see the {0} output channel)', channelName);
|
|
274
|
+
case 'backend-state':
|
|
275
|
+
return core_1.nls.localize('hydranium/client-theia/captured-backend-state-channel', 'Captured backend state (see the {0} output channel)', channelName);
|
|
276
|
+
case 'profile':
|
|
277
|
+
return core_1.nls.localize('hydranium/client-theia/captured-profile-channel', 'Captured profile (see the {0} output channel)', channelName);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
/** The failed-to-dump toast; the detail is a technical error string, safe as a parameter. */
|
|
281
|
+
dumpFailedMessage(subject, detail) {
|
|
282
|
+
switch (subject) {
|
|
283
|
+
case 'server-state':
|
|
284
|
+
return core_1.nls.localize('hydranium/client-theia/error-dump-server-state', 'Failed to dump server state: {0}', detail);
|
|
285
|
+
case 'pod-memory':
|
|
286
|
+
return core_1.nls.localize('hydranium/client-theia/error-dump-pod-memory', 'Failed to dump pod memory: {0}', detail);
|
|
287
|
+
case 'latency':
|
|
288
|
+
return core_1.nls.localize('hydranium/client-theia/error-dump-latency', 'Failed to dump RPC/LSP latency: {0}', detail);
|
|
289
|
+
case 'backend-state':
|
|
290
|
+
return core_1.nls.localize('hydranium/client-theia/error-dump-backend-state', 'Failed to dump backend state: {0}', detail);
|
|
291
|
+
case 'profile':
|
|
292
|
+
return core_1.nls.localize('hydranium/client-theia/error-dump-profile', 'Failed to dump profile: {0}', detail);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
writingSnapshotMessage(target) {
|
|
296
|
+
switch (target) {
|
|
297
|
+
case 'server':
|
|
298
|
+
return core_1.nls.localize('hydranium/client-theia/writing-heap-snapshot-server', 'Writing server heap snapshot — this briefly pauses that process...');
|
|
299
|
+
case 'backend':
|
|
300
|
+
return core_1.nls.localize('hydranium/client-theia/writing-heap-snapshot-backend', 'Writing backend heap snapshot — this briefly pauses that process...');
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
wroteSnapshotMessage(target, filePath) {
|
|
304
|
+
switch (target) {
|
|
305
|
+
case 'server':
|
|
306
|
+
return core_1.nls.localize('hydranium/client-theia/wrote-heap-snapshot-server', 'Heap snapshot (server) written to {0}', filePath);
|
|
307
|
+
case 'backend':
|
|
308
|
+
return core_1.nls.localize('hydranium/client-theia/wrote-heap-snapshot-backend', 'Heap snapshot (backend) written to {0}', filePath);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
writeSnapshotFailedMessage(target, detail) {
|
|
312
|
+
switch (target) {
|
|
313
|
+
case 'server':
|
|
314
|
+
return core_1.nls.localize('hydranium/client-theia/error-write-heap-snapshot-server', 'Failed to write server heap snapshot: {0}', detail);
|
|
315
|
+
case 'backend':
|
|
316
|
+
return core_1.nls.localize('hydranium/client-theia/error-write-heap-snapshot-backend', 'Failed to write backend heap snapshot: {0}', detail);
|
|
317
|
+
}
|
|
188
318
|
}
|
|
189
319
|
errorMessage(error) {
|
|
190
320
|
return error instanceof Error ? error.message : String(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-diagnostics-contribution.js","sourceRoot":"","sources":["../../src/browser/memory-diagnostics-contribution.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;AA4OlF,sDAIC;AA9OD,kDAK6B;AAC7B,uDAAgF;AAChF,sCAAsG;AACtG,4DAA6F;AAC7F,6EAAoG;AAevF,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAU9D,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAW9D,QAAA,4BAA4B,GAAG,MAAM,CAAC,8BAA8B,CAAC,CAAC;AAEnF;;;;;;;;;;;;;;;GAe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CAAC;QACD,OAAO,YAAY,IAAI,aAAa,IAAI,CAAC,OAAO,CAAC,WAAW,kBAAkB,CAAC;IAClF,CAAC;IAES,YAAY,CAAC,KAAc;QAClC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjE,CAAC;CACH,CAAA;AAlKY,sEAA6B;AACc;IAApD,IAAA,kBAAM,EAAC,gCAAwB,CAAC;;kEAA0D;AACtC;IAApD,IAAA,kBAAM,EAAC,gCAAwB,CAAC;;8DAAsD;AAC5C;IAA1C,IAAA,kBAAM,EAAC,qBAAc,CAAC;8BAAoC,qBAAc;qEAAC;AACzB;IAAhD,IAAA,kBAAM,EAAC,qCAAoB,CAAC;8BAA8B,qCAAoB;+DAAC;AACX;IAApE,IAAA,kBAAM,EAAC,oCAA4B,CAAC;IAAE,IAAA,oBAAQ,GAAE;;sEAAmE;wCAL1G,6BAA6B;IADzC,IAAA,sBAAU,GAAE;GACA,6BAA6B,CAkKzC;AAED;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,IAAqB,EAAE,OAAiC;IAC3F,IAAI,CAAC,gCAAwB,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACxD,IAAI,CAAC,6BAA6B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAChE,IAAI,CAAC,0BAAmB,CAAC,CAAC,SAAS,CAAC,6BAA6B,CAAC,CAAC;AACtE,CAAC"}
|
|
1
|
+
{"version":3,"file":"memory-diagnostics-contribution.js","sourceRoot":"","sources":["../../src/browser/memory-diagnostics-contribution.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;AA2clF,sDAIC;AA7cD,kDAK6B;AAC7B,uDAAgF;AAChF,sCAA2G;AAC3G,4DAA6F;AAC7F,6EAAoG;AAevF,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CA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,OAAiC;IAC3F,IAAI,CAAC,gCAAwB,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACxD,IAAI,CAAC,6BAA6B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAChE,IAAI,CAAC,0BAAmB,CAAC,CAAC,SAAS,CAAC,6BAA6B,CAAC,CAAC;AACtE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hydranium/client-theia",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.51",
|
|
4
4
|
"description": "Cross-head Theia client primitives shared by the hydranium protocol heads. Provides the socket-forwarding connection-handler base that the data-server and GLSP Theia integrations subclass, plus the preference-driven Output-channel logger; carries no head-specific dependency.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hydranium",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
74
|
-
"@theia/core": "^1.
|
|
75
|
-
"@theia/output": "^1.
|
|
73
|
+
"@hydranium/protocol": "1.0.0-next.51",
|
|
74
|
+
"@theia/core": "^1.70.0",
|
|
75
|
+
"@theia/output": "^1.70.0",
|
|
76
76
|
"@types/node": "^22.0.0",
|
|
77
77
|
"inversify": "6.2.2",
|
|
78
78
|
"reflect-metadata": "0.2.2",
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
"typescript": "^5.8.0"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
84
|
-
"@theia/core": "^1.
|
|
85
|
-
"@theia/output": "^1.
|
|
83
|
+
"@hydranium/protocol": "1.0.0-next.51",
|
|
84
|
+
"@theia/core": "^1.70.0",
|
|
85
|
+
"@theia/output": "^1.70.0",
|
|
86
86
|
"inversify": "^6.0.0"
|
|
87
87
|
},
|
|
88
88
|
"engines": {
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
type StartProfilingArgs
|
|
15
15
|
} from '@hydranium/protocol';
|
|
16
16
|
import { captureBrowserRuntime, formatBrowserRuntime } from './browser-capture';
|
|
17
|
-
import { CommandContribution, MessageService, type Command, type CommandRegistry } from '@theia/core';
|
|
17
|
+
import { CommandContribution, MessageService, nls, type Command, type CommandRegistry } from '@theia/core';
|
|
18
18
|
import { inject, injectable, optional, type interfaces } from '@theia/core/shared/inversify';
|
|
19
19
|
import { OutputChannelManager, type OutputChannel } from '@theia/output/lib/browser/output-channel';
|
|
20
20
|
|
|
@@ -54,6 +54,17 @@ export const MemoryDiagnosticsService = Symbol('MemoryDiagnosticsService');
|
|
|
54
54
|
export type HostMemoryDiagnosticsService = HostDiagnosticsProtocol;
|
|
55
55
|
export const HostMemoryDiagnosticsService = Symbol('HostMemoryDiagnosticsService');
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* What a `report` call captured, as a code rather than a prose fragment. The
|
|
59
|
+
* sentences it appears in are authored once per code, because a fragment
|
|
60
|
+
* substituted into a sentence is itself translatable text and a translator
|
|
61
|
+
* given the sentence alone cannot inflect around a hole.
|
|
62
|
+
*/
|
|
63
|
+
export type DiagnosticsSubject = 'server-state' | 'pod-memory' | 'latency' | 'backend-state' | 'profile';
|
|
64
|
+
|
|
65
|
+
/** Which process a heap snapshot is taken of; a code, for the reason {@link DiagnosticsSubject} is one. */
|
|
66
|
+
export type HeapSnapshotTarget = 'server' | 'backend';
|
|
67
|
+
|
|
57
68
|
/**
|
|
58
69
|
* Memory-diagnostics commands, one per layer reachable from the frontend. Full
|
|
59
70
|
* multi-line snapshots are appended to the configured output channel; a one-line
|
|
@@ -88,76 +99,162 @@ export class MemoryDiagnosticsContribution implements CommandContribution {
|
|
|
88
99
|
* localized apart, leaving a button or an instruction that names a command
|
|
89
100
|
* the user cannot find.
|
|
90
101
|
*/
|
|
91
|
-
protected readonly stopProfilingLabel: string =
|
|
102
|
+
protected readonly stopProfilingLabel: string = nls.localize(
|
|
103
|
+
'hydranium/client-theia/command-stop-profiling-server',
|
|
104
|
+
'Stop Profiling (Server)'
|
|
105
|
+
);
|
|
92
106
|
|
|
93
107
|
registerCommands(registry: CommandRegistry): void {
|
|
94
108
|
const { category } = this.options;
|
|
95
|
-
registry.registerCommand(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
109
|
+
registry.registerCommand(
|
|
110
|
+
this.command({
|
|
111
|
+
id: 'dumpServerState',
|
|
112
|
+
label: nls.localize('hydranium/client-theia/command-dump-server-state', 'Dump Server State'),
|
|
113
|
+
category
|
|
114
|
+
}),
|
|
115
|
+
{
|
|
116
|
+
execute: () =>
|
|
117
|
+
this.report('server-state', () => this.diagnostics.dumpServerState({ label: new Date().toISOString() }), ['heap'])
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
registry.registerCommand(
|
|
121
|
+
this.command({
|
|
122
|
+
id: 'dumpPodMemory',
|
|
123
|
+
label: nls.localize('hydranium/client-theia/command-dump-pod-memory', 'Dump Pod Memory'),
|
|
124
|
+
category
|
|
125
|
+
}),
|
|
126
|
+
{
|
|
127
|
+
execute: () => this.report('pod-memory', () => this.diagnostics.dumpPodMemory(), ['current', 'rss sum'])
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
registry.registerCommand(
|
|
131
|
+
this.command({
|
|
132
|
+
id: 'dumpFrontendState',
|
|
133
|
+
label: nls.localize('hydranium/client-theia/command-dump-frontend-state', 'Dump Frontend State'),
|
|
134
|
+
category
|
|
135
|
+
}),
|
|
136
|
+
{
|
|
137
|
+
execute: () => this.dumpFrontendState()
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
registry.registerCommand(
|
|
141
|
+
this.command({
|
|
142
|
+
id: 'writeHeapSnapshot',
|
|
143
|
+
label: nls.localize('hydranium/client-theia/command-write-heap-snapshot-server', 'Write Heap Snapshot (Server)'),
|
|
144
|
+
category
|
|
145
|
+
}),
|
|
146
|
+
{
|
|
147
|
+
execute: () => this.writeSnapshot('server', label => this.diagnostics.writeHeapSnapshot({ label }))
|
|
148
|
+
}
|
|
149
|
+
);
|
|
107
150
|
// Sampled profiling of the server process — sampling does NOT pause it (unlike
|
|
108
151
|
// the heap snapshot). Start/Stop are the manual pair; Record wraps a fixed window.
|
|
109
|
-
registry.registerCommand(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
152
|
+
registry.registerCommand(
|
|
153
|
+
this.command({
|
|
154
|
+
id: 'startProfiling',
|
|
155
|
+
label: nls.localize('hydranium/client-theia/command-start-profiling-server', 'Start Profiling (Server)'),
|
|
156
|
+
category
|
|
157
|
+
}),
|
|
158
|
+
{
|
|
159
|
+
execute: () => this.startProfiling()
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
registry.registerCommand(this.command({ id: 'stopProfiling', label: this.stopProfilingLabel, category }), {
|
|
113
163
|
execute: () => this.stopProfiling()
|
|
114
164
|
});
|
|
115
165
|
registry.registerCommand(
|
|
116
|
-
this.command(
|
|
166
|
+
this.command({
|
|
167
|
+
id: 'recordProfile',
|
|
168
|
+
// The window length rides the substitution path rather than a
|
|
169
|
+
// template literal: an extractor reads the source text, so an
|
|
170
|
+
// interpolated default is never in the catalogue at all.
|
|
171
|
+
label: nls.localize(
|
|
172
|
+
'hydranium/client-theia/command-record-profile',
|
|
173
|
+
'Record Performance Profile (Server, {0}s)',
|
|
174
|
+
this.recordDurationSeconds()
|
|
175
|
+
),
|
|
176
|
+
category
|
|
177
|
+
}),
|
|
117
178
|
{
|
|
118
179
|
execute: () => this.recordProfile()
|
|
119
180
|
}
|
|
120
181
|
);
|
|
121
|
-
registry.registerCommand(
|
|
122
|
-
|
|
123
|
-
|
|
182
|
+
registry.registerCommand(
|
|
183
|
+
this.command({
|
|
184
|
+
id: 'dumpLatency',
|
|
185
|
+
label: nls.localize('hydranium/client-theia/command-dump-latency', 'Dump RPC/LSP Latency (Server)'),
|
|
186
|
+
category
|
|
187
|
+
}),
|
|
188
|
+
{
|
|
189
|
+
execute: () => this.report('latency', async () => formatLatencyReport(await this.diagnostics.getLatency()), ['window'])
|
|
190
|
+
}
|
|
191
|
+
);
|
|
124
192
|
// Host (Theia backend) process commands — registered only when the
|
|
125
193
|
// optional host-diagnostics service is bound (see HostMemoryDiagnosticsService).
|
|
126
194
|
const hostDiagnostics = this.hostDiagnostics;
|
|
127
195
|
if (hostDiagnostics) {
|
|
128
|
-
registry.registerCommand(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
196
|
+
registry.registerCommand(
|
|
197
|
+
this.command({
|
|
198
|
+
id: 'dumpBackendState',
|
|
199
|
+
label: nls.localize('hydranium/client-theia/command-dump-backend-state', 'Dump Backend State'),
|
|
200
|
+
category
|
|
201
|
+
}),
|
|
202
|
+
{
|
|
203
|
+
execute: () =>
|
|
204
|
+
this.report('backend-state', () => hostDiagnostics.dumpHostState({ label: new Date().toISOString() }), ['heap'])
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
registry.registerCommand(
|
|
208
|
+
this.command({
|
|
209
|
+
id: 'writeBackendHeapSnapshot',
|
|
210
|
+
label: nls.localize('hydranium/client-theia/command-write-heap-snapshot-backend', 'Write Heap Snapshot (Backend)'),
|
|
211
|
+
category
|
|
212
|
+
}),
|
|
213
|
+
{
|
|
214
|
+
execute: () => this.writeSnapshot('backend', label => hostDiagnostics.writeHostHeapSnapshot({ label }))
|
|
215
|
+
}
|
|
216
|
+
);
|
|
134
217
|
}
|
|
135
218
|
}
|
|
136
219
|
|
|
137
|
-
|
|
138
|
-
|
|
220
|
+
/**
|
|
221
|
+
* Takes an object rather than positional arguments so that `label` — the one
|
|
222
|
+
* user-facing member — is addressable by name. A lint rule guarding the
|
|
223
|
+
* localization of labels has only syntax to work with, and a selector for an
|
|
224
|
+
* argument position would equally catch `id`, which must stay a bare literal.
|
|
225
|
+
*/
|
|
226
|
+
protected command(spec: { id: string; label: string; category: string }): Command {
|
|
227
|
+
return { id: `${this.options.commandIdPrefix}.${spec.id}`, label: spec.label, category: spec.category };
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** The record window as whole seconds, for the label and the toast that must agree on it. */
|
|
231
|
+
protected recordDurationSeconds(): number {
|
|
232
|
+
return Math.round(this.recordDurationMs / 1000);
|
|
139
233
|
}
|
|
140
234
|
|
|
141
235
|
/** Run a snapshot call, append the full result to the channel, toast the first matching summary line. */
|
|
142
|
-
protected async report(
|
|
236
|
+
protected async report(subject: DiagnosticsSubject, produce: () => Promise<string>, summaryKeys: string[]): Promise<void> {
|
|
143
237
|
try {
|
|
144
238
|
const snapshot = await produce();
|
|
145
239
|
this.channel().appendLine(snapshot);
|
|
146
240
|
this.channel().appendLine('');
|
|
147
|
-
this.messageService.info(this.summarize(snapshot,
|
|
241
|
+
this.messageService.info(this.summarize(snapshot, subject, summaryKeys), { timeout: 5000 });
|
|
148
242
|
} catch (error) {
|
|
149
|
-
this.messageService.error(
|
|
243
|
+
this.messageService.error(this.dumpFailedMessage(subject, this.errorMessage(error)));
|
|
150
244
|
}
|
|
151
245
|
}
|
|
152
246
|
|
|
153
|
-
protected async writeSnapshot(target:
|
|
247
|
+
protected async writeSnapshot(target: HeapSnapshotTarget, produce: (label: string) => Promise<string>): Promise<void> {
|
|
154
248
|
try {
|
|
155
|
-
this.messageService.info(
|
|
249
|
+
this.messageService.info(this.writingSnapshotMessage(target), { timeout: 3000 });
|
|
156
250
|
const filePath = await produce(new Date().toISOString());
|
|
157
|
-
|
|
158
|
-
|
|
251
|
+
// One sentence, shown in both places: two literals of equal value can be
|
|
252
|
+
// localized apart, leaving the channel and the toast naming different files.
|
|
253
|
+
const written = this.wroteSnapshotMessage(target, filePath);
|
|
254
|
+
this.channel().appendLine(written);
|
|
255
|
+
this.messageService.info(written, { timeout: 8000 });
|
|
159
256
|
} catch (error) {
|
|
160
|
-
this.messageService.error(
|
|
257
|
+
this.messageService.error(this.writeSnapshotFailedMessage(target, this.errorMessage(error)));
|
|
161
258
|
}
|
|
162
259
|
}
|
|
163
260
|
|
|
@@ -166,7 +263,7 @@ export class MemoryDiagnosticsContribution implements CommandContribution {
|
|
|
166
263
|
try {
|
|
167
264
|
await this.diagnostics.startProfiling(this.profileDimensions);
|
|
168
265
|
} catch (error) {
|
|
169
|
-
this.messageService.error(
|
|
266
|
+
this.messageService.error(this.startProfilingFailedMessage(this.errorMessage(error)));
|
|
170
267
|
return;
|
|
171
268
|
}
|
|
172
269
|
// No timeout: the capture runs as long as the user wants it to, and an
|
|
@@ -174,7 +271,7 @@ export class MemoryDiagnosticsContribution implements CommandContribution {
|
|
|
174
271
|
// toast is what keeps the action live, so this resolves only once the
|
|
175
272
|
// user acts on it or dismisses it.
|
|
176
273
|
const chosen = await this.messageService.info(
|
|
177
|
-
'Server profiling started — sampling does not stop the process.',
|
|
274
|
+
nls.localize('hydranium/client-theia/profiling-started', 'Server profiling started — sampling does not stop the process.'),
|
|
178
275
|
{ timeout: 0 },
|
|
179
276
|
this.stopProfilingLabel
|
|
180
277
|
);
|
|
@@ -188,15 +285,27 @@ export class MemoryDiagnosticsContribution implements CommandContribution {
|
|
|
188
285
|
return this.report('profile', () => this.diagnostics.stopProfiling({ label: new Date().toISOString() }), ['duration']);
|
|
189
286
|
}
|
|
190
287
|
|
|
288
|
+
/** One authored sentence for both start paths; identical literals in two places drift apart under translation. */
|
|
289
|
+
protected startProfilingFailedMessage(detail: string): string {
|
|
290
|
+
return nls.localize('hydranium/client-theia/error-start-profiling', 'Failed to start profiling: {0}', detail);
|
|
291
|
+
}
|
|
292
|
+
|
|
191
293
|
/** Capture a fixed-length window: start, wait, stop, and report the result. */
|
|
192
294
|
protected async recordProfile(): Promise<void> {
|
|
193
295
|
try {
|
|
194
296
|
await this.diagnostics.startProfiling(this.profileDimensions);
|
|
195
297
|
} catch (error) {
|
|
196
|
-
this.messageService.error(
|
|
298
|
+
this.messageService.error(this.startProfilingFailedMessage(this.errorMessage(error)));
|
|
197
299
|
return;
|
|
198
300
|
}
|
|
199
|
-
this.messageService.info(
|
|
301
|
+
this.messageService.info(
|
|
302
|
+
nls.localize(
|
|
303
|
+
'hydranium/client-theia/recording-profile',
|
|
304
|
+
'Recording a {0}s server performance profile...',
|
|
305
|
+
this.recordDurationSeconds()
|
|
306
|
+
),
|
|
307
|
+
{ timeout: 4000 }
|
|
308
|
+
);
|
|
200
309
|
await this.delay(this.recordDurationMs);
|
|
201
310
|
await this.stopProfiling();
|
|
202
311
|
}
|
|
@@ -219,15 +328,129 @@ export class MemoryDiagnosticsContribution implements CommandContribution {
|
|
|
219
328
|
}
|
|
220
329
|
|
|
221
330
|
/** Pull the first line starting with one of `keys` for a one-line toast; full text is in the channel. */
|
|
222
|
-
protected summarize(snapshot: string,
|
|
331
|
+
protected summarize(snapshot: string, subject: DiagnosticsSubject, keys: string[]): string {
|
|
223
332
|
const lines = snapshot.split('\n');
|
|
224
333
|
for (const key of keys) {
|
|
225
334
|
const line = lines.find(entry => entry.trim().startsWith(key));
|
|
226
335
|
if (line) {
|
|
227
|
-
return
|
|
336
|
+
return this.capturedDetailMessage(subject, line.replace(new RegExp(`^\\s*${key}\\s*`), ` ${key} `));
|
|
228
337
|
}
|
|
229
338
|
}
|
|
230
|
-
return
|
|
339
|
+
return this.capturedChannelMessage(subject);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* The captured-with-detail toast. The detail is a machine-formatted figure,
|
|
344
|
+
* so it is safe as a substitution parameter; the subject is not, hence one
|
|
345
|
+
* authored sentence per subject.
|
|
346
|
+
*/
|
|
347
|
+
protected capturedDetailMessage(subject: DiagnosticsSubject, detail: string): string {
|
|
348
|
+
switch (subject) {
|
|
349
|
+
case 'server-state':
|
|
350
|
+
return nls.localize('hydranium/client-theia/captured-server-state-detail', 'Captured server state —{0}', detail);
|
|
351
|
+
case 'pod-memory':
|
|
352
|
+
return nls.localize('hydranium/client-theia/captured-pod-memory-detail', 'Captured pod memory —{0}', detail);
|
|
353
|
+
case 'latency':
|
|
354
|
+
return nls.localize('hydranium/client-theia/captured-latency-detail', 'Captured RPC/LSP latency —{0}', detail);
|
|
355
|
+
case 'backend-state':
|
|
356
|
+
return nls.localize('hydranium/client-theia/captured-backend-state-detail', 'Captured backend state —{0}', detail);
|
|
357
|
+
case 'profile':
|
|
358
|
+
return nls.localize('hydranium/client-theia/captured-profile-detail', 'Captured profile —{0}', detail);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/** The captured-without-detail toast; the channel name is adopter branding, not translatable text. */
|
|
363
|
+
protected capturedChannelMessage(subject: DiagnosticsSubject): string {
|
|
364
|
+
const channelName = this.options.channelName;
|
|
365
|
+
switch (subject) {
|
|
366
|
+
case 'server-state':
|
|
367
|
+
return nls.localize(
|
|
368
|
+
'hydranium/client-theia/captured-server-state-channel',
|
|
369
|
+
'Captured server state (see the {0} output channel)',
|
|
370
|
+
channelName
|
|
371
|
+
);
|
|
372
|
+
case 'pod-memory':
|
|
373
|
+
return nls.localize(
|
|
374
|
+
'hydranium/client-theia/captured-pod-memory-channel',
|
|
375
|
+
'Captured pod memory (see the {0} output channel)',
|
|
376
|
+
channelName
|
|
377
|
+
);
|
|
378
|
+
case 'latency':
|
|
379
|
+
return nls.localize(
|
|
380
|
+
'hydranium/client-theia/captured-latency-channel',
|
|
381
|
+
'Captured RPC/LSP latency (see the {0} output channel)',
|
|
382
|
+
channelName
|
|
383
|
+
);
|
|
384
|
+
case 'backend-state':
|
|
385
|
+
return nls.localize(
|
|
386
|
+
'hydranium/client-theia/captured-backend-state-channel',
|
|
387
|
+
'Captured backend state (see the {0} output channel)',
|
|
388
|
+
channelName
|
|
389
|
+
);
|
|
390
|
+
case 'profile':
|
|
391
|
+
return nls.localize(
|
|
392
|
+
'hydranium/client-theia/captured-profile-channel',
|
|
393
|
+
'Captured profile (see the {0} output channel)',
|
|
394
|
+
channelName
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/** The failed-to-dump toast; the detail is a technical error string, safe as a parameter. */
|
|
400
|
+
protected dumpFailedMessage(subject: DiagnosticsSubject, detail: string): string {
|
|
401
|
+
switch (subject) {
|
|
402
|
+
case 'server-state':
|
|
403
|
+
return nls.localize('hydranium/client-theia/error-dump-server-state', 'Failed to dump server state: {0}', detail);
|
|
404
|
+
case 'pod-memory':
|
|
405
|
+
return nls.localize('hydranium/client-theia/error-dump-pod-memory', 'Failed to dump pod memory: {0}', detail);
|
|
406
|
+
case 'latency':
|
|
407
|
+
return nls.localize('hydranium/client-theia/error-dump-latency', 'Failed to dump RPC/LSP latency: {0}', detail);
|
|
408
|
+
case 'backend-state':
|
|
409
|
+
return nls.localize('hydranium/client-theia/error-dump-backend-state', 'Failed to dump backend state: {0}', detail);
|
|
410
|
+
case 'profile':
|
|
411
|
+
return nls.localize('hydranium/client-theia/error-dump-profile', 'Failed to dump profile: {0}', detail);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
protected writingSnapshotMessage(target: HeapSnapshotTarget): string {
|
|
416
|
+
switch (target) {
|
|
417
|
+
case 'server':
|
|
418
|
+
return nls.localize(
|
|
419
|
+
'hydranium/client-theia/writing-heap-snapshot-server',
|
|
420
|
+
'Writing server heap snapshot — this briefly pauses that process...'
|
|
421
|
+
);
|
|
422
|
+
case 'backend':
|
|
423
|
+
return nls.localize(
|
|
424
|
+
'hydranium/client-theia/writing-heap-snapshot-backend',
|
|
425
|
+
'Writing backend heap snapshot — this briefly pauses that process...'
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
protected wroteSnapshotMessage(target: HeapSnapshotTarget, filePath: string): string {
|
|
431
|
+
switch (target) {
|
|
432
|
+
case 'server':
|
|
433
|
+
return nls.localize('hydranium/client-theia/wrote-heap-snapshot-server', 'Heap snapshot (server) written to {0}', filePath);
|
|
434
|
+
case 'backend':
|
|
435
|
+
return nls.localize('hydranium/client-theia/wrote-heap-snapshot-backend', 'Heap snapshot (backend) written to {0}', filePath);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
protected writeSnapshotFailedMessage(target: HeapSnapshotTarget, detail: string): string {
|
|
440
|
+
switch (target) {
|
|
441
|
+
case 'server':
|
|
442
|
+
return nls.localize(
|
|
443
|
+
'hydranium/client-theia/error-write-heap-snapshot-server',
|
|
444
|
+
'Failed to write server heap snapshot: {0}',
|
|
445
|
+
detail
|
|
446
|
+
);
|
|
447
|
+
case 'backend':
|
|
448
|
+
return nls.localize(
|
|
449
|
+
'hydranium/client-theia/error-write-heap-snapshot-backend',
|
|
450
|
+
'Failed to write backend heap snapshot: {0}',
|
|
451
|
+
detail
|
|
452
|
+
);
|
|
453
|
+
}
|
|
231
454
|
}
|
|
232
455
|
|
|
233
456
|
protected errorMessage(error: unknown): string {
|