QA/Telemetry/BrowserConsoleCommands: Difference between revisions
Jump to navigation
Jump to search
| Line 11: | Line 11: | ||
* '''Refresh Experiment Manifest Manually''' | * '''Refresh Experiment Manifest Manually''' | ||
** automatically update/refresh the current experiment manifest | ** automatically update/refresh the current experiment manifest | ||
Cu.import("resource:///modules/experiments/Experiments.jsm");<br /> | |||
Experiments.instance().updateManifest(); | |||
* '''Retrieve Telemetry Logs''' | * '''Retrieve Telemetry Logs''' | ||
** retrieves the current telemetry log entries and displays them in the browser console | ** retrieves the current telemetry log entries and displays them in the browser console | ||
Cu.import("resource://gre/modules/TelemetryLog.jsm"); <br /> | |||
TelemetryLog.entries().toSource(); | |||
* '''Extracting Telemetry Payload''' | * '''Extracting Telemetry Payload''' | ||
** extract the current telemetry payload and add it into the clipboard (paste into a text editor) | ** extract the current telemetry payload and add it into the clipboard (paste into a text editor) | ||
(function() { | |||
function copyStringToClipboard(s) { | |||
var ch = Cc["@mozilla.org/widget/clipboardhelper;1"].getService(Ci.nsIClipboardHelper); | |||
ch.copyString(s); | |||
} | |||
Cu.import("resource://gre/modules/TelemetryPing.jsm"); | |||
copyStringToClipboard(JSON.stringify(TelemetryPing.getPayload(), null, " ")); | |||
})(); | |||
* '''Run Maintenance Task''' | * '''Run Maintenance Task''' | ||
** force firefox to run the maintenance task | ** force firefox to run the maintenance task | ||
*** Link to code: http://pastebin.mozilla.org/5545427 | *** Link to code: http://pastebin.mozilla.org/5545427 | ||
Revision as of 22:23, 21 July 2014
Quick Summary
The following document will list several commands and pieces of code that you can insert into the browser console to extract more information from the experiment system. With this information, you'll be able to take a deeper look at the data and debug/test more reliably.
Enabling Logging
Please visit and review the following document:
Browser Console Commands
- Refresh Experiment Manifest Manually
- automatically update/refresh the current experiment manifest
Cu.import("resource:///modules/experiments/Experiments.jsm");
Experiments.instance().updateManifest();
- Retrieve Telemetry Logs
- retrieves the current telemetry log entries and displays them in the browser console
Cu.import("resource://gre/modules/TelemetryLog.jsm");
TelemetryLog.entries().toSource();
- Extracting Telemetry Payload
- extract the current telemetry payload and add it into the clipboard (paste into a text editor)
(function() {
function copyStringToClipboard(s) {
var ch = Cc["@mozilla.org/widget/clipboardhelper;1"].getService(Ci.nsIClipboardHelper);
ch.copyString(s);
}
Cu.import("resource://gre/modules/TelemetryPing.jsm");
copyStringToClipboard(JSON.stringify(TelemetryPing.getPayload(), null, " "));
})();
- Run Maintenance Task
- force firefox to run the maintenance task
- Link to code: http://pastebin.mozilla.org/5545427
- force firefox to run the maintenance task