Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track the LSP request data from syntax server #3278

Merged
merged 3 commits into from
Oct 4, 2023

Conversation

testforstephen
Copy link
Collaborator

The syntax server lives until the standard server becomes service ready. The completion performance from syntax server is also part of the end-to-end experience of completion feature. So adding a new property to indicate whether the LSP track event originates from the syntax server.

@testforstephen
Copy link
Collaborator Author

@rgrunber Could you consider whether you want to measure the completion performance separately for the syntax server and the standard server?

export function registerCodeCompletionTelemetryListener() {
apiManager.getApiInstance().onDidRequestEnd((traceEvent: TraceEvent) => {
if (traceEvent.type === CompletionRequest.method) {
// Exclude the invalid completion requests.
if (!traceEvent.resultLength) {
return;
}
const props = {
duration: Math.round(traceEvent.duration * 100) / 100,
resultLength: traceEvent.resultLength || 0,
error: !!traceEvent.error,
};
return Telemetry.sendTelemetry(Telemetry.COMPLETION_EVENT, props);
}
});
}

@rgrunber
Copy link
Member

rgrunber commented Sep 7, 2023

You're right, it makes sense to add a field in props for fromSyntaxServer.

Copy link
Member

@rgrunber rgrunber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. I guess the final thing is just to add it as a property to the sendTelemetry call for textCompletion

src/TracingLanguageClient.ts Outdated Show resolved Hide resolved
src/extension.api.ts Outdated Show resolved Hide resolved
@testforstephen
Copy link
Collaborator Author

registerCodeCompletionTelemetryListener();

Another issue is that you only register the completion telemetry listener when the standard server becomes service ready. This means that it will not receive any events from the syntax server, because the syntax server is already closed at this stage.

@rgrunber
Copy link
Member

rgrunber commented Sep 8, 2023

registerCodeCompletionTelemetryListener();

Another issue is that you only register the completion telemetry listener when the standard server becomes service ready. This means that it will not receive any events from the syntax server, because the syntax server is already closed at this stage.

Yup. #3165 (review) . I think we can just move the registration to somewhere outside the standard/syntax code. Maybe after

resolve(apiManager.getApiInstance());
since it's just prior to initializing the syntax server ?

- Move registerCodeCompletionTelemetryListener just before language
  client is initialized

Signed-off-by: Roland Grunberg <[email protected]>
@rgrunber rgrunber merged commit fa82082 into redhat-developer:master Oct 4, 2023
2 checks passed
@testforstephen testforstephen deleted the jinbo_track branch October 5, 2023 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants