Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3938)

Unified Diff: chrome/browser/ui/search/search_tab_helper.cc

Issue 474053002: UMA log NTP loading time separately for local, google and other NTPs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search/search_tab_helper.cc
diff --git a/chrome/browser/ui/search/search_tab_helper.cc b/chrome/browser/ui/search/search_tab_helper.cc
index 178765367654ace2b1a8a30ff9d7983a54af97a5..7237c696e4a5ab299310430fc2a930793b7d77a9 100644
--- a/chrome/browser/ui/search/search_tab_helper.cc
+++ b/chrome/browser/ui/search/search_tab_helper.cc
@@ -31,6 +31,7 @@
#include "chrome/browser/ui/tab_contents/core_tab_helper.h"
#include "chrome/browser/ui/webui/ntp/ntp_user_data_logger.h"
#include "chrome/common/url_constants.h"
+#include "components/google/core/browser/google_util.h"
#include "components/search/search.h"
#include "components/signin/core/browser/signin_manager.h"
#include "content/public/browser/navigation_controller.h"
@@ -120,7 +121,18 @@ void RecordNewTabLoadTime(content::WebContents* contents) {
base::TimeDelta duration =
base::TimeTicks::Now() - core_tab_helper->new_tab_start_time();
- UMA_HISTOGRAM_TIMES("Tab.NewTabOnload", duration);
+ if (IsCacheableNTP(contents)) {
+ if (google_util::IsGoogleDomainUrl(
+ contents->GetController().GetLastCommittedEntry()->GetURL(),
+ google_util::ALLOW_SUBDOMAIN,
+ google_util::DISALLOW_NON_STANDARD_PORTS)) {
+ UMA_HISTOGRAM_TIMES("Tab.NewTabOnload.Google", duration);
+ } else {
+ UMA_HISTOGRAM_TIMES("Tab.NewTabOnload.Other", duration);
+ }
+ } else {
+ UMA_HISTOGRAM_TIMES("Tab.NewTabOnload.Local", duration);
+ }
core_tab_helper->set_new_tab_start_time(base::TimeTicks());
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698