Skip to content

Commit f990725

Browse files
authored
Move individual duration properties into a performanceData object (#36210)
1 parent f220e62 commit f990725

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

src/server/protocol.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,15 @@ namespace ts.server.protocol {
237237
*/
238238
metadata?: unknown;
239239

240+
/* @internal */
241+
performanceData?: PerformanceData;
242+
}
243+
244+
/* @internal */
245+
export interface PerformanceData {
240246
/**
241247
* Time spent updating the program graph, in milliseconds.
242248
*/
243-
/* @internal */
244249
updateGraphDurationMs?: number;
245250
}
246251

src/server/session.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,11 @@ namespace ts.server {
807807
command: cmdName,
808808
request_seq: reqSeq,
809809
success,
810-
updateGraphDurationMs: this.updateGraphDurationMs,
810+
performanceData: !this.updateGraphDurationMs
811+
? undefined
812+
: {
813+
updateGraphDurationMs: this.updateGraphDurationMs,
814+
},
811815
};
812816

813817
if (success) {

src/testRunner/unittests/tsserver/session.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ namespace ts.server {
101101
message: "Unrecognized JSON command: foobar",
102102
request_seq: 0,
103103
success: false,
104-
updateGraphDurationMs: undefined,
104+
performanceData: undefined,
105105
};
106106
expect(lastSent).to.deep.equal(expected);
107107
});
@@ -128,7 +128,7 @@ namespace ts.server {
128128
request_seq: 0,
129129
seq: 0,
130130
body: undefined,
131-
updateGraphDurationMs: undefined,
131+
performanceData: undefined,
132132
});
133133
});
134134
it("should handle literal types in request", () => {
@@ -329,7 +329,7 @@ namespace ts.server {
329329
request_seq: 0,
330330
seq: 0,
331331
body: undefined,
332-
updateGraphDurationMs: undefined,
332+
performanceData: undefined,
333333
});
334334
});
335335
});
@@ -420,7 +420,7 @@ namespace ts.server {
420420
command,
421421
body,
422422
success: true,
423-
updateGraphDurationMs: undefined,
423+
performanceData: undefined,
424424
});
425425
});
426426
});
@@ -540,7 +540,7 @@ namespace ts.server {
540540
command,
541541
body,
542542
success: true,
543-
updateGraphDurationMs: undefined,
543+
performanceData: undefined,
544544
});
545545
});
546546
it("can add and respond to new protocol handlers", () => {

0 commit comments

Comments
 (0)