Commit 1c99cbef authored by yoz's avatar yoz Committed by Commit bot

Add UMA histogram timers for ProcessManager and BackgroundContentsService startup.

These measure the time taken in response to ExtensionService ready signaling. These are the 2 heaviest observers of ready.

BUG=453073

Review URL: https://codereview.chromium.org/874643003

Cr-Commit-Position: refs/heads/master@{#315081}
parent abebda49
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/metrics/histogram_macros.h"
#include "base/prefs/pref_service.h" #include "base/prefs/pref_service.h"
#include "base/prefs/scoped_user_pref_update.h" #include "base/prefs/scoped_user_pref_update.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
...@@ -343,10 +344,13 @@ void BackgroundContentsService::Observe( ...@@ -343,10 +344,13 @@ void BackgroundContentsService::Observe(
const content::NotificationDetails& details) { const content::NotificationDetails& details) {
switch (type) { switch (type) {
case extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED: { case extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED: {
const base::TimeTicks start_time = base::TimeTicks::Now();
Profile* profile = content::Source<Profile>(source).ptr(); Profile* profile = content::Source<Profile>(source).ptr();
LoadBackgroundContentsFromManifests(profile); LoadBackgroundContentsFromManifests(profile);
LoadBackgroundContentsFromPrefs(profile); LoadBackgroundContentsFromPrefs(profile);
SendChangeNotification(profile); SendChangeNotification(profile);
UMA_HISTOGRAM_TIMES("Extensions.BackgroundContentsServiceStartupTime",
base::TimeTicks::Now() - start_time);
break; break;
} }
case chrome::NOTIFICATION_BACKGROUND_CONTENTS_DELETED: case chrome::NOTIFICATION_BACKGROUND_CONTENTS_DELETED:
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include "base/lazy_instance.h" #include "base/lazy_instance.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/metrics/histogram.h" #include "base/metrics/histogram_macros.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/time/time.h" #include "base/time/time.h"
...@@ -757,7 +757,10 @@ void ProcessManager::Observe(int type, ...@@ -757,7 +757,10 @@ void ProcessManager::Observe(int type,
case extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED: { case extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED: {
// TODO(jamescook): Convert this to use ExtensionSystem::ready() instead // TODO(jamescook): Convert this to use ExtensionSystem::ready() instead
// of a notification. // of a notification.
const base::TimeTicks start_time = base::TimeTicks::Now();
MaybeCreateStartupBackgroundHosts(); MaybeCreateStartupBackgroundHosts();
UMA_HISTOGRAM_TIMES("Extensions.ProcessManagerStartupHostsTime",
base::TimeTicks::Now() - start_time);
break; break;
} }
......
...@@ -7953,6 +7953,15 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -7953,6 +7953,15 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary> </summary>
</histogram> </histogram>
<histogram name="Extensions.BackgroundContentsServiceStartupTime"
units="milliseconds">
<owner>yoz@chromium.org</owner>
<summary>
Time taken to load BackgroundContents for apps at startup when the extension
system notifies that it is ready.
</summary>
</histogram>
<histogram name="Extensions.BackgroundPageLoadTime" units="milliseconds"> <histogram name="Extensions.BackgroundPageLoadTime" units="milliseconds">
<owner>kalman@chromium.org</owner> <owner>kalman@chromium.org</owner>
<summary>The time for an extension's background page to load.</summary> <summary>The time for an extension's background page to load.</summary>
...@@ -8999,6 +9008,15 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -8999,6 +9008,15 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary> </summary>
</histogram> </histogram>
<histogram name="Extensions.ProcessManagerStartupHostsTime"
units="milliseconds">
<owner>yoz@chromium.org</owner>
<summary>
The time taken to start up persistent background pages for extensions in
ExtensionProcessManager when the extension system notifies that it is ready.
</summary>
</histogram>
<histogram name="Extensions.ResourceDirectoryTimestampQueryLatency" <histogram name="Extensions.ResourceDirectoryTimestampQueryLatency"
units="milliseconds"> units="milliseconds">
<owner>asargent@chromium.org</owner> <owner>asargent@chromium.org</owner>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment