Bug 836488: Add telemetry for plugin metadata load time. r=bsmedberg
authorAaron Klotz <aklotz@mozilla.com>
Mon, 01 Apr 2013 11:38:48 -0600
changeset 126864 b23e5f546045a69a7c1a7ed0a4eee6cc3fea185d
parent 126863 9649da61dc8a25e652982a9ea0472599d77258bf
child 126865 a95fe57e30dee115da414e48412ea7a26f156661
push id24498
push userryanvm@gmail.com
push dateTue, 02 Apr 2013 17:20:18 +0000
treeherdermozilla-central@e53044984f1b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs836488
milestone22.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 836488: Add telemetry for plugin metadata load time. r=bsmedberg
dom/plugins/base/nsPluginHost.cpp
toolkit/components/telemetry/Histograms.json
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -1986,17 +1986,22 @@ nsresult nsPluginHost::ScanPluginsDirect
     // if it is not found in cache info list or has been changed, create a new one
     if (!pluginTag) {
       nsPluginFile pluginFile(localfile);
 
       // create a tag describing this plugin.
       PRLibrary *library = nullptr;
       nsPluginInfo info;
       memset(&info, 0, sizeof(info));
-      nsresult res = pluginFile.GetPluginInfo(info, &library);
+      nsresult res;
+      // Opening a block for the telemetry AutoTimer
+      {
+        Telemetry::AutoTimer<Telemetry::PLUGIN_LOAD_METADATA> telemetry;
+        res = pluginFile.GetPluginInfo(info, &library);
+      }
       // if we don't have mime type don't proceed, this is not a plugin
       if (NS_FAILED(res) || !info.fMimeTypeArray) {
         nsRefPtr<nsInvalidPluginTag> invalidTag = new nsInvalidPluginTag(filePath.get(),
                                                                          fileModTime);
         pluginFile.FreePluginInfo(info);
 
         if (aCreatePluginList) {
           invalidTag->mSeen = true;
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -1620,16 +1620,22 @@
     "description": "Time spent in Plugin Hang UI (ms)"
   },
   "PLUGIN_HANG_TIME": {
     "kind": "exponential",
     "high": "60000",
     "n_buckets": 20,
     "description": "Value of dom.ipc.plugins.hangUITimeoutSecs plus time spent in Plugin Hang UI (ms)"
   },
+  "PLUGIN_LOAD_METADATA": {
+    "kind": "exponential",
+    "high": "5000",
+    "n_buckets": 20,
+    "description": "Time spent loading plugin DLL and obtaining metadata (ms)"
+  },
   "PLUGIN_SHUTDOWN_MS": {
     "kind": "exponential",
     "high": "5000",
     "n_buckets": 20,
     "extended_statistics_ok": true,
     "description": "Time spent shutting down plugins (ms)"
   },
   "PLUGIN_CALLED_DIRECTLY": {