-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
[Editor] Add some telemetry to know how often the editing features are used (bug 1782254) #15264
Conversation
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.
I can't help but wonder if we could perhaps reduce the amount of code needed, primarily in the src/display/editor/
-folder, in order pass the necessary editor-type onto the viewer?
More specifically, in addition to the code that you're adding to handle saving/printing, we might be able to use the AnnotationStorage
along these lines:
diff --git a/src/display/annotation_storage.js b/src/display/annotation_storage.js
index 6b558f8f0..eb52a4823 100644
--- a/src/display/annotation_storage.js
+++ b/src/display/annotation_storage.js
@@ -31,6 +31,8 @@ class AnnotationStorage {
// can have undesirable effects.
this.onSetModified = null;
this.onResetModified = null;
+
+ this.onAnnotationEditor = null;
}
/**
@@ -100,6 +102,13 @@ class AnnotationStorage {
if (modified) {
this.#setModified();
}
+
+ if (
+ value instanceof AnnotationEditor &&
+ typeof this.onAnnotationEditor === "function"
+ ) {
+ this.onAnnotationEditor(value.constructor._type);
+ }
}
/**
diff --git a/web/app.js b/web/app.js
index 8b4e6265e..fd05a99aa 100644
--- a/web/app.js
+++ b/web/app.js
@@ -1734,6 +1734,12 @@ const PDFViewerApplication = {
delete this._annotationStorageModified;
}
};
+ annotationStorage.onAnnotationEditor = typeStr => {
+ this.externalServices.reportTelemetry({
+ type: "editing",
+ data: { type: typeStr },
+ })
+ };
},
setInitialView(
It's definitely more clever than my solution but it adds a kind of invisible dependency between |
To me it's not that much different from the pre-existing callback-functions available in the |
…e used (bug 1782254)
b683b9a
to
94f57e5
Compare
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/f665a041f21edaf/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/73c591736ec6dde/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/f665a041f21edaf/output.txt Total script time: 4.67 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/73c591736ec6dde/output.txt Total script time: 10.09 mins
|
No description provided.