-
Notifications
You must be signed in to change notification settings - Fork 1
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
FIX (Extension) @W-16733527@ Additional telemetry for apex guru #139
Conversation
src/apexguru/apex-guru-service.ts
Outdated
duration: (Date.now() - startTime).toString() | ||
duration: (Date.now() - startTime).toString(), | ||
violationsCount: ruleResult.violations.length.toString(), | ||
violationsWithSuggestedCode: getViolationsWithSuggestions(ruleResult).toString() |
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.
Should this be violationsWithSuggestedCodeCount
to match violationsCount
?
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.
Yes! that sounds better. I'll rename it.
const range = this.diagnostic.range; // Assuming the range is the location of the existing code in the document | ||
const diagnosticStartLine = new vscode.Position(range.start.line, range.start.character); | ||
edit.insert(document.uri, diagnosticStartLine, suggestedCode + '\n'); |
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.
If I do this, there is no way to get the telemetry on how many times users clicked on the "include apex guru suggestions" quick-fix. I had to to make this a command and add it to the action and I can report telemetry on that command.
const edit = new vscode.WorkspaceEdit(); | ||
edit.insert(document.uri, position, suggestedCode); | ||
await vscode.workspace.applyEdit(edit); | ||
TelemetryService.sendCommandEvent(Constants.TELEM_SUCCESSFUL_APEX_GURU_FILE_ANALYSIS, { |
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.
New telemetry to get number of times users used the suggestions ApexGuru provided, along with the number of lines that were included.
…ress review comments
This gets the following telemetry:
Number of antipatterns count
Number of violations with suggestions
Number of quick-fix accepted