Bug 1070755: Add telemetry for timing PluginAsyncSurrogate::WaitForInit; r=vladan
authorAaron Klotz <aklotz@mozilla.com>
Mon, 29 Dec 2014 16:14:46 -0700
changeset 247418 54c85be898862d361f026b574fd13a92e8fab436
parent 247417 a656ced1d0fb3d8b1048708ed7384c5902617b00
child 247419 b8947f95021df2eac9ad1e8eb80e167b5fed3b1a
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvladan
bugs1070755
milestone37.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 1070755: Add telemetry for timing PluginAsyncSurrogate::WaitForInit; r=vladan
dom/plugins/ipc/PluginAsyncSurrogate.cpp
toolkit/components/telemetry/Histograms.json
--- a/dom/plugins/ipc/PluginAsyncSurrogate.cpp
+++ b/dom/plugins/ipc/PluginAsyncSurrogate.cpp
@@ -7,16 +7,17 @@
 #include "PluginAsyncSurrogate.h"
 
 #include "base/message_loop.h"
 #include "base/message_pump_default.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/plugins/PluginInstanceParent.h"
 #include "mozilla/plugins/PluginModuleParent.h"
 #include "mozilla/plugins/PluginScriptableObjectParent.h"
+#include "mozilla/Telemetry.h"
 #include "nsJSNPRuntime.h"
 #include "nsNPAPIPlugin.h"
 #include "nsNPAPIPluginInstance.h"
 #include "nsNPAPIPluginStreamListener.h"
 #include "nsPluginInstanceOwner.h"
 #include "nsPluginStreamListenerPeer.h"
 #include "npruntime.h"
 #include "nsThreadUtils.h"
@@ -405,16 +406,18 @@ bool
 PluginAsyncSurrogate::WaitForInit()
 {
   if (mInitCancelled) {
     return false;
   }
   if (mAcceptCalls) {
     return true;
   }
+  Telemetry::AutoTimer<Telemetry::BLOCKED_ON_PLUGINASYNCSURROGATE_WAITFORINIT_MS>
+    timer(mParent->GetHistogramKey());
   bool result = false;
   MOZ_ASSERT(mParent);
   if (mParent->IsChrome()) {
     PluginProcessParent* process = static_cast<PluginModuleChromeParent*>(mParent)->Process();
     MOZ_ASSERT(process);
     process->SetCallRunnableImmediately(true);
     if (!process->WaitUntilConnected()) {
       return false;
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -7024,16 +7024,25 @@
     "expires_in_version": "40",
     "kind": "exponential",
     "high": "10000",
     "n_buckets": 20,
     "extended_statistics_ok": true,
     "keyed": true,
     "description": "Time (ms) that the main thread has been blocked on NPP_NewStream in an IPC plugin"
   },
+  "BLOCKED_ON_PLUGINASYNCSURROGATE_WAITFORINIT_MS": {
+    "expires_in_version": "40",
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 20,
+    "extended_statistics_ok": true,
+    "keyed": true,
+    "description": "Time (ms) that the main thread has been blocked on PluginAsyncSurrogate::WaitForInit in an IPC plugin"
+  },
   "BLOCKED_ON_PLUGIN_INSTANCE_DESTROY_MS": {
     "expires_in_version": "40",
     "kind": "exponential",
     "high": "10000",
     "n_buckets": 20,
     "extended_statistics_ok": true,
     "keyed": true,
     "description": "Time (ms) that the main thread has been blocked on NPP_Destroy in an IPC plugin"