Bug 1203624 - Measure view source usage. r=mconley p=ally

This commit is contained in:
J. Ryan Stinnett 2015-09-14 18:42:01 -05:00
parent 2fedad2648
commit 568fb76791
2 changed files with 28 additions and 1 deletions

View File

@ -7352,6 +7352,24 @@
"n_buckets": 20,
"description": "The amount of time spent in a specific performance tool view, keyed by view name (waterfall, js-calltree, js-flamegraph, etc)."
},
"VIEW_SOURCE_IN_BROWSER_OPENED_BOOLEAN": {
"alert_emails": ["mozilla-dev-developer-tools@lists.mozilla.org", "jryans@mozilla.com"],
"expires_in_version": "53",
"kind": "boolean",
"description": "How many times has view source in browser / tab been opened?"
},
"VIEW_SOURCE_IN_WINDOW_OPENED_BOOLEAN": {
"alert_emails": ["mozilla-dev-developer-tools@lists.mozilla.org", "jryans@mozilla.com"],
"expires_in_version": "53",
"kind": "boolean",
"description": "How many times has view source in a new window been opened?"
},
"VIEW_SOURCE_EXTERNAL_RESULT_BOOLEAN": {
"alert_emails": ["mozilla-dev-developer-tools@lists.mozilla.org", "jryans@mozilla.com"],
"expires_in_version": "53",
"kind": "boolean",
"description": "How many times has view source in an external editor been opened, and did it succeed?"
},
"BROWSER_IS_USER_DEFAULT": {
"expires_in_version": "never",
"kind": "boolean",

View File

@ -88,6 +88,9 @@ var gViewSourceUtils = {
* The line number to focus on once the source is loaded.
*/
viewSourceInBrowser: function(aArgs) {
Services.telemetry
.getHistogramById("VIEW_SOURCE_IN_BROWSER_OPENED_BOOLEAN")
.add(true);
let viewSourceBrowser = new ViewSourceBrowser(aArgs.viewSourceBrowser);
viewSourceBrowser.loadViewSource(aArgs);
},
@ -156,6 +159,9 @@ var gViewSourceUtils = {
} catch (ex) {
}
}
Services.telemetry
.getHistogramById("VIEW_SOURCE_IN_WINDOW_OPENED_BOOLEAN")
.add(true);
openDialog("chrome://global/content/viewSource.xul",
"_blank",
"all,dialog=no",
@ -340,7 +346,10 @@ var gViewSourceUtils = {
// Calls the callback, keeping in mind undefined or null values.
handleCallBack: function(aCallBack, result, data)
{
// ifcallback is undefined, default to the internal viewer
Services.telemetry
.getHistogramById("VIEW_SOURCE_EXTERNAL_RESULT_BOOLEAN")
.add(result);
// if callback is undefined, default to the internal viewer
if (aCallBack === undefined) {
this.internalViewerFallback(result, data);
} else if (aCallBack) {