| Index: chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc
|
| diff --git a/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc
|
| index f7c44b2e982748fc9d2ca398e748c3351ab788bc..cfb0da450ec106e3f562e2f041b460b46afd51cc 100644
|
| --- a/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc
|
| +++ b/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc
|
| @@ -194,6 +194,9 @@ const char kHistogramTotalRequestsParseStop[] =
|
| const char kRapporMetricsNameCoarseTiming[] =
|
| "PageLoad.CoarseTiming.NavigationToFirstContentfulPaint";
|
|
|
| +const char kRapporMetricsNameFirstMeaningfulPaintNotRecorded[] =
|
| + "PageLoad.Experimental.PaintTiming.FirstMeaningfulPaintNotRecorded";
|
| +
|
| const char kHistogramFirstContentfulPaintUserInitiated[] =
|
| "PageLoad.PaintTiming.NavigationToFirstContentfulPaint.UserInitiated";
|
|
|
| @@ -624,23 +627,32 @@ void CorePageLoadMetricsObserver::RecordRappor(
|
| if (!info.time_to_commit)
|
| return;
|
| DCHECK(!info.committed_url.is_empty());
|
| +
|
| // Log the eTLD+1 of sites that show poor loading performance.
|
| - if (!WasStartedInForegroundOptionalEventInForeground(
|
| + if (WasStartedInForegroundOptionalEventInForeground(
|
| timing.first_contentful_paint, info)) {
|
| - return;
|
| + std::unique_ptr<rappor::Sample> sample =
|
| + rappor_service->CreateSample(rappor::UMA_RAPPOR_TYPE);
|
| + sample->SetStringField(
|
| + "Domain",
|
| + rappor::GetDomainAndRegistrySampleFromGURL(info.committed_url));
|
| + uint64_t bucket_index =
|
| + RapporHistogramBucketIndex(timing.first_contentful_paint.value());
|
| + sample->SetFlagsField("Bucket", uint64_t(1) << bucket_index,
|
| + kNumRapporHistogramBuckets);
|
| + // The IsSlow flag is just a one bit boolean if the first contentful paint
|
| + // was > 10s.
|
| + sample->SetFlagsField(
|
| + "IsSlow", timing.first_contentful_paint.value().InSecondsF() >= 10, 1);
|
| + rappor_service->RecordSampleObj(internal::kRapporMetricsNameCoarseTiming,
|
| + std::move(sample));
|
| + }
|
| +
|
| + // Log the eTLD+1 of sites that did not report first meaningful paint.
|
| + if (timing.first_paint && !timing.first_meaningful_paint) {
|
| + rappor::SampleDomainAndRegistryFromGURL(
|
| + rappor_service,
|
| + internal::kRapporMetricsNameFirstMeaningfulPaintNotRecorded,
|
| + info.committed_url);
|
| }
|
| - std::unique_ptr<rappor::Sample> sample =
|
| - rappor_service->CreateSample(rappor::UMA_RAPPOR_TYPE);
|
| - sample->SetStringField(
|
| - "Domain", rappor::GetDomainAndRegistrySampleFromGURL(info.committed_url));
|
| - uint64_t bucket_index =
|
| - RapporHistogramBucketIndex(timing.first_contentful_paint.value());
|
| - sample->SetFlagsField("Bucket", uint64_t(1) << bucket_index,
|
| - kNumRapporHistogramBuckets);
|
| - // The IsSlow flag is just a one bit boolean if the first contentful paint
|
| - // was > 10s.
|
| - sample->SetFlagsField(
|
| - "IsSlow", timing.first_contentful_paint.value().InSecondsF() >= 10, 1);
|
| - rappor_service->RecordSampleObj(internal::kRapporMetricsNameCoarseTiming,
|
| - std::move(sample));
|
| }
|
|
|