Bug 1011136 - Add a histogram for plugin startup duration. r=bsmedberg

This commit is contained in:
Qeole 2014-05-30 07:14:00 -04:00
parent 39ab5b33ad
commit f5fafbf3a3
3 changed files with 14 additions and 4 deletions

View File

@ -719,10 +719,10 @@ void nsPluginHost::OnPluginInstanceDestroyed(nsPluginTag* aPluginTag)
// Another reason not to unload immediately is that loading is expensive,
// and it is better to leave popular plugins loaded.
//
// Our default behavior is to try to unload a plugin three minutes after
// its last instance is destroyed. This seems like a reasonable compromise
// that allows us to reclaim memory while allowing short state retention
// and avoid perf hits for loading popular plugins.
// Our default behavior is to try to unload a plugin after a pref-controlled
// delay once its last instance is destroyed. This seems like a reasonable
// compromise that allows us to reclaim memory while allowing short state
// retention and avoid perf hits for loading popular plugins.
if (!hasInstance) {
if (UnloadPluginsASAP()) {
aPluginTag->TryUnloadPlugin(false);

View File

@ -11,6 +11,7 @@
#include "mozilla/ipc/BrowserProcessSubThread.h"
#include "mozilla/plugins/PluginMessageUtils.h"
#include "mozilla/Telemetry.h"
using std::vector;
using std::string;
@ -75,6 +76,7 @@ PluginProcessParent::Launch(int32_t timeoutMs)
vector<string> args;
args.push_back(MungePluginDsoPath(mPluginFilePath));
Telemetry::AutoTimer<Telemetry::PLUGIN_STARTUP_MS> timer;
return SyncLaunch(args, timeoutMs, selectedArchitecture);
}

View File

@ -2328,6 +2328,14 @@
"n_buckets": 20,
"description": "Time spent loading plugin DLL and obtaining metadata (ms)"
},
"PLUGIN_STARTUP_MS": {
"expires_in_version": "never",
"kind": "exponential",
"high": "5000",
"n_buckets": 20,
"extended_statistics_ok": true,
"description": "Time spent starting up plugins (ms)"
},
"PLUGIN_SHUTDOWN_MS": {
"expires_in_version": "never",
"kind": "exponential",