-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat: added recommendation acceptance tracking #158
feat: added recommendation acceptance tracking #158
Conversation
var telemetryMsg = TelemetryService.instance().action("component_analysis_recommendation_accepted"); | ||
telemetryMsg.property("package", this.report.getRef().name()); | ||
telemetryMsg.property("version", recommendedVersion); | ||
telemetryMsg.property(ApiService.TelemetryKeys.ECOSYSTEM.toString(), saUtils.determinePackageManagerName(file.getName())); |
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.
telemetryMsg.property(ApiService.TelemetryKeys.ECOSYSTEM.toString(), saUtils.determinePackageManagerName(file.getName())); | |
telemetryMsg.property(ApiService.TelemetryKeys.ECOSYSTEM.toString(), CAAnnotator.getPackageManager(file.getName())); |
Please use this method instead and change it to be static
. Also delete line 63.
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.
Done
telemetryMsg.property(ApiService.TelemetryKeys.PLATFORM.toString(), System.getProperty("os.name")); | ||
telemetryMsg.property(ApiService.TelemetryKeys.MANIFEST.toString(), file.getName()); | ||
telemetryMsg.property(ApiService.TelemetryKeys.RHDA_TOKEN.toString(), ApiSettingsState.getInstance().rhdaToken); | ||
apiService.setRequestProperties(file.getName()); |
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.
apiService.setRequestProperties(file.getName()); |
This method should not be called. It is only used when calling exhort-java-api
. Also delete line 62.
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.
Done.
var telemetryMsg = TelemetryService.instance().action("component_analysis_recommendation_accepted"); | ||
telemetryMsg.property("package", this.report.getRef().name()); | ||
telemetryMsg.property("version", recommendedVersion); | ||
telemetryMsg.property(ApiService.TelemetryKeys.ECOSYSTEM.toString(), saUtils.determinePackageManagerName(file.getName())); | ||
telemetryMsg.property(ApiService.TelemetryKeys.PLATFORM.toString(), System.getProperty("os.name")); | ||
telemetryMsg.property(ApiService.TelemetryKeys.MANIFEST.toString(), file.getName()); | ||
telemetryMsg.property(ApiService.TelemetryKeys.RHDA_TOKEN.toString(), ApiSettingsState.getInstance().rhdaToken); | ||
apiService.setRequestProperties(file.getName()); | ||
telemetryMsg.send(); |
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.
Please move these lines of code for telemetry to a new method in the exhort
package. Create the method in TelemetryService
or ApiService
.
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.
Done.
this.updateVersion(project, editor, file, recommendedVersion); | ||
ApiService apiService = ServiceManager.getService(ApiService.class); | ||
SaUtils saUtils = new SaUtils(); | ||
var telemetryMsg = TelemetryService.instance().action("component_analysis_recommendation_accepted"); |
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.
var telemetryMsg = TelemetryService.instance().action("component_analysis_recommendation_accepted"); | |
var telemetryMsg = TelemetryService.instance().action("recommendation-accepted"); |
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.
Done.
41bfa63
to
7a72c2e
Compare
@@ -21,4 +25,16 @@ public class TelemetryService { | |||
public static TelemetryMessageBuilder instance() { | |||
return INSTANCE.builder.get(); | |||
} | |||
|
|||
public static void sendTelemetryEvent(PsiFile file, String recommendedVersion, DependencyReport report, String actionName) { |
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.
public static void sendTelemetryEvent(PsiFile file, String recommendedVersion, DependencyReport report, String actionName) { | |
public static void sendPackageUpdateEvent(PsiFile file, String packageName, String packageVersion, String actionName) { |
I think the method name is too generic. This method only sends package and version that are changed.
Maybe, rename it to sendPackageUpdateEvent
.
The third argument can be changed to String
.
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.
done
this.updateVersion(project, editor, file, getRecommendedVersion(this.report)); | ||
String recommendedVersion = getRecommendedVersion(this.report); | ||
this.updateVersion(project, editor, file, recommendedVersion); | ||
TelemetryService.sendTelemetryEvent(file, recommendedVersion, this.report, "recommendation_accepted"); |
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.
TelemetryService.sendTelemetryEvent(file, recommendedVersion, this.report, "recommendation_accepted"); | |
TelemetryService.sendTelemetryEvent(file, recommendedVersion, this.report, "recommendation-accepted"); |
The actionName used dash instead of underscore in other scenarios.
For example:
intellij-dependency-analytics/src/main/java/org/jboss/tools/intellij/exhort/ApiService.java
Line 58 in 1b84290
var telemetryMsg = TelemetryService.instance().action("stack-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.
Initially was using the same action name as Ilona did in the VS Code extension, not sure if they should match.
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.
Done.
7a72c2e
to
8e29e72
Compare
Quality Gate passedIssues Measures |
Added "component_analysis_recommendation_accepted" event to track recommendation acceptance for telemetry.
Jira: APPENG-2312