mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 1214352 - Add telemetry for Scratchpad as top level window. r=jryans,p=bsmedberg
This commit is contained in:
parent
dd4512a3dd
commit
5a1faaaf7f
@ -15,6 +15,10 @@ const SCRATCHPAD_WINDOW_URL = "chrome://devtools/content/scratchpad/scratchpad.x
|
|||||||
const SCRATCHPAD_WINDOW_FEATURES = "chrome,titlebar,toolbar,centerscreen,resizable,dialog=no";
|
const SCRATCHPAD_WINDOW_FEATURES = "chrome,titlebar,toolbar,centerscreen,resizable,dialog=no";
|
||||||
|
|
||||||
Cu.import("resource://gre/modules/Services.jsm");
|
Cu.import("resource://gre/modules/Services.jsm");
|
||||||
|
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||||
|
|
||||||
|
const Telemetry = require("devtools/client/shared/telemetry");
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ScratchpadManager object opens new Scratchpad windows and manages the state
|
* The ScratchpadManager object opens new Scratchpad windows and manages the state
|
||||||
@ -26,6 +30,8 @@ this.ScratchpadManager = {
|
|||||||
_nextUid: 1,
|
_nextUid: 1,
|
||||||
_scratchpads: [],
|
_scratchpads: [],
|
||||||
|
|
||||||
|
_telemetry: new Telemetry(),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the saved states of open scratchpad windows. Called by
|
* Get the saved states of open scratchpad windows. Called by
|
||||||
* session restore.
|
* session restore.
|
||||||
@ -125,6 +131,12 @@ this.ScratchpadManager = {
|
|||||||
let win = Services.ww.openWindow(null, SCRATCHPAD_WINDOW_URL, "_blank",
|
let win = Services.ww.openWindow(null, SCRATCHPAD_WINDOW_URL, "_blank",
|
||||||
SCRATCHPAD_WINDOW_FEATURES, params);
|
SCRATCHPAD_WINDOW_FEATURES, params);
|
||||||
|
|
||||||
|
this._telemetry.toolOpened("scratchpad-window");
|
||||||
|
let onClose = () => {
|
||||||
|
this._telemetry.toolClosed("scratchpad-window");
|
||||||
|
};
|
||||||
|
win.addEventListener("unload", onClose);
|
||||||
|
|
||||||
// Only add the shutdown observer if we've opened a scratchpad window.
|
// Only add the shutdown observer if we've opened a scratchpad window.
|
||||||
ShutdownObserver.init();
|
ShutdownObserver.init();
|
||||||
|
|
||||||
|
@ -175,6 +175,11 @@ Telemetry.prototype = {
|
|||||||
userHistogram: "DEVTOOLS_SCRATCHPAD_OPENED_PER_USER_FLAG",
|
userHistogram: "DEVTOOLS_SCRATCHPAD_OPENED_PER_USER_FLAG",
|
||||||
timerHistogram: "DEVTOOLS_SCRATCHPAD_TIME_ACTIVE_SECONDS"
|
timerHistogram: "DEVTOOLS_SCRATCHPAD_TIME_ACTIVE_SECONDS"
|
||||||
},
|
},
|
||||||
|
"scratchpad-window": {
|
||||||
|
histogram: "DEVTOOLS_SCRATCHPAD_WINDOW_OPENED_BOOLEAN",
|
||||||
|
userHistogram: "DEVTOOLS_SCRATCHPAD_WINDOW_OPENED_PER_USER_FLAG",
|
||||||
|
timerHistogram: "DEVTOOLS_SCRATCHPAD_WINDOW_TIME_ACTIVE_SECONDS"
|
||||||
|
},
|
||||||
responsive: {
|
responsive: {
|
||||||
histogram: "DEVTOOLS_RESPONSIVE_OPENED_BOOLEAN",
|
histogram: "DEVTOOLS_RESPONSIVE_OPENED_BOOLEAN",
|
||||||
userHistogram: "DEVTOOLS_RESPONSIVE_OPENED_PER_USER_FLAG",
|
userHistogram: "DEVTOOLS_RESPONSIVE_OPENED_PER_USER_FLAG",
|
||||||
|
@ -6868,6 +6868,13 @@
|
|||||||
"kind": "boolean",
|
"kind": "boolean",
|
||||||
"description": "How many times has the devtool's Scratchpad been opened via the toolbox button?"
|
"description": "How many times has the devtool's Scratchpad been opened via the toolbox button?"
|
||||||
},
|
},
|
||||||
|
"DEVTOOLS_SCRATCHPAD_WINDOW_OPENED_BOOLEAN": {
|
||||||
|
"alert_emails": ["dev-developer-tools@lists.mozilla.org"],
|
||||||
|
"expires_in_version": "50",
|
||||||
|
"kind": "boolean",
|
||||||
|
"description": "How many times has the devtool's Scratchpad standalone window been opened?",
|
||||||
|
"bug_numbers": [1214352]
|
||||||
|
},
|
||||||
"DEVTOOLS_RESPONSIVE_OPENED_BOOLEAN": {
|
"DEVTOOLS_RESPONSIVE_OPENED_BOOLEAN": {
|
||||||
"expires_in_version": "never",
|
"expires_in_version": "never",
|
||||||
"kind": "boolean",
|
"kind": "boolean",
|
||||||
@ -7044,6 +7051,13 @@
|
|||||||
"kind": "flag",
|
"kind": "flag",
|
||||||
"description": "How many users have opened the devtool's Scratchpad been opened via the toolbox button?"
|
"description": "How many users have opened the devtool's Scratchpad been opened via the toolbox button?"
|
||||||
},
|
},
|
||||||
|
"DEVTOOLS_SCRATCHPAD_WINDOW_OPENED_PER_USER_FLAG": {
|
||||||
|
"alert_emails": ["dev-developer-tools@lists.mozilla.org"],
|
||||||
|
"expires_in_version": "50",
|
||||||
|
"kind": "flag",
|
||||||
|
"description": "How many users have opened the devtool's Scratchpad standalone window been opened?",
|
||||||
|
"bug_numbers": [1214352]
|
||||||
|
},
|
||||||
"DEVTOOLS_RESPONSIVE_OPENED_PER_USER_FLAG": {
|
"DEVTOOLS_RESPONSIVE_OPENED_PER_USER_FLAG": {
|
||||||
"expires_in_version": "never",
|
"expires_in_version": "never",
|
||||||
"kind": "flag",
|
"kind": "flag",
|
||||||
@ -7266,6 +7280,15 @@
|
|||||||
"n_buckets": 100,
|
"n_buckets": 100,
|
||||||
"description": "How long has Scratchpad been active (seconds)"
|
"description": "How long has Scratchpad been active (seconds)"
|
||||||
},
|
},
|
||||||
|
"DEVTOOLS_SCRATCHPAD_WINDOW_TIME_ACTIVE_SECONDS": {
|
||||||
|
"alert_emails": ["dev-developer-tools@lists.mozilla.org"],
|
||||||
|
"expires_in_version": "50",
|
||||||
|
"kind": "exponential",
|
||||||
|
"high": "10000000",
|
||||||
|
"n_buckets": 100,
|
||||||
|
"description": "How long has Scratchpad standalone window been active (seconds)",
|
||||||
|
"bug_numbers": [1214352]
|
||||||
|
},
|
||||||
"DEVTOOLS_RESPONSIVE_TIME_ACTIVE_SECONDS": {
|
"DEVTOOLS_RESPONSIVE_TIME_ACTIVE_SECONDS": {
|
||||||
"expires_in_version": "never",
|
"expires_in_version": "never",
|
||||||
"kind": "exponential",
|
"kind": "exponential",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user