Bug 1627708 - Record pinch source in a telemetry histogram. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Sat, 06 Jun 2020 00:32:26 +0000
changeset 534243 b830bc407224b171a91ed3e9e128030c020b7fdd
parent 534242 7b356f85d775897e81541c48e3aeec1b48e345ba
child 534244 42f05268a80bce0e2d7ec3680de596af0f88c2cc
push id37484
push userdluca@mozilla.com
push dateSat, 06 Jun 2020 09:46:03 +0000
treeherdermozilla-central@6237102f005d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1627708
milestone79.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 1627708 - Record pinch source in a telemetry histogram. r=botond Differential Revision: https://phabricator.services.mozilla.com/D77829
gfx/layers/apz/src/AsyncPanZoomController.cpp
toolkit/components/telemetry/Histograms.json
widget/InputData.h
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -1567,16 +1567,17 @@ nsEventStatus AsyncPanZoomController::On
     if (RefPtr<GeckoContentController> controller =
             GetGeckoContentController()) {
       controller->NotifyPinchGesture(aEvent.mType, GetGuid(), 0,
                                      aEvent.modifiers);
     }
   }
 
   SetState(PINCHING);
+  Telemetry::Accumulate(Telemetry::APZ_ZOOM_PINCHSOURCE, (int)aEvent.mSource);
   SetVelocityVector(ParentLayerPoint(0, 0));
   RecursiveMutexAutoLock lock(mRecursiveMutex);
   mLastZoomFocus =
       aEvent.mLocalFocusPoint - Metrics().GetCompositionBounds().TopLeft();
 
   mPinchEventBuffer.push(aEvent);
 
   return nsEventStatus_eConsumeNoDefault;
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -15429,10 +15429,21 @@
     "products": ["firefox"],
     "record_in_processes": ["content"],
     "alert_emails": ["kgupta@mozilla.com"],
     "expires_in_version": "85",
     "kind" : "boolean",
     "bug_numbers": [1627708],
     "description": "Whether RDM page had user-triggered zooming activity",
     "releaseChannelCollection": "opt-out"
+  },
+  "APZ_ZOOM_PINCHSOURCE" : {
+    "products": ["firefox"],
+    "record_in_processes": ["main", "gpu"],
+    "alert_emails": ["kgupta@mozilla.com"],
+    "expires_in_version": "85",
+    "kind" : "enumerated",
+    "n_values": 5,
+    "bug_numbers": [1627708],
+    "description": "Input device that triggered the zoom gesture (InputData::PinchGestureSource)",
+    "releaseChannelCollection": "opt-out"
   }
 }
--- a/widget/InputData.h
+++ b/widget/InputData.h
@@ -452,16 +452,19 @@ class PinchGestureInput : public InputDa
 
   MOZ_DEFINE_ENUM_AT_CLASS_SCOPE(
     PinchGestureSource, (
       UNKNOWN, // Default initialization value. Should never actually be used.
       TOUCH, // From two-finger pinch gesture
       ONE_TOUCH, // From one-finger pinch gesture
       TRACKPAD, // From trackpad pinch gesture
       MOUSEWHEEL // Synthesized from modifier+mousewheel
+
+      // If adding more items here, increase n_values for the
+      // APZ_ZOOM_PINCHSOURCE Telemetry metric.
   ));
   // clang-format on
 
   // Construct a pinch gesture from a Screen point.
   PinchGestureInput(PinchGestureType aType, PinchGestureSource aSource,
                     uint32_t aTime, TimeStamp aTimeStamp,
                     const ExternalPoint& aScreenOffset,
                     const ScreenPoint& aFocusPoint, ScreenCoord aCurrentSpan,