Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Side by Side Diff: chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc

Issue 1871393002: Add NavigationToFirstContentfulPaint UMA for ServiceWorker controlled pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated ksakamoto's comment Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/page_load_metrics/common/page_load_metrics_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/page_load_metrics/observers/core_page_load_metrics_obse rver.h" 5 #include "chrome/browser/page_load_metrics/observers/core_page_load_metrics_obse rver.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 "PageLoad.Timing2.ParseBlockedOnScriptLoad.Background"; 90 "PageLoad.Timing2.ParseBlockedOnScriptLoad.Background";
91 const char kBackgroundHistogramParseBlockedOnScriptLoadParseComplete[] = 91 const char kBackgroundHistogramParseBlockedOnScriptLoadParseComplete[] =
92 "PageLoad.Timing2.ParseBlockedOnScriptLoad.ParseComplete.Background"; 92 "PageLoad.Timing2.ParseBlockedOnScriptLoad.ParseComplete.Background";
93 const char kBackgroundHistogramParseBlockedOnScriptLoadDocumentWrite[] = 93 const char kBackgroundHistogramParseBlockedOnScriptLoadDocumentWrite[] =
94 "PageLoad.Timing2.ParseBlockedOnScriptLoadFromDocumentWrite.Background"; 94 "PageLoad.Timing2.ParseBlockedOnScriptLoadFromDocumentWrite.Background";
95 const char 95 const char
96 kBackgroundHistogramParseBlockedOnScriptLoadDocumentWriteParseComplete[] = 96 kBackgroundHistogramParseBlockedOnScriptLoadDocumentWriteParseComplete[] =
97 "PageLoad.Timing2.ParseBlockedOnScriptLoadFromDocumentWrite." 97 "PageLoad.Timing2.ParseBlockedOnScriptLoadFromDocumentWrite."
98 "ParseComplete.Background"; 98 "ParseComplete.Background";
99 99
100 const char kServiceWorkerHistogramFirstContentfulPaint[] =
Bryan McQuade 2016/04/12 20:29:10 I wonder if this should instead be under PageLoad.
101 "PageLoad.Timing2.NavigationToFirstContentfulPaint.ServiceWorker";
102
100 const char kHistogramFirstContentfulPaintHigh[] = 103 const char kHistogramFirstContentfulPaintHigh[] =
101 "PageLoad.Timing2.NavigationToFirstContentfulPaint.HighResolutionClock"; 104 "PageLoad.Timing2.NavigationToFirstContentfulPaint.HighResolutionClock";
102 const char kHistogramFirstContentfulPaintLow[] = 105 const char kHistogramFirstContentfulPaintLow[] =
103 "PageLoad.Timing2.NavigationToFirstContentfulPaint.LowResolutionClock"; 106 "PageLoad.Timing2.NavigationToFirstContentfulPaint.LowResolutionClock";
104 107
105 const char kHistogramFirstBackground[] = 108 const char kHistogramFirstBackground[] =
106 "PageLoad.Timing2.NavigationToFirstBackground"; 109 "PageLoad.Timing2.NavigationToFirstBackground";
107 const char kHistogramFirstForeground[] = 110 const char kHistogramFirstForeground[] =
108 "PageLoad.Timing2.NavigationToFirstForeground"; 111 "PageLoad.Timing2.NavigationToFirstForeground";
109 112
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 timing.first_contentful_paint); 278 timing.first_contentful_paint);
276 // Bucket these histograms into high/low resolution clock systems. This 279 // Bucket these histograms into high/low resolution clock systems. This
277 // might point us to directions that will de-noise some UMA. 280 // might point us to directions that will de-noise some UMA.
278 if (base::TimeTicks::IsHighResolution()) { 281 if (base::TimeTicks::IsHighResolution()) {
279 PAGE_LOAD_HISTOGRAM(internal::kHistogramFirstContentfulPaintHigh, 282 PAGE_LOAD_HISTOGRAM(internal::kHistogramFirstContentfulPaintHigh,
280 timing.first_contentful_paint); 283 timing.first_contentful_paint);
281 } else { 284 } else {
282 PAGE_LOAD_HISTOGRAM(internal::kHistogramFirstContentfulPaintLow, 285 PAGE_LOAD_HISTOGRAM(internal::kHistogramFirstContentfulPaintLow,
283 timing.first_contentful_paint); 286 timing.first_contentful_paint);
284 } 287 }
288 if (!timing.worker_start.is_null()) {
Bryan McQuade 2016/04/12 20:29:10 I'm disinclined to use absolute times in our metri
289 PAGE_LOAD_HISTOGRAM(
290 internal::kServiceWorkerHistogramFirstContentfulPaint,
291 timing.first_contentful_paint);
292 }
285 PAGE_LOAD_HISTOGRAM(internal::kHistogramDomLoadingToFirstContentfulPaint, 293 PAGE_LOAD_HISTOGRAM(internal::kHistogramDomLoadingToFirstContentfulPaint,
286 timing.first_contentful_paint - timing.dom_loading); 294 timing.first_contentful_paint - timing.dom_loading);
287 } else { 295 } else {
288 PAGE_LOAD_HISTOGRAM(internal::kBackgroundHistogramFirstContentfulPaint, 296 PAGE_LOAD_HISTOGRAM(internal::kBackgroundHistogramFirstContentfulPaint,
289 timing.first_contentful_paint); 297 timing.first_contentful_paint);
290 } 298 }
291 } 299 }
292 if (!timing.parse_start.is_zero()) { 300 if (!timing.parse_start.is_zero()) {
293 const bool incomplete_parse_in_foreground = 301 const bool incomplete_parse_in_foreground =
294 timing.parse_stop.is_zero() && info.started_in_foreground && 302 timing.parse_stop.is_zero() && info.started_in_foreground &&
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 RapporHistogramBucketIndex(timing.first_contentful_paint); 385 RapporHistogramBucketIndex(timing.first_contentful_paint);
378 sample->SetFlagsField("Bucket", uint64_t(1) << bucket_index, 386 sample->SetFlagsField("Bucket", uint64_t(1) << bucket_index,
379 kNumRapporHistogramBuckets); 387 kNumRapporHistogramBuckets);
380 // The IsSlow flag is just a one bit boolean if the first contentful paint 388 // The IsSlow flag is just a one bit boolean if the first contentful paint
381 // was > 10s. 389 // was > 10s.
382 sample->SetFlagsField("IsSlow", 390 sample->SetFlagsField("IsSlow",
383 timing.first_contentful_paint.InSecondsF() >= 10, 1); 391 timing.first_contentful_paint.InSecondsF() >= 10, 1);
384 rappor_service->RecordSampleObj(internal::kRapporMetricsNameCoarseTiming, 392 rappor_service->RecordSampleObj(internal::kRapporMetricsNameCoarseTiming,
385 std::move(sample)); 393 std::move(sample));
386 } 394 }
OLDNEW
« no previous file with comments | « no previous file | components/page_load_metrics/common/page_load_metrics_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698