Backed out changeset 76c0e3be4fe8 (bug 1159043) for test_telemetry.html failures.

This commit is contained in:
Ryan VanderMeulen 2015-05-22 14:55:38 -04:00
parent ee96e79556
commit 5747a3f5ff
5 changed files with 4 additions and 199 deletions

View File

@ -280,28 +280,6 @@ Telemetry.prototype = {
}
},
/**
* Log a value to a keyed histogram.
*
* @param {String} histogramId
* Histogram in which the data is to be stored.
* @param {String} key
* The key within the single histogram.
* @param value
* Value to store.
*/
logKeyed: function(histogramId, key, value) {
if (histogramId) {
try {
let histogram = Services.telemetry.getKeyedHistogramById(histogramId);
histogram.add(key, value);
} catch(e) {
dump("Warning: An attempt was made to write to the " + histogramId +
" histogram, which is not defined in Histograms.json\n");
}
}
},
/**
* Log info about usage once per browser version. This allows us to discover
* how many individual users are using our tools for each browser version.

View File

@ -183,7 +183,6 @@ let AppManager = exports.AppManager = {
// first.
this._appsFront = front;
this._listTabsResponse = response;
this._recordRuntimeInfo();
this.update("runtime-global-actors");
})
.then(() => {
@ -193,7 +192,6 @@ let AppManager = exports.AppManager = {
});
} else {
this._listTabsResponse = response;
this._recordRuntimeInfo();
this.update("runtime-global-actors");
}
});
@ -500,31 +498,6 @@ let AppManager = exports.AppManager = {
return deferred.promise;
},
_recordRuntimeInfo: Task.async(function*() {
if (!this.connected) {
return;
}
let runtime = this.selectedRuntime;
this._telemetry.logKeyed("DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_TYPE",
runtime.type || "UNKNOWN", true);
this._telemetry.logKeyed("DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_ID",
runtime.id || "unknown", true);
if (!this.deviceFront) {
return;
}
let d = yield this.deviceFront.getDescription();
this._telemetry.logKeyed("DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_PROCESSOR",
d.processor, true);
this._telemetry.logKeyed("DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_OS",
d.os, true);
this._telemetry.logKeyed("DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_PLATFORM_VERSION",
d.platformversion, true);
this._telemetry.logKeyed("DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_APP_TYPE",
d.apptype, true);
this._telemetry.logKeyed("DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_VERSION",
d.version, true);
}),
isMainProcessDebuggable: function() {
// Fx <39 exposes chrome tab actors on RootActor
// Fx >=39 exposes a dedicated actor via getProcess request

View File

@ -35,18 +35,11 @@
this.telemetryInfo[histogramId].push(value);
}
}
Telemetry.prototype._oldlogKeyed = Telemetry.prototype.logKeyed;
Telemetry.prototype.logKeyed = function(histogramId, key, value) {
// This simple reduction is enough to test WebIDE's usage
this.log(`${histogramId}|${key}`, value);
}
}
function resetTelemetry() {
Telemetry.prototype.log = Telemetry.prototype._oldlog;
Telemetry.prototype.logKeyed = Telemetry.prototype._oldlogKeyed;
delete Telemetry.prototype._oldlog;
delete Telemetry.prototype._oldlogKeyed;
delete Telemetry.prototype.telemetryInfo;
}
@ -83,7 +76,7 @@
};
win.AppManager.runtimeList.wifi.push(wifi);
let sim = new _SimulatorRuntime({ id: "fakeSimulator" });
let sim = new _SimulatorRuntime("fakeSimulator");
// Use local pipe instead
sim.connect = function(connection) {
ok(connection, win.AppManager.connection, "connection is valid");
@ -146,8 +139,6 @@
ok(win.document.querySelector("window").className, "busy", "UI is busy");
yield win.UI._busyPromise;
is(Object.keys(DebuggerServer._connections).length, 1, "Connected");
// Logging runtime info needs to use the device actor
yield waitForUpdate(win, "runtime-global-actors");
});
}
@ -207,48 +198,6 @@
});
ok(okay, "All " + histId + " actions were skipped");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_TYPE|USB") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_TYPE|WIFI") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_TYPE|SIMULATOR") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_TYPE|REMOTE") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_TYPE|LOCAL") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_TYPE|OTHER") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_ID|fakeUSB") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_ID|fakeWiFi") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_ID|fakeSimulator") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_ID|unknown") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_ID|local") {
is(value.length, 2, histId + " has 2 connection results");
} else if (histId.startsWith("DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_PROCESSOR")) {
let processor = histId.split("|")[1];
is(processor, Services.appinfo.XPCOMABI.split("-")[0], "Found runtime processor");
is(value.length, 6, histId + " has 6 connection results");
} else if (histId.startsWith("DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_OS")) {
let os = histId.split("|")[1];
is(os, Services.appinfo.OS, "Found runtime OS");
is(value.length, 6, histId + " has 6 connection results");
} else if (histId.startsWith("DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_PLATFORM_VERSION")) {
let platformversion = histId.split("|")[1];
is(platformversion, Services.appinfo.platformVersion, "Found runtime platform version");
is(value.length, 6, histId + " has 6 connection results");
} else if (histId.startsWith("DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_APP_TYPE")) {
let apptype = histId.split("|")[1];
is(apptype, "firefox", "Found runtime app type");
is(value.length, 6, histId + " has 6 connection results");
} else if (histId.startsWith("DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_VERSION")) {
let version = histId.split("|")[1];
is(version, Services.appinfo.version, "Found runtime version");
is(value.length, 6, histId + " has 6 connection results");
} else {
ok(false, "Unexpected " + histId + " was logged");
}
@ -261,7 +210,7 @@
let win;
SimpleTest.registerCleanupFunction(() => {
return Task.spawn(function*() {
Task.spawn(function*() {
if (win) {
yield closeWebIDE(win);
}
@ -308,7 +257,6 @@
yield connectToRuntime(win, docRuntime, "other", 2 /* other */);
yield waitForTime(TOOL_DELAY);
yield closeWebIDE(win);
win = null;
checkResults();

