Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Adding Analytics logging for JSRefactor, Live Preview, Quick Edit and more features #14253

Conversation

sobisht
Copy link
Collaborator

@sobisht sobisht commented Apr 25, 2018

This PR is related to adding analytics log for following features in brackets:

  1. JSRefactor:
  • Rename
  • TryCatch
  • WrapInCondition
  • ConvertToFunction
  • CreateGetterSetter
  • ExtractToVariable
  • ExtractToFunction
  1. QuickEdit: open

  2. QuickDoc:

  • Open
  • ReadMore
  1. Live Preview: Open

  2. Project Settings: Edit in url

  3. MultiCursor: Use

ping @swmitra @navch

@@ -96,7 +96,8 @@ define(function LiveDevelopment(require, exports, module) {
StringUtils = require("utils/StringUtils"),
UserServer = require("LiveDevelopment/Servers/UserServer").UserServer,
WebSocketTransport = require("LiveDevelopment/transports/WebSocketTransport"),
PreferencesManager = require("preferences/PreferencesManager");
PreferencesManager = require("preferences/PreferencesManager"),
HealthLogger = brackets.getModule("utils/HealthLogger");
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use require here

"usage",
"livePreview",
"open",
""
Copy link
Contributor

Choose a reason for hiding this comment

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

This is an optional param no need to send empty string.

/**
* Send analytics data for Quick Doc "readMore" action
*
* @return {type} [[Description]]
Copy link
Contributor

Choose a reason for hiding this comment

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

fill type and Description field in doc comment.

}
if (eventName) {
// Send analytics data for refactoring
HealthLogger.sendAnalyticsData(
Copy link
Contributor

Choose a reason for hiding this comment

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

We are not even checking whether we are in js context or not? These commands are available in all type of files. Do we just want capture click on the menu or successful usage of this feature?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added the check for JS context.

@@ -196,6 +197,14 @@ define(function (require, exports, module) {
return null;
}

//Send analytics data for Quick Edit open
HealthLogger.sendAnalyticsData(
Copy link
Contributor

Choose a reason for hiding this comment

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

Again do we are just capturing quick edit performed. Are we interested in errors which we get in this operation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we just capture logging when quick edit is performed.

// Send analytics data for Quick Doc open
HealthLogger.sendAnalyticsData(
"cssQuickDoc",
"usage",
Copy link
Contributor

Choose a reason for hiding this comment

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

2nd param is event category? usage might not be the correct word. feature name should be there something like quickedit, multicursor, refactor etc

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@SnchitGrover would be able to clarify this.

@navch
Copy link
Contributor

navch commented Apr 25, 2018

Just one more question @sobisht
What is going to happen, if we are just running tests?

@sobisht
Copy link
Collaborator Author

sobisht commented Apr 27, 2018

@navch Since unit tests will call the entry functions. Logging will be sent for the unit tests also.

This item will be taken care in different PR.

Copy link
Contributor

@navch navch left a comment

Choose a reason for hiding this comment

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

Thanks @sobisht for this PR. I have restarted the build.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants