Commit fc4a9aae authored by kalman's avatar kalman Committed by Commit bot

Add more fine grained UMA for ExtensionService initialization time. At the

moment there is only total time and time to load all non-component extensions.
Time to load component extensions and time to notify all listeners is not
instrumented.

R=mek@chromium.org, mpearson@chromium.org
BUG=453073

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

Cr-Commit-Position: refs/heads/master@{#313615}
parent 6f290c21
......@@ -10,7 +10,9 @@
#include "base/files/file_util.h"
#include "base/json/json_string_value_serializer.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_macros.h"
#include "base/path_service.h"
#include "base/time/time.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/search/hotword_service.h"
#include "chrome/browser/search/hotword_service_factory.h"
......@@ -124,11 +126,14 @@ ComponentLoader::~ComponentLoader() {
}
void ComponentLoader::LoadAll() {
const base::TimeTicks start_time = base::TimeTicks::Now();
for (RegisteredComponentExtensions::iterator it =
component_extensions_.begin();
it != component_extensions_.end(); ++it) {
Load(*it);
}
UMA_HISTOGRAM_TIMES("Extensions.LoadAllComponentTime",
base::TimeTicks::Now() - start_time);
}
base::DictionaryValue* ComponentLoader::ParseManifest(
......
......@@ -1410,11 +1410,14 @@ void ExtensionService::ReloadExtensionsForTest() {
}
void ExtensionService::SetReadyAndNotifyListeners() {
const base::TimeTicks start_time = base::TimeTicks::Now();
ready_->Signal();
content::NotificationService::current()->Notify(
extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
content::Source<Profile>(profile_),
content::NotificationService::NoDetails());
UMA_HISTOGRAM_TIMES("Extensions.ExtensionServiceNotifyReadyListenersTime",
base::TimeTicks::Now() - start_time);
}
void ExtensionService::OnLoadedInstalledExtensions() {
......
......@@ -8144,6 +8144,16 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary>
</histogram>
<histogram name="Extensions.ExtensionServiceNotifyReadyListenersTime">
<owner>kalman@chromium.org</owner>
<summary>
Time taken for the ExtensionService to notify all ready listeners that the
extension system is now ready. This happens as part of the total
initialization time of ExtensionService, measured in
Extensions.ExtensionServiceInitTime.
</summary>
</histogram>
<histogram name="Extensions.ExtensionUninstalled">
<owner>kalman@chromium.org</owner>
<summary>An extension has been uninstalled.</summary>
......@@ -8405,9 +8415,22 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary>
</histogram>
<histogram name="Extensions.LoadAllComponentTime" units="milliseconds">
<owner>kalman@chromium.org</owner>
<summary>
Time taken to load all component extensions at browser startup. This happens
as part of the total initialization time of ExtensionService, measured in
Extensions.ExtensionServiceInitTime.
</summary>
</histogram>
<histogram name="Extensions.LoadAllTime" units="milliseconds">
<owner>kalman@chromium.org</owner>
<summary>Time taken to load all extensions at browser startup.</summary>
<summary>
Time taken to load all non-component extensions at browser startup. This
happens as part of the total initialization time of ExtensionService,
measured in Extensions.ExtensionServiceInitTime.
</summary>
</histogram>
<histogram name="Extensions.LoadApp">
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