mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1120408 - Show TelemetryLog in about:telemetry. r=felipe,gfritzsche
This commit is contained in:
parent
cedfad6fdd
commit
9542cd2104
@ -12,6 +12,7 @@ Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/TelemetryTimestamps.jsm");
|
||||
Cu.import("resource://gre/modules/TelemetryPing.jsm");
|
||||
Cu.import("resource://gre/modules/TelemetrySession.jsm");
|
||||
Cu.import("resource://gre/modules/TelemetryLog.jsm");
|
||||
|
||||
const Telemetry = Services.telemetry;
|
||||
const bundle = Services.strings.createBundle(
|
||||
@ -152,6 +153,57 @@ let GeneralData = {
|
||||
},
|
||||
};
|
||||
|
||||
let TelLog = {
|
||||
/**
|
||||
* Renders the telemetry log
|
||||
*/
|
||||
render: function() {
|
||||
let entries = TelemetryLog.entries();
|
||||
|
||||
if(entries.length == 0) {
|
||||
return;
|
||||
}
|
||||
setHasData("telemetry-log-section", true);
|
||||
let table = document.createElement("table");
|
||||
|
||||
let caption = document.createElement("caption");
|
||||
let captionString = bundle.GetStringFromName("telemetryLogTitle");
|
||||
caption.appendChild(document.createTextNode(captionString + "\n"));
|
||||
table.appendChild(caption);
|
||||
|
||||
let headings = document.createElement("tr");
|
||||
this.appendColumn(headings, "th", bundle.GetStringFromName("telemetryLogHeadingId") + "\t");
|
||||
this.appendColumn(headings, "th", bundle.GetStringFromName("telemetryLogHeadingTimestamp") + "\t");
|
||||
this.appendColumn(headings, "th", bundle.GetStringFromName("telemetryLogHeadingData") + "\t");
|
||||
table.appendChild(headings);
|
||||
|
||||
for (let entry of entries) {
|
||||
let row = document.createElement("tr");
|
||||
for (let elem of entry) {
|
||||
this.appendColumn(row, "td", elem + "\t");
|
||||
}
|
||||
table.appendChild(row);
|
||||
}
|
||||
|
||||
let dataDiv = document.getElementById("telemetry-log");
|
||||
dataDiv.appendChild(table);
|
||||
},
|
||||
|
||||
/**
|
||||
* Helper function for appending a column to the data table.
|
||||
*
|
||||
* @param aRowElement Parent row element
|
||||
* @param aColType Column's tag name
|
||||
* @param aColText Column contents
|
||||
*/
|
||||
appendColumn: function(aRowElement, aColType, aColText) {
|
||||
let colElement = document.createElement(aColType);
|
||||
let colTextElement = document.createTextNode(aColText);
|
||||
colElement.appendChild(colTextElement);
|
||||
aRowElement.appendChild(colElement);
|
||||
},
|
||||
};
|
||||
|
||||
let SlowSQL = {
|
||||
|
||||
slowSqlHits: bundle.GetStringFromName("slowSqlHits"),
|
||||
@ -993,6 +1045,9 @@ function onLoad() {
|
||||
// Show general data.
|
||||
GeneralData.render();
|
||||
|
||||
// Show telemetry log.
|
||||
TelLog.render();
|
||||
|
||||
// Show slow SQL stats
|
||||
SlowSQL.render();
|
||||
|
||||
|
@ -44,6 +44,15 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="telemetry-log-section" class="data-section">
|
||||
<input type="checkbox" class="statebox"/>
|
||||
<h1 class="section-name">&aboutTelemetry.telemetryLogSection;</h1>
|
||||
<span class="toggle-caption">&aboutTelemetry.toggle;</span>
|
||||
<span class="empty-caption">&aboutTelemetry.emptySection;</span>
|
||||
<div id="telemetry-log" class="data">
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="slow-sql-section" class="data-section">
|
||||
<input type="checkbox" class="statebox"/>
|
||||
<h1 class="section-name">&aboutTelemetry.slowSqlSection;</h1>
|
||||
|
@ -16,6 +16,10 @@
|
||||
General Data
|
||||
">
|
||||
|
||||
<!ENTITY aboutTelemetry.telemetryLogSection "
|
||||
Telemetry Log
|
||||
">
|
||||
|
||||
<!ENTITY aboutTelemetry.slowSqlSection "
|
||||
Slow SQL Statements
|
||||
">
|
||||
|
@ -13,6 +13,14 @@ generalDataHeadingName = Name
|
||||
|
||||
generalDataHeadingValue = Value
|
||||
|
||||
telemetryLogTitle = Telemetry Log
|
||||
|
||||
telemetryLogHeadingId = Id
|
||||
|
||||
telemetryLogHeadingTimestamp = Timestamp
|
||||
|
||||
telemetryLogHeadingData = Data
|
||||
|
||||
slowSqlMain = Slow SQL Statements on Main Thread
|
||||
|
||||
slowSqlOther = Slow SQL Statements on Helper Threads
|
||||
|
Loading…
Reference in New Issue
Block a user