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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 abandoned_page ? 1 : 0, 2); | 721 abandoned_page ? 1 : 0, 2); |
722 } else { | 722 } else { |
723 DCHECK(scheme_type == URLPattern::SCHEME_HTTP); | 723 DCHECK(scheme_type == URLPattern::SCHEME_HTTP); |
724 PLT_HISTOGRAM("PLT.StartToFinish.NoProxy.http", | 724 PLT_HISTOGRAM("PLT.StartToFinish.NoProxy.http", |
725 start_to_finish_all_loads); | 725 start_to_finish_all_loads); |
726 UMA_HISTOGRAM_ENUMERATION("PLT.Abandoned.NoProxy.http", | 726 UMA_HISTOGRAM_ENUMERATION("PLT.Abandoned.NoProxy.http", |
727 abandoned_page ? 1 : 0, 2); | 727 abandoned_page ? 1 : 0, 2); |
728 } | 728 } |
729 } | 729 } |
730 | 730 |
731 // Histograms to determine if disabling overlapped TCP reads | |
732 // has an impact on PLT. | |
733 static const bool use_overlapped_read_histogram = | |
734 base::FieldTrialList::TrialExists("OverlappedReadImpact"); | |
735 if (use_overlapped_read_histogram) { | |
736 UMA_HISTOGRAM_ENUMERATION( | |
737 base::FieldTrial::MakeName("PLT.Abandoned", "OverlappedReadImpact"), | |
738 abandoned_page ? 1 : 0, 2); | |
739 UMA_HISTOGRAM_ENUMERATION( | |
740 base::FieldTrial::MakeName("PLT.LoadType", "OverlappedReadImpact"), | |
741 load_type, DocumentState::kLoadTypeMax); | |
742 switch (load_type) { | |
743 case DocumentState::NORMAL_LOAD: | |
744 PLT_HISTOGRAM(base::FieldTrial::MakeName( | |
745 "PLT.BeginToFinish_NormalLoad", "OverlappedReadImpact"), | |
746 begin_to_finish_all_loads); | |
747 break; | |
748 case DocumentState::LINK_LOAD_NORMAL: | |
749 PLT_HISTOGRAM(base::FieldTrial::MakeName( | |
750 "PLT.BeginToFinish_LinkLoadNormal", "OverlappedReadImpact"), | |
751 begin_to_finish_all_loads); | |
752 break; | |
753 case DocumentState::LINK_LOAD_RELOAD: | |
754 PLT_HISTOGRAM(base::FieldTrial::MakeName( | |
755 "PLT.BeginToFinish_LinkLoadReload", "OverlappedReadImpact"), | |
756 begin_to_finish_all_loads); | |
757 break; | |
758 case DocumentState::LINK_LOAD_CACHE_STALE_OK: | |
759 PLT_HISTOGRAM(base::FieldTrial::MakeName( | |
760 "PLT.BeginToFinish_LinkLoadStaleOk", "OverlappedReadImpact"), | |
761 begin_to_finish_all_loads); | |
762 break; | |
763 default: | |
764 break; | |
765 } | |
766 } | |
767 | |
768 // Site isolation metrics. | 731 // Site isolation metrics. |
769 UMA_HISTOGRAM_COUNTS("SiteIsolation.PageLoadsWithCrossSiteFrameAccess", | 732 UMA_HISTOGRAM_COUNTS("SiteIsolation.PageLoadsWithCrossSiteFrameAccess", |
770 cross_origin_access_count_); | 733 cross_origin_access_count_); |
771 UMA_HISTOGRAM_COUNTS("SiteIsolation.PageLoadsWithSameSiteFrameAccess", | 734 UMA_HISTOGRAM_COUNTS("SiteIsolation.PageLoadsWithSameSiteFrameAccess", |
772 same_origin_access_count_); | 735 same_origin_access_count_); |
773 | 736 |
774 // Log the PLT to the info log. | 737 // Log the PLT to the info log. |
775 LogPageLoadTime(document_state, frame->dataSource()); | 738 LogPageLoadTime(document_state, frame->dataSource()); |
776 | 739 |
777 // Since there are currently no guarantees that renderer histograms will be | 740 // Since there are currently no guarantees that renderer histograms will be |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 | 775 |
813 DCHECK(document_state); | 776 DCHECK(document_state); |
814 DCHECK(ds); | 777 DCHECK(ds); |
815 GURL url(ds->request().url()); | 778 GURL url(ds->request().url()); |
816 Time start = document_state->start_load_time(); | 779 Time start = document_state->start_load_time(); |
817 Time finish = document_state->finish_load_time(); | 780 Time finish = document_state->finish_load_time(); |
818 // TODO(mbelshe): should we log more stats? | 781 // TODO(mbelshe): should we log more stats? |
819 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " | 782 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " |
820 << url.spec(); | 783 << url.spec(); |
821 } | 784 } |
OLD | NEW |