Commit 01caf7c0 authored by beaudoin@chromium.org's avatar beaudoin@chromium.org

Log NTP loading time separately for local, Google and other NTPs.

We currently use the same UMA metric to log the loading time of different kinds of NTP:
- The local NTP
- The Google app-cached NTP
- NTP from other providers

This CL separates these in three UMA metric using histogram suffixes.

In addition, this CL brings back the Tab.NewTab* UMA metrics to the public histograms.xml in accordance with the practice that metrics in the public chromium repository should be in the public histograms.xml.

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

Cr-Commit-Position: refs/heads/master@{#289946}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289946 0039d316-1c4b-4281-b951-d872f2087c98
parent 2b64cb12
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "chrome/browser/ui/tab_contents/core_tab_helper.h" #include "chrome/browser/ui/tab_contents/core_tab_helper.h"
#include "chrome/browser/ui/webui/ntp/ntp_user_data_logger.h" #include "chrome/browser/ui/webui/ntp/ntp_user_data_logger.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
#include "components/google/core/browser/google_util.h"
#include "components/search/search.h" #include "components/search/search.h"
#include "components/signin/core/browser/signin_manager.h" #include "components/signin/core/browser/signin_manager.h"
#include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_controller.h"
...@@ -120,7 +121,18 @@ void RecordNewTabLoadTime(content::WebContents* contents) { ...@@ -120,7 +121,18 @@ void RecordNewTabLoadTime(content::WebContents* contents) {
base::TimeDelta duration = base::TimeDelta duration =
base::TimeTicks::Now() - core_tab_helper->new_tab_start_time(); 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()); core_tab_helper->set_new_tab_start_time(base::TimeTicks());
} }
......
...@@ -9996,7 +9996,7 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -9996,7 +9996,7 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<histogram name="InstantExtended.CacheableNTPLoad" <histogram name="InstantExtended.CacheableNTPLoad"
enum="InstantExtended_CacheableNTPLoad"> enum="InstantExtended_CacheableNTPLoad">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner> <owner>beaudoin@chromium.org</owner>
<summary> <summary>
Records a histogram for how often the Cacheable NTP fails to load. Records a histogram for how often the Cacheable NTP fails to load.
</summary> </summary>
...@@ -19621,7 +19621,7 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -19621,7 +19621,7 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</histogram> </histogram>
<histogram name="NewTabPage.URLState" enum="NewTabURLState"> <histogram name="NewTabPage.URLState" enum="NewTabURLState">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner> <owner>beaudoin@chromium.org</owner>
<summary> <summary>
Records the status of the New Tab page URL when an NTP is opened. Records the status of the New Tab page URL when an NTP is opened.
</summary> </summary>
...@@ -33486,6 +33486,42 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -33486,6 +33486,42 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary> </summary>
</histogram> </histogram>
<histogram name="Tab.NewTab" enum="NewTabType">
<owner>lliabraa@chromium.org</owner>
<owner>beaudoin@chromium.org</owner>
<summary>
Tracks the different ways users are opening new tabs. Does not apply to
opening existing links or searches in a new tab, only to brand new empty
tabs. Note: Currently the &quot;Regular menu option&quot; includes some
programmatic actions in addition to user actions.
</summary>
</histogram>
<histogram name="Tab.NewTabDOMContentLoaded" units="milliseconds">
<owner>lliabraa@chromium.org</owner>
<owner>beaudoin@chromium.org</owner>
<summary>
The time for the new tab page to fire the &quot;DOMContentLoaded&quot;
event.
</summary>
</histogram>
<histogram name="Tab.NewTabOnload" units="milliseconds">
<owner>lliabraa@chromium.org</owner>
<owner>beaudoin@chromium.org</owner>
<summary>
The time for the new tab page to fire the &quot;load&quot; event.
</summary>
</histogram>
<histogram name="Tab.NewTabScriptStart" units="milliseconds">
<owner>lliabraa@chromium.org</owner>
<owner>beaudoin@chromium.org</owner>
<summary>
The time for the new tab page to start executing JavaScript.
</summary>
</histogram>
<histogram name="Tab.PerceivedRestoreTime" units="ms"> <histogram name="Tab.PerceivedRestoreTime" units="ms">
<owner>lliabraa@chromium.org</owner> <owner>lliabraa@chromium.org</owner>
<summary> <summary>
...@@ -45557,6 +45593,12 @@ To add a new entry, add it with any value and run test to compute valid value. ...@@ -45557,6 +45593,12 @@ To add a new entry, add it with any value and run test to compute valid value.
<int value="4" label="User dismissed the promo"/> <int value="4" label="User dismissed the promo"/>
</enum> </enum>
<enum name="NewTabType" type="int">
<int value="0" label="New tab button"/>
<int value="1" label="Regular menu option"/>
<int value="2" label="Tab strip menu option"/>
</enum>
<enum name="NewTabURLState" type="int"> <enum name="NewTabURLState" type="int">
<int value="0" label="Valid URL was used"/> <int value="0" label="Valid URL was used"/>
<int value="1" label="Corrupt state"/> <int value="1" label="Corrupt state"/>
...@@ -54297,6 +54339,13 @@ To add a new entry, add it with any value and run test to compute valid value. ...@@ -54297,6 +54339,13 @@ To add a new entry, add it with any value and run test to compute valid value.
<affected-histogram name="Startup.BrowserOpenTabs"/> <affected-histogram name="Startup.BrowserOpenTabs"/>
</histogram_suffixes> </histogram_suffixes>
<histogram_suffixes name="TabNewTabOnload" separator=".">
<suffix name="Local" label="Local New Tab page."/>
<suffix name="Google" label="New Tab page for Google."/>
<suffix name="Other" label="New Tab page for a non-Google provider."/>
<affected-histogram name="Tab.NewTabOnload"/>
</histogram_suffixes>
<histogram_suffixes name="Tps65090Fets" separator="."> <histogram_suffixes name="Tps65090Fets" separator=".">
<suffix name="Fet1" label="FET1 on tps65090 (register 0xf)"/> <suffix name="Fet1" label="FET1 on tps65090 (register 0xf)"/>
<suffix name="Fet2" label="FET2 on tps65090 (register 0x10)"/> <suffix name="Fet2" label="FET2 on tps65090 (register 0x10)"/>
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