View File

@ -35,18 +35,11 @@
this.telemetryInfo[histogramId].push(value);
}
}
Telemetry.prototype._oldlogKeyed = Telemetry.prototype.logKeyed;
Telemetry.prototype.logKeyed = function(histogramId, key, value) {
// This simple reduction is enough to test WebIDE's usage
this.log(`${histogramId}|${key}`, value);
}
}
function resetTelemetry() {
Telemetry.prototype.log = Telemetry.prototype._oldlog;
Telemetry.prototype.logKeyed = Telemetry.prototype._oldlogKeyed;
delete Telemetry.prototype._oldlog;
delete Telemetry.prototype._oldlogKeyed;
delete Telemetry.prototype.telemetryInfo;
}
@ -83,7 +76,7 @@
};
win.AppManager.runtimeList.wifi.push(wifi);
let sim = new _SimulatorRuntime({ id: "fakeSimulator" });
let sim = new _SimulatorRuntime("fakeSimulator");
// Use local pipe instead
sim.connect = function(connection) {
ok(connection, win.AppManager.connection, "connection is valid");
@ -146,8 +139,6 @@
ok(win.document.querySelector("window").className, "busy", "UI is busy");
yield win.UI._busyPromise;
is(Object.keys(DebuggerServer._connections).length, 1, "Connected");
// Logging runtime info needs to use the device actor
yield waitForUpdate(win, "runtime-global-actors");
});
}
@ -207,48 +198,6 @@
});
ok(okay, "All " + histId + " actions were skipped");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_TYPE|USB") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_TYPE|WIFI") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_TYPE|SIMULATOR") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_TYPE|REMOTE") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_TYPE|LOCAL") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_TYPE|OTHER") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_ID|fakeUSB") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_ID|fakeWiFi") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_ID|fakeSimulator") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_ID|unknown") {
is(value.length, 1, histId + " has 1 connection results");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_ID|local") {
is(value.length, 2, histId + " has 2 connection results");
} else if (histId.startsWith("DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_PROCESSOR")) {
let processor = histId.split("|")[1];
is(processor, Services.appinfo.XPCOMABI.split("-")[0], "Found runtime processor");
is(value.length, 6, histId + " has 6 connection results");
} else if (histId.startsWith("DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_OS")) {
let os = histId.split("|")[1];
is(os, Services.appinfo.OS, "Found runtime OS");
is(value.length, 6, histId + " has 6 connection results");
} else if (histId.startsWith("DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_PLATFORM_VERSION")) {
let platformversion = histId.split("|")[1];
is(platformversion, Services.appinfo.platformVersion, "Found runtime platform version");
is(value.length, 6, histId + " has 6 connection results");
} else if (histId.startsWith("DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_APP_TYPE")) {
let apptype = histId.split("|")[1];
is(apptype, "firefox", "Found runtime app type");
is(value.length, 6, histId + " has 6 connection results");
} else if (histId.startsWith("DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_VERSION")) {
let version = histId.split("|")[1];
is(version, Services.appinfo.version, "Found runtime version");
is(value.length, 6, histId + " has 6 connection results");
} else {
ok(false, "Unexpected " + histId + " was logged");
}
@ -261,7 +210,7 @@
let win;
SimpleTest.registerCleanupFunction(() => {
return Task.spawn(function*() {
Task.spawn(function*() {
if (win) {
yield closeWebIDE(win);
}
@ -305,7 +254,6 @@
yield connectToRuntime(win, "other", 2 /* other */);
yield waitForTime(TOOL_DELAY);
yield closeWebIDE(win);
win = null;
checkResults();

View File

@ -6642,48 +6642,6 @@
"kind": "boolean",
"description": "Was WebIDE's debug button used during this runtime connection?"
},
"DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_TYPE": {
"expires_in_version": "never",
"kind": "boolean",
"keyed": true,
"description": "What runtime type did WebIDE connect to?"
},
"DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_ID": {
"expires_in_version": "never",
"kind": "boolean",
"keyed": true,
"description": "What runtime ID did WebIDE connect to?"
},
"DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_PROCESSOR": {
"expires_in_version": "never",
"kind": "boolean",
"keyed": true,
"description": "What runtime processor did WebIDE connect to?"
},
"DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_OS": {
"expires_in_version": "never",
"kind": "boolean",
"keyed": true,
"description": "What runtime OS did WebIDE connect to?"
},
"DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_PLATFORM_VERSION": {
"expires_in_version": "never",
"kind": "boolean",
"keyed": true,
"description": "What runtime platform version did WebIDE connect to?"
},
"DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_APP_TYPE": {
"expires_in_version": "never",
"kind": "boolean",
"keyed": true,
"description": "What runtime app type did WebIDE connect to?"
},
"DEVTOOLS_WEBIDE_CONNECTED_RUNTIME_VERSION": {
"expires_in_version": "never",
"kind": "boolean",
"keyed": true,
"description": "What runtime version did WebIDE connect to?"
},
"DEVTOOLS_OS_ENUMERATED_PER_USER": {
"expires_in_version": "never",
"kind": "enumerated",