Bug 1221697 - Add a telemetry probe for time-to-composite. r=kats
authorMason Chang <mchang@mozilla.com>
Thu, 05 Nov 2015 10:24:12 -0800
changeset 293043 14fe585860cabf63c59dbaabe942e2a621f7e9ea
parent 293042 b01393a10aa471da0812d8bfae381f4f416f7405
child 293044 cc48981c026c50fdf80d47b040ae1fb8fe99ad07
child 293074 24af9e133d6d5fd7eee578ab23995c070debacf6
push id8824
push userraliiev@mozilla.com
push dateMon, 14 Dec 2015 20:18:56 +0000
treeherdermozilla-aurora@e2031358e2a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1221697
milestone45.0a1
Bug 1221697 - Add a telemetry probe for time-to-composite. r=kats
gfx/layers/ipc/CompositorParent.cpp
toolkit/components/telemetry/Histograms.json
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -418,16 +418,20 @@ CompositorVsyncScheduler::Composite(Time
 
   DispatchTouchEvents(aVsyncTimestamp);
 
   if (mNeedsComposite || mAsapScheduling) {
     mNeedsComposite = false;
     mLastCompose = aVsyncTimestamp;
     ComposeToTarget(nullptr);
     mVsyncNotificationsSkipped = 0;
+
+    TimeDuration compositeFrameTotal = TimeStamp::Now() - aVsyncTimestamp;
+    mozilla::Telemetry::Accumulate(mozilla::Telemetry::COMPOSITE_FRAME_ROUNDTRIP_TIME,
+                                   compositeFrameTotal.ToMilliseconds());
   } else if (mVsyncNotificationsSkipped++ > gfxPrefs::CompositorUnobserveCount()) {
     UnobserveVsync();
   }
 }
 
 void
 CompositorVsyncScheduler::OnForceComposeToTarget()
 {
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -91,16 +91,23 @@
   },
   "COMPOSITE_TIME" : {
     "expires_in_version": "never",
     "description": "Composite times in milliseconds",
     "kind": "exponential",
     "high": "1000",
     "n_buckets": 50
   },
+  "COMPOSITE_FRAME_ROUNDTRIP_TIME" : {
+    "expires_in_version": "never",
+    "description": "Time from vsync to finishing a composite in milliseconds.",
+    "kind": "exponential",
+    "high": "1000",
+    "n_buckets": 50
+  },
   "CYCLE_COLLECTOR": {
     "alert_emails": ["dev-telemetry-gc-alerts@mozilla.org"],
     "expires_in_version": "never",
     "kind": "exponential",
     "high": "10000",
     "n_buckets": 50,
     "description": "Time spent on one cycle collection (ms)"
   },