Rename id to traceId and add pending responses value.

This commit is contained in:
Dirk Baeumer
2025-05-14 18:19:13 +02:00
parent c2b5fd631b
commit 9afa156c10
2 changed files with 6 additions and 5 deletions

View File

@@ -36,10 +36,10 @@ export class VSCodeTelemetryReporter implements TelemetryReporter {
reporter.postEventObj(eventName, properties);
}
public logTraceEvent(point: string, id: string, data?: string): void {
const event: { point: string; id: string; data?: string | undefined } = {
public logTraceEvent(point: string, traceId: string, data?: string): void {
const event: { point: string; traceId: string; data?: string | undefined } = {
point,
id
traceId
};
if (data) {
event.data = data;
@@ -52,7 +52,7 @@ export class VSCodeTelemetryReporter implements TelemetryReporter {
"${TypeScriptCommonProperties}"
],
"point" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "comment": "The trace point." },
"id" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "comment": "The traceId is used to correlate the request with other trace points." },
"traceId" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "comment": "The traceId is used to correlate the request with other trace points." },
"data": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "comment": "Additional data" }
}
*/

View File

@@ -271,7 +271,8 @@ export class SingleTsServer extends Disposable implements ITypeScriptServer {
this._requestQueue.enqueue(requestInfo);
if (args && typeof (args as any).$traceId === 'string') {
const queueLength = this._requestQueue.length - 1;
this._telemetryReporter.logTraceEvent('TSServer.enqueueRequest', (args as any).$traceId, JSON.stringify({ command, queueLength }));
const pendingResponses = this._pendingResponses.size;
this._telemetryReporter.logTraceEvent('TSServer.enqueueRequest', (args as any).$traceId, JSON.stringify({ command, queueLength, pendingResponses }));
}
this.sendNextRequests();