Commit 3fea8da0 authored by Robert Ogden's avatar Robert Ogden Committed by Chromium LUCI CQ

Obsolete PageLoad.Clients.SubresourceLoading.* histograms

Histograms that are also recorded in UKM are only made local for ease of
continued testing. The other histograms are removed in code.

Bug: 1165102
Change-Id: Ie2eefc8cfaea777a7b381b11f667c85dd694ab44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2622429Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Reviewed-by: default avatarRyan Sturm <ryansturm@chromium.org>
Commit-Queue: Robert Ogden <robertogden@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843611}
parent c1876b7f
......@@ -6,7 +6,7 @@
#include <algorithm>
#include "base/metrics/histogram_macros.h"
#include "base/metrics/histogram_macros_local.h"
#include "base/strings/string_util.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_url_loader_interceptor.h"
......@@ -165,8 +165,6 @@ void PrefetchProxyPageLoadMetricsObserver::GetPrefetchMetrics() {
void PrefetchProxyPageLoadMetricsObserver::OnOriginLastVisitResult(
base::Time query_start_time,
history::HistoryLastVisitToHostResult result) {
history_query_times_.push_back(base::Time::Now() - query_start_time);
if (!result.success)
return;
......@@ -202,7 +200,6 @@ void PrefetchProxyPageLoadMetricsObserver::OnCookieResult(
base::Time query_start_time,
const net::CookieAccessResultList& cookies,
const net::CookieAccessResultList& excluded_cookies) {
cookie_query_times_.push_back(base::Time::Now() - query_start_time);
mainframe_had_cookies_ =
mainframe_had_cookies_.value_or(false) || !cookies.empty();
}
......@@ -238,19 +235,8 @@ void PrefetchProxyPageLoadMetricsObserver::RecordMetrics() {
task_tracker_.TryCancelAll();
for (base::TimeDelta cookie_query_time : cookie_query_times_) {
UMA_HISTOGRAM_TIMES("PageLoad.Clients.SubresourceLoading.CookiesQueryTime",
cookie_query_time);
}
cookie_query_times_.clear();
for (base::TimeDelta history_query_time : history_query_times_) {
UMA_HISTOGRAM_TIMES("PageLoad.Clients.SubresourceLoading.HistoryQueryTime",
history_query_time);
}
history_query_times_.clear();
if (mainframe_had_cookies_.has_value()) {
UMA_HISTOGRAM_BOOLEAN(
LOCAL_HISTOGRAM_BOOLEAN(
"PageLoad.Clients.SubresourceLoading.MainFrameHadCookies",
mainframe_had_cookies_.value());
}
......@@ -258,21 +244,21 @@ void PrefetchProxyPageLoadMetricsObserver::RecordMetrics() {
if (min_days_since_last_visit_to_origin_.has_value()) {
int days_since_last_visit = min_days_since_last_visit_to_origin_.value();
UMA_HISTOGRAM_BOOLEAN(
LOCAL_HISTOGRAM_BOOLEAN(
"PageLoad.Clients.SubresourceLoading.HasPreviousVisitToOrigin",
days_since_last_visit != -1);
if (days_since_last_visit >= 0) {
UMA_HISTOGRAM_COUNTS_100(
LOCAL_HISTOGRAM_COUNTS_100(
"PageLoad.Clients.SubresourceLoading.DaysSinceLastVisitToOrigin",
days_since_last_visit);
}
}
UMA_HISTOGRAM_COUNTS_100(
LOCAL_HISTOGRAM_COUNTS_100(
"PageLoad.Clients.SubresourceLoading.LoadedCSSJSBeforeFCP.Cached",
loaded_css_js_from_cache_before_fcp_);
UMA_HISTOGRAM_COUNTS_100(
LOCAL_HISTOGRAM_COUNTS_100(
"PageLoad.Clients.SubresourceLoading.LoadedCSSJSBeforeFCP.Noncached",
loaded_css_js_from_network_before_fcp_);
......
......@@ -95,13 +95,6 @@ class PrefetchProxyPageLoadMetricsObserver
size_t loaded_css_js_from_cache_before_fcp_ = 0;
size_t loaded_css_js_from_network_before_fcp_ = 0;
// These vectors hold the durations that queries to the cookie manager and
// history service took, respectively. Since we only want to record these when
// we also record the query results, the query times are stashed here until
// |RecordMetrics()| is called.
std::vector<base::TimeDelta> cookie_query_times_;
std::vector<base::TimeDelta> history_query_times_;
// The minimum number of days since the last visit, as reported by
// HistoryService, to any origin in the redirect chain. Set to -1 if there is
// a response from the history service but was no previous visit.
......
......@@ -126,8 +126,6 @@ IN_PROC_BROWSER_TEST_F(IsolatedPrerenderPageLoadMetricsObserverBrowserTest,
"PageLoad.Clients.SubresourceLoading.HasPreviousVisitToOrigin", false, 1);
histogram_tester.ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.DaysSinceLastVisitToOrigin", 0);
histogram_tester.ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.HistoryQueryTime", 1);
// Revisit and expect a 0 days-ago entry.
NavigateToOriginPath("/index.html");
......@@ -139,8 +137,6 @@ IN_PROC_BROWSER_TEST_F(IsolatedPrerenderPageLoadMetricsObserverBrowserTest,
"PageLoad.Clients.SubresourceLoading.HasPreviousVisitToOrigin", false, 1);
histogram_tester.ExpectUniqueSample(
"PageLoad.Clients.SubresourceLoading.DaysSinceLastVisitToOrigin", 0, 1);
histogram_tester.ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.HistoryQueryTime", 2);
}
IN_PROC_BROWSER_TEST_F(IsolatedPrerenderPageLoadMetricsObserverBrowserTest,
......@@ -151,8 +147,6 @@ IN_PROC_BROWSER_TEST_F(IsolatedPrerenderPageLoadMetricsObserverBrowserTest,
histogram_tester.ExpectUniqueSample(
"PageLoad.Clients.SubresourceLoading.MainFrameHadCookies", false, 1);
histogram_tester.ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.CookiesQueryTime", 1);
VerifyNoUKM();
}
......@@ -167,8 +161,6 @@ IN_PROC_BROWSER_TEST_F(IsolatedPrerenderPageLoadMetricsObserverBrowserTest,
histogram_tester.ExpectUniqueSample(
"PageLoad.Clients.SubresourceLoading.MainFrameHadCookies", false, 1);
histogram_tester.ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.CookiesQueryTime", 1);
using UkmEntry = ukm::builders::PrefetchProxy;
VerifyUKMEntry(UkmEntry::kmainpage_request_had_cookiesName, 0);
......@@ -190,8 +182,6 @@ IN_PROC_BROWSER_TEST_F(IsolatedPrerenderPageLoadMetricsObserverBrowserTest,
// From the first page load.
histogram_tester.ExpectBucketCount(
"PageLoad.Clients.SubresourceLoading.MainFrameHadCookies", false, 1);
histogram_tester.ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.CookiesQueryTime", 2);
}
IN_PROC_BROWSER_TEST_F(IsolatedPrerenderPageLoadMetricsObserverBrowserTest,
......@@ -210,8 +200,6 @@ IN_PROC_BROWSER_TEST_F(IsolatedPrerenderPageLoadMetricsObserverBrowserTest,
// From the first page load.
histogram_tester.ExpectBucketCount(
"PageLoad.Clients.SubresourceLoading.MainFrameHadCookies", false, 1);
histogram_tester.ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.CookiesQueryTime", 3);
}
namespace {
......@@ -257,8 +245,6 @@ IN_PROC_BROWSER_TEST_F(IsolatedPrerenderPageLoadMetricsObserverBrowserTest,
// From the first page load.
histogram_tester.ExpectBucketCount(
"PageLoad.Clients.SubresourceLoading.MainFrameHadCookies", false, 1);
histogram_tester.ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.CookiesQueryTime", 3);
}
IN_PROC_BROWSER_TEST_F(IsolatedPrerenderPageLoadMetricsObserverBrowserTest,
......@@ -270,14 +256,10 @@ IN_PROC_BROWSER_TEST_F(IsolatedPrerenderPageLoadMetricsObserverBrowserTest,
NavigateAway();
VerifyNoUKM();
histogram_tester.ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.CookiesQueryTime", 0);
histogram_tester.ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.DaysSinceLastVisitToOrigin", 0);
histogram_tester.ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.HasPreviousVisitToOrigin", 0);
histogram_tester.ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.HistoryQueryTime", 0);
histogram_tester.ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.LoadedCSSJSBeforeFCP.Cached", 0);
histogram_tester.ExpectTotalCount(
......
......@@ -488,8 +488,6 @@ TEST_F(PrefetchProxyPageLoadMetricsObserverTest, LastVisitToHost_None) {
tester()->NavigateToUntrackedUrl();
tester()->histogram_tester().ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.HistoryQueryTime", 0);
tester()->histogram_tester().ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.HasPreviousVisitToOrigin", 0);
tester()->histogram_tester().ExpectTotalCount(
......@@ -505,8 +503,6 @@ TEST_F(PrefetchProxyPageLoadMetricsObserverTest, LastVisitToHost_Fail) {
{false /* success */, base::Time()});
tester()->NavigateToUntrackedUrl();
tester()->histogram_tester().ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.HistoryQueryTime", 1);
tester()->histogram_tester().ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.HasPreviousVisitToOrigin", 0);
tester()->histogram_tester().ExpectTotalCount(
......@@ -522,8 +518,6 @@ TEST_F(PrefetchProxyPageLoadMetricsObserverTest, LastVisitToHost_NullTime) {
{true /* success */, base::Time()});
tester()->NavigateToUntrackedUrl();
tester()->histogram_tester().ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.HistoryQueryTime", 1);
tester()->histogram_tester().ExpectUniqueSample(
"PageLoad.Clients.SubresourceLoading.HasPreviousVisitToOrigin", false, 1);
tester()->histogram_tester().ExpectTotalCount(
......@@ -540,8 +534,6 @@ TEST_F(PrefetchProxyPageLoadMetricsObserverTest, LastVisitToHost_Today) {
tester()->NavigateToUntrackedUrl();
tester()->histogram_tester().ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.HistoryQueryTime", 1);
tester()->histogram_tester().ExpectUniqueSample(
"PageLoad.Clients.SubresourceLoading.HasPreviousVisitToOrigin", true, 1);
tester()->histogram_tester().ExpectUniqueSample(
......@@ -558,8 +550,6 @@ TEST_F(PrefetchProxyPageLoadMetricsObserverTest, LastVisitToHost_Yesterday) {
tester()->NavigateToUntrackedUrl();
tester()->histogram_tester().ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.HistoryQueryTime", 1);
tester()->histogram_tester().ExpectUniqueSample(
"PageLoad.Clients.SubresourceLoading.HasPreviousVisitToOrigin", true, 1);
tester()->histogram_tester().ExpectUniqueSample(
......@@ -576,8 +566,6 @@ TEST_F(PrefetchProxyPageLoadMetricsObserverTest, LastVisitToHost_MaxUKM) {
tester()->NavigateToUntrackedUrl();
tester()->histogram_tester().ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.HistoryQueryTime", 1);
tester()->histogram_tester().ExpectUniqueSample(
"PageLoad.Clients.SubresourceLoading.HasPreviousVisitToOrigin", true, 1);
tester()->histogram_tester().ExpectUniqueSample(
......@@ -595,8 +583,6 @@ TEST_F(PrefetchProxyPageLoadMetricsObserverTest, LastVisitToHost_NoUKM) {
tester()->NavigateToUntrackedUrl();
tester()->histogram_tester().ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.HistoryQueryTime", 1);
tester()->histogram_tester().ExpectUniqueSample(
"PageLoad.Clients.SubresourceLoading.HasPreviousVisitToOrigin", true, 1);
tester()->histogram_tester().ExpectUniqueSample(
......@@ -612,8 +598,6 @@ TEST_F(PrefetchProxyPageLoadMetricsObserverTest, HadCookies_None) {
tester()->NavigateToUntrackedUrl();
tester()->histogram_tester().ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.CookiesQueryTime", 0);
tester()->histogram_tester().ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.MainFrameHadCookies", 0);
......@@ -626,8 +610,6 @@ TEST_F(PrefetchProxyPageLoadMetricsObserverTest, HadCookies_NoUKM) {
tester()->NavigateToUntrackedUrl();
tester()->histogram_tester().ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.CookiesQueryTime", 0);
tester()->histogram_tester().ExpectTotalCount(
"PageLoad.Clients.SubresourceLoading.MainFrameHadCookies", 0);
......
......@@ -539,6 +539,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="PageLoad.Clients.SubresourceLoading.CookiesQueryTime"
units="ms" expires_after="M90">
<obsolete>
Removed in M89.
</obsolete>
<owner>robertogden@chromium.org</owner>
<owner>tbansal@chromium.org</owner>
<summary>
......@@ -550,6 +553,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram
name="PageLoad.Clients.SubresourceLoading.DaysSinceLastVisitToOrigin"
units="days" expires_after="M90">
<obsolete>
Removed in M89.
</obsolete>
<owner>robertogden@chromium.org</owner>
<owner>tbansal@chromium.org</owner>
<summary>
......@@ -561,6 +567,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="PageLoad.Clients.SubresourceLoading.HasPreviousVisitToOrigin"
enum="BooleanPreviouslyVisited" expires_after="M90">
<obsolete>
Removed in M89.
</obsolete>
<owner>robertogden@chromium.org</owner>
<owner>tbansal@chromium.org</owner>
<summary>
......@@ -574,6 +583,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="PageLoad.Clients.SubresourceLoading.HistoryQueryTime"
units="ms" expires_after="M90">
<obsolete>
Removed in M89.
</obsolete>
<owner>robertogden@chromium.org</owner>
<owner>tbansal@chromium.org</owner>
<summary>
......@@ -585,6 +597,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram
name="PageLoad.Clients.SubresourceLoading.LoadedCSSJSBeforeFCP.Cached"
units="count of subresources" expires_after="M90">
<obsolete>
Removed in M89.
</obsolete>
<owner>robertogden@chromium.org</owner>
<owner>tbansal@chromium.org</owner>
<summary>
......@@ -596,6 +611,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram
name="PageLoad.Clients.SubresourceLoading.LoadedCSSJSBeforeFCP.Noncached"
units="count of subresources" expires_after="M90">
<obsolete>
Removed in M89.
</obsolete>
<owner>robertogden@chromium.org</owner>
<owner>tbansal@chromium.org</owner>
<summary>
......@@ -607,6 +625,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="PageLoad.Clients.SubresourceLoading.MainFrameHadCookies"
enum="Boolean" expires_after="M90">
<obsolete>
Removed in M89.
</obsolete>
<owner>robertogden@chromium.org</owner>
<owner>tbansal@chromium.org</owner>
<summary>
......
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