Bug 1175519 - Expose raw ping json data on about:telemetry. r=gfritzsche
authorsimplyblue <bmanojkumar24@gmail.com>
Fri, 06 Nov 2015 19:27:53 +0530
changeset 271935 118c51d2942a358b0c699a5dd4bf77cf487db04f
parent 271934 9f9d13c5a045feadef53d1bf869116b02084f305
child 271936 e8c7a7e0e2169f95a1cecc503979cc26414273ec
push id29658
push usercbook@mozilla.com
push dateWed, 11 Nov 2015 11:08:38 +0000
treeherdermozilla-central@754119dfb99f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche
bugs1175519
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1175519 - Expose raw ping json data on about:telemetry. r=gfritzsche
toolkit/content/aboutTelemetry.css
toolkit/content/aboutTelemetry.js
toolkit/content/aboutTelemetry.xhtml
toolkit/locales/en-US/chrome/global/aboutTelemetry.dtd
--- a/toolkit/content/aboutTelemetry.css
+++ b/toolkit/content/aboutTelemetry.css
@@ -222,8 +222,30 @@ body[dir="rtl"] .copy-node {
 
 .has-data.expanded .filter-ui {
   display: inline;
 }
 
 .filter-blocked {
   display: none;
 }
+
+#raw-ping-data-section {
+  position: absolute;
+  width: 100%;
+  height: 100%;
+  top: 0px;
+  left: 0px;
+  background-color:-moz-Dialog;
+}
+
+#raw-ping-data {
+  background-color:white;
+  margin: 0px;
+}
+
+#hide-raw-ping {
+  float: right;
+  cursor: pointer;
+  font-size: 20px;
+  background-color:#d8d8d8;
+  padding: 5px 10px;
+}
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -293,17 +293,20 @@ var PingPicker = {
     document.getElementById("choose-ping-id").addEventListener("change", () => {
       this._updateArchivedPingData()
     }, false);
 
     document.getElementById("newer-ping")
             .addEventListener("click", () => this._movePingIndex(-1), false);
     document.getElementById("older-ping")
             .addEventListener("click", () => this._movePingIndex(1), false);
-
+    document.getElementById("show-raw-ping")
+            .addEventListener("click", () => this._showRawPingData(), false);
+    document.getElementById("hide-raw-ping")
+            .addEventListener("click", () => this._hideRawPingData(), false);
     document.getElementById("choose-payload")
             .addEventListener("change", () => displayPingData(gPingData), false);
   },
 
   onPingSourceChanged: function() {
     this.update();
   },
 
@@ -443,16 +446,26 @@ var PingPicker = {
       (week) => ping.timestampCreated >= week.startDate.getTime() &&
                 ping.timestampCreated < week.endDate.getTime());
     const options = document.getElementById("choose-ping-week").options;
     options.item(weekIndex).selected = true;
 
     this._renderPingList(ping.id);
     this._updateArchivedPingData();
   },
+
+  _showRawPingData: function() {
+    let pre = document.getElementById("raw-ping-data");
+    pre.textContent = JSON.stringify(gPingData, null, 2);
+    document.getElementById("raw-ping-data-section").classList.remove("hidden");
+  },
+
+  _hideRawPingData: function() {
+    document.getElementById("raw-ping-data-section").classList.add("hidden");
+  },
 };
 
 var GeneralData = {
   /**
    * Renders the general data
    */
   render: function(aPing) {
     setHasData("general-data-section", true);
--- a/toolkit/content/aboutTelemetry.xhtml
+++ b/toolkit/content/aboutTelemetry.xhtml
@@ -53,16 +53,17 @@
       <div id="ping-picker">
         <div id="ping-source-picker">
           &aboutTelemetry.pingDataSource;<br/>
           <input type="radio" id="ping-source-current" name="choose-ping-source" value="current" checked="checked" />
           &aboutTelemetry.showCurrentPingData;<br />
           <input type="radio" id="ping-source-archive" name="choose-ping-source" value="archive" />
           &aboutTelemetry.showArchivedPingData;<br />
         </div>
+        <button id="show-raw-ping" type="button">&aboutTelemetry.rawPingData;</button>
         <div id="current-ping-picker">
           <input id="show-subsession-data" type="checkbox" />&aboutTelemetry.showSubsessionData;
         </div>
         <div id="archived-ping-picker" class="hidden">
           &aboutTelemetry.choosePing;<br />
           <button id="newer-ping" type="button">&aboutTelemetry.showNewerPing;</button>
           <button id="older-ping" type="button">&aboutTelemetry.showOlderPing;</button><br />
           <table>
@@ -91,16 +92,21 @@
                     <select id="choose-payload">
                     </select>
                 </td>
             </tr>
         </table>
       </div>
     </header>
 
+    <div id="raw-ping-data-section" class="hidden">
+      <div id="hide-raw-ping">&#10006;</div>
+      <pre id="raw-ping-data"></pre>
+    </div>
+
     <section id="general-data-section" class="data-section">
       <input type="checkbox" class="statebox"/>
       <h1 class="section-name">&aboutTelemetry.generalDataSection;</h1>
       <span class="toggle-caption">&aboutTelemetry.toggle;</span>
       <span class="empty-caption">&aboutTelemetry.emptySection;</span>
       <div id="general-data" class="data">
       </div>
     </section>
--- a/toolkit/locales/en-US/chrome/global/aboutTelemetry.dtd
+++ b/toolkit/locales/en-US/chrome/global/aboutTelemetry.dtd
@@ -47,16 +47,20 @@ Choose ping:
 <!ENTITY aboutTelemetry.showNewerPing "
 &lt;&lt; Newer ping
 ">
 
 <!ENTITY aboutTelemetry.showOlderPing "
 Older ping &gt;&gt;
 ">
 
+<!ENTITY aboutTelemetry.rawPingData "
+Raw ping data ...
+">
+
 <!ENTITY aboutTelemetry.archiveWeekHeader "
 Week
 ">
 
 <!ENTITY aboutTelemetry.archivePingHeader "
 Ping
 ">