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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 abandoned_page ? 1 : 0, 2); | 921 abandoned_page ? 1 : 0, 2); |
922 } else { | 922 } else { |
923 DCHECK(scheme_type == URLPattern::SCHEME_HTTP); | 923 DCHECK(scheme_type == URLPattern::SCHEME_HTTP); |
924 PLT_HISTOGRAM("PLT.StartToFinish.NoProxy.http", | 924 PLT_HISTOGRAM("PLT.StartToFinish.NoProxy.http", |
925 start_to_finish_all_loads); | 925 start_to_finish_all_loads); |
926 UMA_HISTOGRAM_ENUMERATION("PLT.Abandoned.NoProxy.http", | 926 UMA_HISTOGRAM_ENUMERATION("PLT.Abandoned.NoProxy.http", |
927 abandoned_page ? 1 : 0, 2); | 927 abandoned_page ? 1 : 0, 2); |
928 } | 928 } |
929 } | 929 } |
930 | 930 |
| 931 // Histograms to determine if disabling overlapped TCP reads |
| 932 // has an impact on PLT. |
| 933 static const bool use_overlapped_read_histogram = |
| 934 base::FieldTrialList::TrialExists("OverlappedReadImpact"); |
| 935 if (use_overlapped_read_histogram) { |
| 936 UMA_HISTOGRAM_ENUMERATION( |
| 937 base::FieldTrial::MakeName("PLT.Abandoned", "OverlappedReadImpact"), |
| 938 abandoned_page ? 1 : 0, 2); |
| 939 UMA_HISTOGRAM_ENUMERATION( |
| 940 base::FieldTrial::MakeName("PLT.LoadType", "OverlappedReadImpact"), |
| 941 load_type, DocumentState::kLoadTypeMax); |
| 942 switch (load_type) { |
| 943 case DocumentState::NORMAL_LOAD: |
| 944 PLT_HISTOGRAM(base::FieldTrial::MakeName( |
| 945 "PLT.BeginToFinish_NormalLoad", "OverlappedReadImpact"), |
| 946 begin_to_finish_all_loads); |
| 947 break; |
| 948 case DocumentState::LINK_LOAD_NORMAL: |
| 949 PLT_HISTOGRAM(base::FieldTrial::MakeName( |
| 950 "PLT.BeginToFinish_LinkLoadNormal", "OverlappedReadImpact"), |
| 951 begin_to_finish_all_loads); |
| 952 break; |
| 953 case DocumentState::LINK_LOAD_RELOAD: |
| 954 PLT_HISTOGRAM(base::FieldTrial::MakeName( |
| 955 "PLT.BeginToFinish_LinkLoadReload", "OverlappedReadImpact"), |
| 956 begin_to_finish_all_loads); |
| 957 break; |
| 958 case DocumentState::LINK_LOAD_CACHE_STALE_OK: |
| 959 PLT_HISTOGRAM(base::FieldTrial::MakeName( |
| 960 "PLT.BeginToFinish_LinkLoadStaleOk", "OverlappedReadImpact"), |
| 961 begin_to_finish_all_loads); |
| 962 break; |
| 963 default: |
| 964 break; |
| 965 } |
| 966 } |
| 967 |
931 // Site isolation metrics. | 968 // Site isolation metrics. |
932 UMA_HISTOGRAM_COUNTS("SiteIsolation.PageLoadsWithCrossSiteFrameAccess", | 969 UMA_HISTOGRAM_COUNTS("SiteIsolation.PageLoadsWithCrossSiteFrameAccess", |
933 cross_origin_access_count_); | 970 cross_origin_access_count_); |
934 UMA_HISTOGRAM_COUNTS("SiteIsolation.PageLoadsWithSameSiteFrameAccess", | 971 UMA_HISTOGRAM_COUNTS("SiteIsolation.PageLoadsWithSameSiteFrameAccess", |
935 same_origin_access_count_); | 972 same_origin_access_count_); |
936 | 973 |
937 // Log the PLT to the info log. | 974 // Log the PLT to the info log. |
938 LogPageLoadTime(document_state, frame->dataSource()); | 975 LogPageLoadTime(document_state, frame->dataSource()); |
939 | 976 |
940 // Record prerendering histograms. | 977 // Record prerendering histograms. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 | 1029 |
993 DCHECK(document_state); | 1030 DCHECK(document_state); |
994 DCHECK(ds); | 1031 DCHECK(ds); |
995 GURL url(ds->request().url()); | 1032 GURL url(ds->request().url()); |
996 Time start = document_state->start_load_time(); | 1033 Time start = document_state->start_load_time(); |
997 Time finish = document_state->finish_load_time(); | 1034 Time finish = document_state->finish_load_time(); |
998 // TODO(mbelshe): should we log more stats? | 1035 // TODO(mbelshe): should we log more stats? |
999 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " | 1036 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " |
1000 << url.spec(); | 1037 << url.spec(); |
1001 } | 1038 } |
OLD | NEW |