Remove legacy telemetry code as non functional now

This commit is contained in:
Jonathan Kingston
2017-08-15 17:30:27 +01:00
parent d685a58d74
commit 57a31f7f97
16 changed files with 32 additions and 1106 deletions
@@ -234,10 +234,6 @@ const assignManager = {
browser.tabs.sendMessage(tabId, {
text: `Successfully ${actionName} site to always open in this container`
});
backgroundLogic.sendTelemetryPayload({
event: `${actionName}-container-assignment`,
userContextId: userContextId,
});
const tab = await browser.tabs.get(tabId);
this.calculateContextMenu(tab);
},
@@ -298,15 +294,7 @@ const assignManager = {
// If the user has explicitly checked "Never Ask Again" on the warning page we will send them straight there
if (neverAsk) {
browser.tabs.create({url, cookieStoreId, index});
backgroundLogic.sendTelemetryPayload({
event: "auto-reload-page-in-container",
userContextId: userContextId,
});
} else {
backgroundLogic.sendTelemetryPayload({
event: "prompt-to-reload-page-in-container",
userContextId: userContextId,
});
let confirmUrl = `${loadPage}?url=${encodeURIComponent(url)}&cookieStoreId=${cookieStoreId}`;
let currentCookieStoreId;
if (currentUserContextId) {
@@ -26,11 +26,6 @@ const backgroundLogic = {
},
async deleteContainer(userContextId) {
this.sendTelemetryPayload({
event: "delete-container",
userContextId
});
await this._closeTabs(userContextId);
await browser.contextualIdentities.remove(this.cookieStoreId(userContextId));
assignManager.deleteContainer(userContextId);
@@ -47,15 +42,8 @@ const backgroundLogic = {
this.cookieStoreId(options.userContextId),
options.params
);
this.sendTelemetryPayload({
event: "edit-container",
userContextId: options.userContextId
});
} else {
donePromise = browser.contextualIdentities.create(options.params);
this.sendTelemetryPayload({
event: "add-container"
});
}
await donePromise;
browser.runtime.sendMessage({
@@ -67,18 +55,8 @@ const backgroundLogic = {
let url = options.url || undefined;
const userContextId = ("userContextId" in options) ? options.userContextId : 0;
const active = ("nofocus" in options) ? options.nofocus : true;
const source = ("source" in options) ? options.source : null;
const cookieStoreId = backgroundLogic.cookieStoreId(userContextId);
// Only send telemetry for tabs opened by UI - i.e., not via showTabs
if (source && userContextId) {
this.sendTelemetryPayload({
"event": "open-tab",
"eventSource": source,
"userContextId": userContextId,
"clickedContainerTabCount": await identityState.containerTabCount(cookieStoreId)
});
}
// Autofocus url bar will happen in 54: https://bugzilla.mozilla.org/show_bug.cgi?id=1295072
// We can't open new tab pages, so open a blank tab. Used in tab un-hide
@@ -131,12 +109,6 @@ const backgroundLogic = {
return null;
}
this.sendTelemetryPayload({
"event": "move-tabs-to-window",
"userContextId": userContextId,
"clickedContainerTabCount": identityState.containerTabCount(userContextId),
});
const list = await identityState._matchTabsByContainer(options.cookieStoreId);
const containerState = await identityState.storageArea.get(options.cookieStoreId);
@@ -199,13 +171,6 @@ const backgroundLogic = {
},
async sortTabs() {
const containersCounts = identityState.containersCounts();
this.sendTelemetryPayload({
"event": "sort-tabs",
"shownContainersCount": containersCounts.shown,
"totalContainerTabsCount": await identityState.totalContainerTabsCount(),
"totalNonContainerTabsCount": await identityState.totalNonContainerTabsCount()
});
const windows = await browser.windows.getAll();
for (let window of windows) { // eslint-disable-line prefer-const
// First the pinned tabs, then the normal ones.
@@ -267,16 +232,6 @@ const backgroundLogic = {
return null;
}
const containersCounts = identityState.containersCounts();
this.sendTelemetryPayload({
"event": "hide-tabs",
"userContextId": userContextId,
"clickedContainerTabCount": identityState.containerTabCount(userContextId),
"shownContainersCount": containersCounts.shown,
"hiddenContainersCount": containersCounts.hidden,
"totalContainersCount": containersCounts.total
});
const containerState = await identityState.storeHidden(options.cookieStoreId);
await this._closeTabs(userContextId);
return containerState;
@@ -293,16 +248,6 @@ const backgroundLogic = {
return null;
}
const containersCounts = identityState.containersCounts();
this.sendTelemetryPayload({
"event": "show-tabs",
"userContextId": userContextId,
"clickedContainerTabCount": await identityState.containerTabCount(options.cookieStoreId),
"shownContainersCount": containersCounts.shown,
"hiddenContainersCount": containersCounts.hidden,
"totalContainersCount": containersCounts.total
});
const promises = [];
const containerState = await identityState.storageArea.get(options.cookieStoreId);
@@ -322,16 +267,6 @@ const backgroundLogic = {
return await identityState.storageArea.set(options.cookieStoreId, containerState);
},
sendTelemetryPayload(message = {}) {
if (!message.event) {
throw new Error("Missing event name for telemetry");
}
message.method = "sendTelemetryPayload";
//TODO decide where this goes
// browser.runtime.sendMessage(message);
},
cookieStoreId(userContextId) {
return `firefox-container-${userContextId}`;
},
@@ -38,9 +38,6 @@ const messageHandler = {
return assignManager._setOrRemoveAssignment(tab.id, m.url, m.userContextId, m.value);
});
break;
case "sendTelemetryPayload":
// TODO
break;
case "sortTabs":
backgroundLogic.sortTabs();
break;
@@ -53,9 +50,6 @@ const messageHandler = {
case "checkIncompatibleAddons":
// TODO
break;
case "getShieldStudyVariation":
// TODO
break;
case "moveTabsToWindow":
response = backgroundLogic.moveTabsToWindow({
cookieStoreId: m.cookieStoreId
@@ -34,20 +34,10 @@ const tabPageCounter = {
return;
}
if (why === "user-closed-tab" && this.counters[tabId].tab) {
backgroundLogic.sendTelemetryPayload({
event: "page-requests-completed-per-tab",
userContextId: this.counters[tabId].tab.cookieStoreId,
pageRequestCount: this.counters[tabId].tab.pageRequests
});
// When we send the ping because the user closed the tab,
// delete both the 'tab' and 'activity' counters
delete this.counters[tabId];
} else if (why === "user-went-idle" && this.counters[tabId].activity) {
backgroundLogic.sendTelemetryPayload({
event: "page-requests-completed-per-activity",
userContextId: this.counters[tabId].activity.cookieStoreId,
pageRequestCount: this.counters[tabId].activity.pageRequests
});
// When we send the ping because the user went idle,
// only reset the 'activity' counter
this.counters[tabId].activity = {