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

Side by Side Diff: chrome/renderer/page_load_histograms.cc

Issue 5382006: Don't add to LoadStart and LoadEnd histograms if load event hasn't fired yet. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 missing_start_type |= commit.is_null() ? COMMIT_MISSING : 0; 99 missing_start_type |= commit.is_null() ? COMMIT_MISSING : 0;
100 missing_start_type |= navigation_start.is_null() ? NAV_START_MISSING : 0; 100 missing_start_type |= navigation_start.is_null() ? NAV_START_MISSING : 0;
101 UMA_HISTOGRAM_ENUMERATION("PLT.MissingStart", missing_start_type, 101 UMA_HISTOGRAM_ENUMERATION("PLT.MissingStart", missing_start_type,
102 MISSING_START_TYPE_MAX); 102 MISSING_START_TYPE_MAX);
103 if (missing_start_type) 103 if (missing_start_type)
104 return; 104 return;
105 105
106 // Record the new PLT times prior to the faulty abandon check below. 106 // Record the new PLT times prior to the faulty abandon check below.
107 // TODO(tonyg): There are many new details we can record, add them after the 107 // TODO(tonyg): There are many new details we can record, add them after the
108 // basic metrics are evaluated. 108 // basic metrics are evaluated.
109 TimeDelta nav_start_to_load_start = load_event_start - navigation_start; 109 if (!load_event_start.is_null() && !load_event_end.is_null()) {
110 TimeDelta nav_start_to_load_end = load_event_end - navigation_start; 110 TimeDelta nav_start_to_load_start = load_event_start - navigation_start;
111 PLT_HISTOGRAM("PLT.NavStartToLoadStart", nav_start_to_load_start); 111 TimeDelta nav_start_to_load_end = load_event_end - navigation_start;
112 PLT_HISTOGRAM("PLT.NavStartToLoadEnd", nav_start_to_load_end); 112 PLT_HISTOGRAM("PLT.NavStartToLoadStart", nav_start_to_load_start);
113 PLT_HISTOGRAM("PLT.NavStartToLoadEnd", nav_start_to_load_end);
114 }
jar (doing other things) 2010/11/29 23:05:40 I think I'd like TonyG to review this, as care nee
tonyg 2010/12/04 01:34:39 I agree this is the right way to report client sid
113 115
114 // We properly handle null values for the next 3 variables. 116 // We properly handle null values for the next 3 variables.
115 Time request = navigation_state->request_time(); 117 Time request = navigation_state->request_time();
116 Time first_paint = navigation_state->first_paint_time(); 118 Time first_paint = navigation_state->first_paint_time();
117 Time first_paint_after_load = navigation_state->first_paint_after_load_time(); 119 Time first_paint_after_load = navigation_state->first_paint_after_load_time();
118 Time finish_doc = navigation_state->finish_document_load_time(); 120 Time finish_doc = navigation_state->finish_document_load_time();
119 Time finish_all_loads = navigation_state->finish_load_time(); 121 Time finish_all_loads = navigation_state->finish_load_time();
120 122
121 // TODO(tonyg, jar): We suspect a bug in abandonment counting, this temporary 123 // TODO(tonyg, jar): We suspect a bug in abandonment counting, this temporary
122 // historgram should help us to troubleshoot. 124 // historgram should help us to troubleshoot.
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 739
738 DCHECK(state); 740 DCHECK(state);
739 DCHECK(ds); 741 DCHECK(ds);
740 GURL url(ds->request().url()); 742 GURL url(ds->request().url());
741 Time start = state->start_load_time(); 743 Time start = state->start_load_time();
742 Time finish = state->finish_load_time(); 744 Time finish = state->finish_load_time();
743 // TODO(mbelshe): should we log more stats? 745 // TODO(mbelshe): should we log more stats?
744 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " 746 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms "
745 << url.spec(); 747 << url.spec();
746 } 748 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698