-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Sending Analytics Data for file Operation and LSP features #14683
Conversation
src/editor/EditorStatusBar.js
Outdated
|
||
HealthLogger.sendAnalyticsData( | ||
"usagelanguageChange" + filelanguageName + fileType, | ||
"usage", |
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.
@niteskum can all analytics strings be moved to another file as variables and use that variable everywhere needed?
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.
moved all common strings constant to HealthLogger.js as earlier all constants were defined in this file
if (!docToSave) { | ||
return; | ||
} | ||
var fileType = docToSave.language ? docToSave.language._name : ""; |
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.
@SnchitGrover Do we want an empty string here or something like "unknown"? Empty strings are sometimes treated as null values while serialization depending on platform. Depends on your use case.
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.
@niteskum Is there ever a possibility of not having the language
property in a document object?
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.
@shubhsnov I think document will always have language. but since file save is critical operation , don't want to leave any space in code to trigger exception so I am doing null check.
src/utils/HealthLogger.js
Outdated
if(fileSize === -1) { | ||
subType = ""; | ||
} | ||
if(fileSize < 10) { |
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.
shouldn't the check be <=? if the file size is 10kb, it will log in 10_50KB range.
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.
fixed
LGTM |
@shubhsnov @SnchitGrover please review
@narayani28