OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer/page_load_histograms.h" | 5 #include "chrome/renderer/page_load_histograms.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 if (!first_paint.is_null()) { | 249 if (!first_paint.is_null()) { |
250 // 'first_paint' can be before 'begin' for an unknown reason. | 250 // 'first_paint' can be before 'begin' for an unknown reason. |
251 // See bug http://crbug.com/125273 for details. | 251 // See bug http://crbug.com/125273 for details. |
252 if (begin <= first_paint) { | 252 if (begin <= first_paint) { |
253 PLT_HISTOGRAM("PLT.BeginToFirstPaint", first_paint - begin); | 253 PLT_HISTOGRAM("PLT.BeginToFirstPaint", first_paint - begin); |
254 } | 254 } |
255 DCHECK(commit <= first_paint); | 255 DCHECK(commit <= first_paint); |
256 PLT_HISTOGRAM("PLT.CommitToFirstPaint", first_paint - commit); | 256 PLT_HISTOGRAM("PLT.CommitToFirstPaint", first_paint - commit); |
257 } | 257 } |
258 if (!first_paint_after_load.is_null()) { | 258 if (!first_paint_after_load.is_null()) { |
259 DCHECK(begin <= first_paint_after_load); | 259 // 'first_paint_after_load' can be before 'begin' for an unknown reason. |
260 PLT_HISTOGRAM("PLT.BeginToFirstPaintAfterLoad", | 260 // See bug http://crbug.com/125273 for details. |
261 first_paint_after_load - begin); | 261 if (begin <= first_paint_after_load) { |
| 262 PLT_HISTOGRAM("PLT.BeginToFirstPaintAfterLoad", |
| 263 first_paint_after_load - begin); |
| 264 } |
262 DCHECK(commit <= first_paint_after_load); | 265 DCHECK(commit <= first_paint_after_load); |
263 PLT_HISTOGRAM("PLT.CommitToFirstPaintAfterLoad", | 266 PLT_HISTOGRAM("PLT.CommitToFirstPaintAfterLoad", |
264 first_paint_after_load - commit); | 267 first_paint_after_load - commit); |
265 DCHECK(finish_all_loads <= first_paint_after_load); | 268 DCHECK(finish_all_loads <= first_paint_after_load); |
266 PLT_HISTOGRAM("PLT.FinishToFirstPaintAfterLoad", | 269 PLT_HISTOGRAM("PLT.FinishToFirstPaintAfterLoad", |
267 first_paint_after_load - finish_all_loads); | 270 first_paint_after_load - finish_all_loads); |
268 } | 271 } |
269 PLT_HISTOGRAM("PLT.BeginToFinishDoc", begin_to_finish_doc); | 272 PLT_HISTOGRAM("PLT.BeginToFinishDoc", begin_to_finish_doc); |
270 PLT_HISTOGRAM("PLT.BeginToFinish", begin_to_finish_all_loads); | 273 PLT_HISTOGRAM("PLT.BeginToFinish", begin_to_finish_all_loads); |
271 | 274 |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 | 972 |
970 DCHECK(document_state); | 973 DCHECK(document_state); |
971 DCHECK(ds); | 974 DCHECK(ds); |
972 GURL url(ds->request().url()); | 975 GURL url(ds->request().url()); |
973 Time start = document_state->start_load_time(); | 976 Time start = document_state->start_load_time(); |
974 Time finish = document_state->finish_load_time(); | 977 Time finish = document_state->finish_load_time(); |
975 // TODO(mbelshe): should we log more stats? | 978 // TODO(mbelshe): should we log more stats? |
976 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " | 979 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " |
977 << url.spec(); | 980 << url.spec(); |
978 } | 981 } |
OLD | NEW |