Commit ce2f20c6 authored by Matt Falkenhagen's avatar Matt Falkenhagen Committed by Chromium LUCI CQ

service worker: Remove obsolete Google Inbox-specific metrics.

Change-Id: I194d88dd986223ab1edae84d26218ea1ff921b29
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2596734Reviewed-by: default avatarCharlie Harrison <csharrison@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840499}
parent 29d23b32
...@@ -57,21 +57,6 @@ const char kHistogramServiceWorkerLargestContentfulPaint[] = ...@@ -57,21 +57,6 @@ const char kHistogramServiceWorkerLargestContentfulPaint[] =
"PageLoad.Clients.ServiceWorker2.PaintTiming." "PageLoad.Clients.ServiceWorker2.PaintTiming."
"NavigationToLargestContentfulPaint2"; "NavigationToLargestContentfulPaint2";
const char kHistogramServiceWorkerParseStartInbox[] =
"PageLoad.Clients.ServiceWorker2.ParseTiming.NavigationToParseStart.inbox";
const char kHistogramServiceWorkerFirstContentfulPaintInbox[] =
"PageLoad.Clients.ServiceWorker2.PaintTiming."
"NavigationToFirstContentfulPaint.inbox";
const char kHistogramServiceWorkerParseStartToFirstContentfulPaintInbox[] =
"PageLoad.Clients.ServiceWorker2.PaintTiming."
"ParseStartToFirstContentfulPaint.inbox";
const char kHistogramServiceWorkerDomContentLoadedInbox[] =
"PageLoad.Clients.ServiceWorker2.DocumentTiming."
"NavigationToDOMContentLoadedEventFired.inbox";
const char kHistogramServiceWorkerLoadInbox[] =
"PageLoad.Clients.ServiceWorker2.DocumentTiming.NavigationToLoadEventFired."
"inbox";
const char kHistogramServiceWorkerParseStartSearch[] = const char kHistogramServiceWorkerParseStartSearch[] =
"PageLoad.Clients.ServiceWorker2.ParseTiming.NavigationToParseStart.search"; "PageLoad.Clients.ServiceWorker2.ParseTiming.NavigationToParseStart.search";
const char kHistogramServiceWorkerFirstContentfulPaintSearch[] = const char kHistogramServiceWorkerFirstContentfulPaintSearch[] =
...@@ -111,10 +96,6 @@ const char kHistogramNoServiceWorkerFirstContentfulPaintDocs[] = ...@@ -111,10 +96,6 @@ const char kHistogramNoServiceWorkerFirstContentfulPaintDocs[] =
namespace { namespace {
bool IsInboxSite(const GURL& url) {
return url.host_piece() == "inbox.google.com";
}
bool IsDocsSite(const GURL& url) { bool IsDocsSite(const GURL& url) {
return url.host_piece() == "docs.google.com"; return url.host_piece() == "docs.google.com";
} }
...@@ -202,16 +183,7 @@ void ServiceWorkerPageLoadMetricsObserver::OnFirstContentfulPaintInPage( ...@@ -202,16 +183,7 @@ void ServiceWorkerPageLoadMetricsObserver::OnFirstContentfulPaintInPage(
} }
} }
if (IsInboxSite(GetDelegate().GetUrl())) { if (page_load_metrics::IsGoogleSearchResultUrl(GetDelegate().GetUrl())) {
PAGE_LOAD_HISTOGRAM(
internal::kHistogramServiceWorkerFirstContentfulPaintInbox,
timing.paint_timing->first_contentful_paint.value());
PAGE_LOAD_HISTOGRAM(
internal::kHistogramServiceWorkerParseStartToFirstContentfulPaintInbox,
timing.paint_timing->first_contentful_paint.value() -
timing.parse_timing->parse_start.value());
} else if (page_load_metrics::IsGoogleSearchResultUrl(
GetDelegate().GetUrl())) {
PAGE_LOAD_HISTOGRAM( PAGE_LOAD_HISTOGRAM(
internal::kHistogramServiceWorkerFirstContentfulPaintSearch, internal::kHistogramServiceWorkerFirstContentfulPaintSearch,
timing.paint_timing->first_contentful_paint.value()); timing.paint_timing->first_contentful_paint.value());
...@@ -244,12 +216,7 @@ void ServiceWorkerPageLoadMetricsObserver::OnDomContentLoadedEventStart( ...@@ -244,12 +216,7 @@ void ServiceWorkerPageLoadMetricsObserver::OnDomContentLoadedEventStart(
PAGE_LOAD_HISTOGRAM( PAGE_LOAD_HISTOGRAM(
internal::kHistogramServiceWorkerDomContentLoaded, internal::kHistogramServiceWorkerDomContentLoaded,
timing.document_timing->dom_content_loaded_event_start.value()); timing.document_timing->dom_content_loaded_event_start.value());
if (IsInboxSite(GetDelegate().GetUrl())) { if (page_load_metrics::IsGoogleSearchResultUrl(GetDelegate().GetUrl())) {
PAGE_LOAD_HISTOGRAM(
internal::kHistogramServiceWorkerDomContentLoadedInbox,
timing.document_timing->dom_content_loaded_event_start.value());
} else if (page_load_metrics::IsGoogleSearchResultUrl(
GetDelegate().GetUrl())) {
PAGE_LOAD_HISTOGRAM( PAGE_LOAD_HISTOGRAM(
internal::kHistogramServiceWorkerDomContentLoadedSearch, internal::kHistogramServiceWorkerDomContentLoadedSearch,
timing.document_timing->dom_content_loaded_event_start.value()); timing.document_timing->dom_content_loaded_event_start.value());
...@@ -270,11 +237,7 @@ void ServiceWorkerPageLoadMetricsObserver::OnLoadEventStart( ...@@ -270,11 +237,7 @@ void ServiceWorkerPageLoadMetricsObserver::OnLoadEventStart(
} }
PAGE_LOAD_HISTOGRAM(internal::kHistogramServiceWorkerLoad, PAGE_LOAD_HISTOGRAM(internal::kHistogramServiceWorkerLoad,
timing.document_timing->load_event_start.value()); timing.document_timing->load_event_start.value());
if (IsInboxSite(GetDelegate().GetUrl())) { if (page_load_metrics::IsGoogleSearchResultUrl(GetDelegate().GetUrl())) {
PAGE_LOAD_HISTOGRAM(internal::kHistogramServiceWorkerLoadInbox,
timing.document_timing->load_event_start.value());
} else if (page_load_metrics::IsGoogleSearchResultUrl(
GetDelegate().GetUrl())) {
PAGE_LOAD_HISTOGRAM(internal::kHistogramServiceWorkerLoadSearch, PAGE_LOAD_HISTOGRAM(internal::kHistogramServiceWorkerLoadSearch,
timing.document_timing->load_event_start.value()); timing.document_timing->load_event_start.value());
} }
...@@ -317,11 +280,7 @@ void ServiceWorkerPageLoadMetricsObserver::OnParseStart( ...@@ -317,11 +280,7 @@ void ServiceWorkerPageLoadMetricsObserver::OnParseStart(
PAGE_LOAD_HISTOGRAM(internal::kHistogramServiceWorkerParseStart, PAGE_LOAD_HISTOGRAM(internal::kHistogramServiceWorkerParseStart,
timing.parse_timing->parse_start.value()); timing.parse_timing->parse_start.value());
if (IsInboxSite(GetDelegate().GetUrl())) { if (page_load_metrics::IsGoogleSearchResultUrl(GetDelegate().GetUrl())) {
PAGE_LOAD_HISTOGRAM(internal::kHistogramServiceWorkerParseStartInbox,
timing.parse_timing->parse_start.value());
} else if (page_load_metrics::IsGoogleSearchResultUrl(
GetDelegate().GetUrl())) {
PAGE_LOAD_HISTOGRAM(internal::kHistogramServiceWorkerParseStartSearch, PAGE_LOAD_HISTOGRAM(internal::kHistogramServiceWorkerParseStartSearch,
timing.parse_timing->parse_start.value()); timing.parse_timing->parse_start.value());
} }
......
...@@ -26,15 +26,7 @@ extern const char kHistogramServiceWorkerParseStartToFirstContentfulPaint[]; ...@@ -26,15 +26,7 @@ extern const char kHistogramServiceWorkerParseStartToFirstContentfulPaint[];
extern const char kHistogramServiceWorkerDomContentLoaded[]; extern const char kHistogramServiceWorkerDomContentLoaded[];
extern const char kHistogramServiceWorkerLoad[]; extern const char kHistogramServiceWorkerLoad[];
extern const char kHistogramServiceWorkerLargestContentfulPaint[]; extern const char kHistogramServiceWorkerLargestContentfulPaint[];
extern const char kHistogramServiceWorkerParseStartInbox[];
extern const char kHistogramServiceWorkerFirstContentfulPaintInbox[];
extern const char kHistogramServiceWorkerFirstInputDelay[]; extern const char kHistogramServiceWorkerFirstInputDelay[];
extern const char
kHistogramServiceWorkerParseStartToFirstContentfulPaintInbox[];
extern const char kHistogramServiceWorkerDomContentLoadedInbox[];
extern const char kHistogramServiceWorkerLoadInbox[];
extern const char kHistogramServiceWorkerParseStartSearch[]; extern const char kHistogramServiceWorkerParseStartSearch[];
extern const char kHistogramServiceWorkerFirstContentfulPaintSearch[]; extern const char kHistogramServiceWorkerFirstContentfulPaintSearch[];
extern const char extern const char
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
namespace { namespace {
const char kDefaultTestUrl[] = "https://google.com/"; const char kDefaultTestUrl[] = "https://google.com/";
const char kInboxTestUrl[] = "https://inbox.google.com/test";
const char kSearchTestUrl[] = "https://www.google.com/search?q=test"; const char kSearchTestUrl[] = "https://www.google.com/search?q=test";
} // namespace } // namespace
...@@ -67,20 +66,6 @@ class ServiceWorkerPageLoadMetricsObserverTest ...@@ -67,20 +66,6 @@ class ServiceWorkerPageLoadMetricsObserverTest
internal::kHistogramServiceWorkerLargestContentfulPaint, 0); internal::kHistogramServiceWorkerLargestContentfulPaint, 0);
} }
void AssertNoInboxHistogramsLogged() {
tester()->histogram_tester().ExpectTotalCount(
internal::kHistogramServiceWorkerParseStartInbox, 0);
tester()->histogram_tester().ExpectTotalCount(
internal::kHistogramServiceWorkerFirstContentfulPaintInbox, 0);
tester()->histogram_tester().ExpectTotalCount(
internal::kHistogramServiceWorkerParseStartToFirstContentfulPaintInbox,
0);
tester()->histogram_tester().ExpectTotalCount(
internal::kHistogramServiceWorkerDomContentLoadedInbox, 0);
tester()->histogram_tester().ExpectTotalCount(
internal::kHistogramServiceWorkerLoadInbox, 0);
}
void AssertNoSearchHistogramsLogged() { void AssertNoSearchHistogramsLogged() {
tester()->histogram_tester().ExpectTotalCount( tester()->histogram_tester().ExpectTotalCount(
internal::kHistogramServiceWorkerParseStartSearch, 0); internal::kHistogramServiceWorkerParseStartSearch, 0);
...@@ -136,7 +121,6 @@ class ServiceWorkerPageLoadMetricsObserverTest ...@@ -136,7 +121,6 @@ class ServiceWorkerPageLoadMetricsObserverTest
TEST_F(ServiceWorkerPageLoadMetricsObserverTest, NoMetrics) { TEST_F(ServiceWorkerPageLoadMetricsObserverTest, NoMetrics) {
AssertNoServiceWorkerHistogramsLogged(); AssertNoServiceWorkerHistogramsLogged();
AssertNoInboxHistogramsLogged();
AssertNoSearchHistogramsLogged(); AssertNoSearchHistogramsLogged();
AssertNoSearchNoSWHistogramsLogged(); AssertNoSearchNoSWHistogramsLogged();
EXPECT_EQ(0ul, tester()->test_ukm_recorder().entries_count()); EXPECT_EQ(0ul, tester()->test_ukm_recorder().entries_count());
...@@ -150,7 +134,6 @@ TEST_F(ServiceWorkerPageLoadMetricsObserverTest, NoServiceWorker) { ...@@ -150,7 +134,6 @@ TEST_F(ServiceWorkerPageLoadMetricsObserverTest, NoServiceWorker) {
tester()->SimulateTimingUpdate(timing); tester()->SimulateTimingUpdate(timing);
AssertNoServiceWorkerHistogramsLogged(); AssertNoServiceWorkerHistogramsLogged();
AssertNoInboxHistogramsLogged();
AssertNoSearchHistogramsLogged(); AssertNoSearchHistogramsLogged();
AssertNoSearchNoSWHistogramsLogged(); AssertNoSearchNoSWHistogramsLogged();
// Only a DocumentCreated entry and an Unload entry is logged for creation of // Only a DocumentCreated entry and an Unload entry is logged for creation of
...@@ -242,7 +225,6 @@ TEST_F(ServiceWorkerPageLoadMetricsObserverTest, WithServiceWorker) { ...@@ -242,7 +225,6 @@ TEST_F(ServiceWorkerPageLoadMetricsObserverTest, WithServiceWorker) {
entry, GURL(kDefaultTestUrl)); entry, GURL(kDefaultTestUrl));
} }
AssertNoInboxHistogramsLogged();
AssertNoSearchHistogramsLogged(); AssertNoSearchHistogramsLogged();
AssertNoSearchNoSWHistogramsLogged(); AssertNoSearchNoSWHistogramsLogged();
} }
...@@ -296,101 +278,6 @@ TEST_F(ServiceWorkerPageLoadMetricsObserverTest, WithServiceWorkerBackground) { ...@@ -296,101 +278,6 @@ TEST_F(ServiceWorkerPageLoadMetricsObserverTest, WithServiceWorkerBackground) {
entry, GURL(kDefaultTestUrl)); entry, GURL(kDefaultTestUrl));
} }
AssertNoInboxHistogramsLogged();
AssertNoSearchHistogramsLogged();
AssertNoSearchNoSWHistogramsLogged();
}
TEST_F(ServiceWorkerPageLoadMetricsObserverTest, InboxSite) {
page_load_metrics::mojom::PageLoadTiming timing;
InitializeTestPageLoadTiming(&timing);
NavigateAndCommit(GURL(kInboxTestUrl));
page_load_metrics::mojom::FrameMetadata metadata;
metadata.behavior_flags |=
blink::LoadingBehaviorFlag::kLoadingBehaviorServiceWorkerControlled;
tester()->SimulateTimingAndMetadataUpdate(timing, metadata);
tester()->histogram_tester().ExpectTotalCount(
internal::kHistogramServiceWorkerParseStart, 1);
tester()->histogram_tester().ExpectBucketCount(
internal::kHistogramServiceWorkerParseStart,
timing.parse_timing->parse_start.value().InMilliseconds(), 1);
tester()->histogram_tester().ExpectTotalCount(
internal::kHistogramServiceWorkerParseStartInbox, 1);
tester()->histogram_tester().ExpectBucketCount(
internal::kHistogramServiceWorkerParseStartInbox,
timing.parse_timing->parse_start.value().InMilliseconds(), 1);
tester()->histogram_tester().ExpectTotalCount(
internal::kHistogramServiceWorkerFirstPaint, 1);
tester()->histogram_tester().ExpectBucketCount(
internal::kHistogramServiceWorkerFirstPaint,
timing.paint_timing->first_paint.value().InMilliseconds(), 1);
tester()->histogram_tester().ExpectTotalCount(
internal::kHistogramServiceWorkerFirstContentfulPaint, 1);
tester()->histogram_tester().ExpectBucketCount(
internal::kHistogramServiceWorkerFirstContentfulPaint,
timing.paint_timing->first_contentful_paint.value().InMilliseconds(), 1);
tester()->histogram_tester().ExpectTotalCount(
internal::kHistogramServiceWorkerFirstContentfulPaintInbox, 1);
tester()->histogram_tester().ExpectBucketCount(
internal::kHistogramServiceWorkerFirstContentfulPaintInbox,
timing.paint_timing->first_contentful_paint.value().InMilliseconds(), 1);
tester()->histogram_tester().ExpectTotalCount(
internal::kBackgroundHistogramServiceWorkerFirstContentfulPaint, 0);
tester()->histogram_tester().ExpectTotalCount(
internal::kHistogramServiceWorkerParseStartToFirstContentfulPaint, 1);
tester()->histogram_tester().ExpectBucketCount(
internal::kHistogramServiceWorkerParseStartToFirstContentfulPaint,
(timing.paint_timing->first_contentful_paint.value() -
timing.parse_timing->parse_start.value())
.InMilliseconds(),
1);
tester()->histogram_tester().ExpectTotalCount(
internal::kHistogramServiceWorkerParseStartToFirstContentfulPaintInbox,
1);
tester()->histogram_tester().ExpectBucketCount(
internal::kHistogramServiceWorkerParseStartToFirstContentfulPaintInbox,
(timing.paint_timing->first_contentful_paint.value() -
timing.parse_timing->parse_start.value())
.InMilliseconds(),
1);
tester()->histogram_tester().ExpectTotalCount(
internal::kHistogramServiceWorkerDomContentLoaded, 1);
tester()->histogram_tester().ExpectBucketCount(
internal::kHistogramServiceWorkerDomContentLoaded,
timing.document_timing->dom_content_loaded_event_start.value()
.InMilliseconds(),
1);
tester()->histogram_tester().ExpectTotalCount(
internal::kHistogramServiceWorkerDomContentLoadedInbox, 1);
tester()->histogram_tester().ExpectBucketCount(
internal::kHistogramServiceWorkerDomContentLoadedInbox,
timing.document_timing->dom_content_loaded_event_start.value()
.InMilliseconds(),
1);
tester()->histogram_tester().ExpectTotalCount(
internal::kHistogramServiceWorkerLoad, 1);
tester()->histogram_tester().ExpectBucketCount(
internal::kHistogramServiceWorkerLoad,
timing.document_timing->load_event_start.value().InMilliseconds(), 1);
tester()->histogram_tester().ExpectTotalCount(
internal::kHistogramServiceWorkerLoadInbox, 1);
tester()->histogram_tester().ExpectBucketCount(
internal::kHistogramServiceWorkerLoadInbox,
timing.document_timing->load_event_start.value().InMilliseconds(), 1);
tester()->histogram_tester().ExpectTotalCount(
internal::kHistogramServiceWorkerParseStart, 1);
tester()->histogram_tester().ExpectBucketCount(
internal::kHistogramServiceWorkerParseStart,
timing.parse_timing->parse_start.value().InMilliseconds(), 1);
AssertNoSearchHistogramsLogged(); AssertNoSearchHistogramsLogged();
AssertNoSearchNoSWHistogramsLogged(); AssertNoSearchNoSWHistogramsLogged();
} }
...@@ -485,7 +372,6 @@ TEST_F(ServiceWorkerPageLoadMetricsObserverTest, SearchSite) { ...@@ -485,7 +372,6 @@ TEST_F(ServiceWorkerPageLoadMetricsObserverTest, SearchSite) {
internal::kHistogramServiceWorkerParseStart, internal::kHistogramServiceWorkerParseStart,
timing.parse_timing->parse_start.value().InMilliseconds(), 1); timing.parse_timing->parse_start.value().InMilliseconds(), 1);
AssertNoInboxHistogramsLogged();
AssertNoSearchNoSWHistogramsLogged(); AssertNoSearchNoSWHistogramsLogged();
} }
...@@ -528,7 +414,6 @@ TEST_F(ServiceWorkerPageLoadMetricsObserverTest, SearchNoSWSite) { ...@@ -528,7 +414,6 @@ TEST_F(ServiceWorkerPageLoadMetricsObserverTest, SearchNoSWSite) {
timing.document_timing->load_event_start.value().InMilliseconds(), 1); timing.document_timing->load_event_start.value().InMilliseconds(), 1);
AssertNoServiceWorkerHistogramsLogged(); AssertNoServiceWorkerHistogramsLogged();
AssertNoInboxHistogramsLogged();
AssertNoSearchHistogramsLogged(); AssertNoSearchHistogramsLogged();
} }
......
...@@ -12973,7 +12973,11 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -12973,7 +12973,11 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram_suffixes name="PageLoadMetricsClientsServiceWorkerSpecialApps" <histogram_suffixes name="PageLoadMetricsClientsServiceWorkerSpecialApps"
separator="."> separator=".">
<suffix name="docs" label="Custom histogram for the Google Docs page"/> <suffix name="docs" label="Custom histogram for the Google Docs page"/>
<suffix name="inbox" label="Custom histogram for Inbox"/> <suffix name="inbox" label="Custom histogram for Inbox">
<obsolete>
Removed December 2020.
</obsolete>
</suffix>
<suffix name="search" <suffix name="search"
label="Custom histogram for the Google Search results page"/> label="Custom histogram for the Google Search results page"/>
<affected-histogram <affected-histogram
......
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