OLD | NEW |
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 "components/page_load_metrics/browser/metrics_web_contents_observer.h" | 5 #include "components/page_load_metrics/browser/metrics_web_contents_observer.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/metrics/user_metrics.h" | 10 #include "base/metrics/user_metrics.h" |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 } else { | 272 } else { |
273 PAGE_LOAD_HISTOGRAM(kBackgroundHistogramFirstImagePaint, | 273 PAGE_LOAD_HISTOGRAM(kBackgroundHistogramFirstImagePaint, |
274 timing_.first_image_paint); | 274 timing_.first_image_paint); |
275 } | 275 } |
276 } | 276 } |
277 base::TimeDelta first_contentful_paint = GetFirstContentfulPaint(timing_); | 277 base::TimeDelta first_contentful_paint = GetFirstContentfulPaint(timing_); |
278 if (!first_contentful_paint.is_zero()) { | 278 if (!first_contentful_paint.is_zero()) { |
279 if (first_contentful_paint < background_delta) { | 279 if (first_contentful_paint < background_delta) { |
280 PAGE_LOAD_HISTOGRAM(kHistogramFirstContentfulPaint, | 280 PAGE_LOAD_HISTOGRAM(kHistogramFirstContentfulPaint, |
281 first_contentful_paint); | 281 first_contentful_paint); |
| 282 // Bucket these histograms into high/low resolution clock systems. This |
| 283 // might point us to directions that will de-noise some UMA. |
| 284 if (base::TimeTicks::IsHighResolution()) { |
| 285 PAGE_LOAD_HISTOGRAM(kHistogramFirstContentfulPaintHigh, |
| 286 first_contentful_paint); |
| 287 } else { |
| 288 PAGE_LOAD_HISTOGRAM(kHistogramFirstContentfulPaintLow, |
| 289 first_contentful_paint); |
| 290 } |
282 } else { | 291 } else { |
283 PAGE_LOAD_HISTOGRAM(kBackgroundHistogramFirstContentfulPaint, | 292 PAGE_LOAD_HISTOGRAM(kBackgroundHistogramFirstContentfulPaint, |
284 first_contentful_paint); | 293 first_contentful_paint); |
285 } | 294 } |
286 } | 295 } |
287 | 296 |
288 // Log time to first foreground / time to first background. Log counts that we | 297 // Log time to first foreground / time to first background. Log counts that we |
289 // started a relevant page load in the foreground / background. | 298 // started a relevant page load in the foreground / background. |
290 if (!background_time_.is_null()) { | 299 if (!background_time_.is_null()) { |
291 PAGE_LOAD_HISTOGRAM(kHistogramFirstBackground, background_delta); | 300 PAGE_LOAD_HISTOGRAM(kHistogramFirstBackground, background_delta); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 534 |
526 if (!committed_load_->UpdateTiming(timing)) { | 535 if (!committed_load_->UpdateTiming(timing)) { |
527 // If the page load tracker cannot update its timing, something is wrong | 536 // If the page load tracker cannot update its timing, something is wrong |
528 // with the IPC (it's from another load, or it's invalid in some other way). | 537 // with the IPC (it's from another load, or it's invalid in some other way). |
529 // We expect this to be a rare occurrence. | 538 // We expect this to be a rare occurrence. |
530 RecordInternalError(ERR_BAD_TIMING_IPC); | 539 RecordInternalError(ERR_BAD_TIMING_IPC); |
531 } | 540 } |
532 } | 541 } |
533 | 542 |
534 } // namespace page_load_metrics | 543 } // namespace page_load_metrics |
OLD | NEW |