Commit c25c01ff authored by Doug Arnett's avatar Doug Arnett Committed by Commit Bot

Two new scheme page load UMA variants for HTTPS slow page load analysis.

Adds HTTPS and HTTP scheme specific histograms for
NavigationToInteraction and NavigationStartedInForeground.

Bug: 903912
Change-Id: I1ef870ed5cc83c6c83a703d363b85f14812942fe
Reviewed-on: https://chromium-review.googlesource.com/c/1354104Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Reviewed-by: default avatarRyan Sturm <ryansturm@chromium.org>
Reviewed-by: default avatarRobert Kaplow <rkaplow@chromium.org>
Commit-Queue: Doug Arnett <dougarnett@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611902}
parent 604074aa
......@@ -28,6 +28,15 @@ SchemePageLoadMetricsObserver::OnStart(
content::NavigationHandle* navigation_handle,
const GURL& currently_committed_url,
bool started_in_foreground) {
if (currently_committed_url.scheme() == url::kHttpScheme) {
UMA_HISTOGRAM_BOOLEAN(
"PageLoad.Clients.Scheme.HTTP.Internal.NavigationStartedInForeground",
started_in_foreground);
} else if (currently_committed_url.scheme() == url::kHttpsScheme) {
UMA_HISTOGRAM_BOOLEAN(
"PageLoad.Clients.Scheme.HTTPS.Internal.NavigationStartedInForeground",
started_in_foreground);
}
return started_in_foreground ? CONTINUE_OBSERVING : STOP_OBSERVING;
}
......@@ -131,3 +140,17 @@ void SchemePageLoadMetricsObserver::OnFirstMeaningfulPaintInMainFrameDocument(
timing.paint_timing->first_meaningful_paint.value());
}
}
void SchemePageLoadMetricsObserver::OnPageInteractive(
const page_load_metrics::mojom::PageLoadTiming& timing,
const page_load_metrics::PageLoadExtraInfo& extra_info) {
if (extra_info.url.scheme() == url::kHttpScheme) {
PAGE_LOAD_HISTOGRAM(
"PageLoad.Clients.Scheme.HTTP.Experimental.NavigationToInteractive",
timing.interactive_timing->interactive.value());
} else if (extra_info.url.scheme() == url::kHttpsScheme) {
PAGE_LOAD_HISTOGRAM(
"PageLoad.Clients.Scheme.HTTPS.Experimental.NavigationToInteractive",
timing.interactive_timing->interactive.value());
}
}
......@@ -33,6 +33,9 @@ class SchemePageLoadMetricsObserver
void OnFirstMeaningfulPaintInMainFrameDocument(
const page_load_metrics::mojom::PageLoadTiming& timing,
const page_load_metrics::PageLoadExtraInfo& extra_info) override;
void OnPageInteractive(
const page_load_metrics::mojom::PageLoadTiming& timing,
const page_load_metrics::PageLoadExtraInfo& extra_info) override;
private:
DISALLOW_COPY_AND_ASSIGN(SchemePageLoadMetricsObserver);
......
......@@ -36,6 +36,8 @@ class SchemePageLoadMetricsObserverTest
base::TimeDelta::FromMilliseconds(600);
timing->document_timing->load_event_start =
base::TimeDelta::FromMilliseconds(1000);
timing->interactive_timing->interactive =
base::TimeDelta::FromMilliseconds(1200);
PopulateRequiredTimingFields(timing);
}
......@@ -138,12 +140,12 @@ class SchemePageLoadMetricsObserverTest
TEST_F(SchemePageLoadMetricsObserverTest, HTTPNavigation) {
SimulateNavigation(url::kHttpScheme);
CheckHistograms(3, url::kHttpScheme);
CheckHistograms(5, url::kHttpScheme);
}
TEST_F(SchemePageLoadMetricsObserverTest, HTTPSNavigation) {
SimulateNavigation(url::kHttpsScheme);
CheckHistograms(3, url::kHttpsScheme);
CheckHistograms(5, url::kHttpsScheme);
}
// Make sure no metrics are recorded for an unobserved scheme.
......
......@@ -135011,8 +135011,10 @@ uploading your change for review.
<suffix name="Clients.Scheme.HTTPS"
label="PageLoadMetrics that are a result of a navigation to a main
resource where the committed URL is HTTPS."/>
<affected-histogram name="PageLoad.Experimental.NavigationToInteractive"/>
<affected-histogram
name="PageLoad.Experimental.PaintTiming.NavigationToFirstMeaningfulPaint"/>
<affected-histogram name="PageLoad.Internal.NavigationStartedInForeground"/>
<affected-histogram
name="PageLoad.PaintTiming.NavigationToFirstContentfulPaint"/>
<affected-histogram name="PageLoad.ParseTiming.NavigationToParseStart"/>
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