Bug 1007095 - Add UI telemetry for Reader actions. r=lucasr, a=sledru
authorMark Finkle <mfinkle@mozilla.com>
Thu, 08 May 2014 09:10:39 -0400
changeset 199254 7f6a7121a73c09824cb6311830fe96d31e756d6e
parent 199253 1606b7afe077cff2b7830bb7deb67df7aa642726
child 199255 8ff4386b0a35bba190ab73c1fa4563397425a429
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr, sledru
bugs1007095
milestone31.0a2
Bug 1007095 - Add UI telemetry for Reader actions. r=lucasr, a=sledru
mobile/android/chrome/content/aboutReader.js
--- a/mobile/android/chrome/content/aboutReader.js
+++ b/mobile/android/chrome/content/aboutReader.js
@@ -699,16 +699,22 @@ AboutReader.prototype = {
       segmentedButton.appendChild(item);
 
       link.addEventListener("click", function(aEvent) {
         if (!aEvent.isTrusted)
           return;
 
         aEvent.stopPropagation();
 
+        // Create a relative timestamp for telemetry
+        let uptime = Date.now() - Services.startup.getStartupInfo().linkerInitialized;
+        // Just pass the ID of the button as an extra and hope the ID doesn't change
+        // unless the context changes
+        UITelemetry.addEvent("action.1", "button", uptime, id);
+
         let items = segmentedButton.children;
         for (let j = items.length - 1; j >= 0; j--) {
           items[j].classList.remove("selected");
         }
 
         item.classList.add("selected");
         callback(option.value);
       }.bind(this), true);