-
Notifications
You must be signed in to change notification settings - Fork 209
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
Autocomplete: Add bare bones statistics logging and UI #973
Conversation
vscode/src/completions/logger.ts
Outdated
@@ -110,6 +117,9 @@ export function loaded(id: string): void { | |||
// Suggested completions will not be logged immediately. Instead, we log them when we either hide | |||
// them again (they are NOT accepted) or when they ARE accepted. This way, we can calculate the | |||
// duration they were actually visible for. | |||
// | |||
// For statistics logging we start a timeout matching the READ_TIMEOUT so we can increment the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Realize this isn't a new name, but it is nice to put the units on quantities ie READ_TIMEOUT_MSEC because it can make it easier to catch some clowntown with dimensions in review.
function statisticSummary(): string { | ||
const { accepted, suggested } = statistics.getStatistics() | ||
return `📈 Suggested: ${suggested} | Accepted: ${accepted} | Acceptance rate: ${ | ||
suggested === 0 || accepted === 0 ? 'N/A' : `${((accepted / suggested) * 100).toFixed(2)}%` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could still calculate an acceptance rate with accepted === 0
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha yes of course 🤦
I often find myself wanting to know when exactly we count something as suggested vs. when we count it as accepted. Looking at the output tab is not super helpful here either so I added a small UI to the trace view.
This also adds the "infra" to support the trace view to show other views that re-render which I want to use for the section observer shortly.
I’m specifically hoping that this will help with #923.
Test plan
Screen.Recording.2023-09-07.at.15.31.10.mov