OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "net/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 } | 957 } |
958 | 958 |
959 void HttpNetworkTransaction::LogTransactionConnectedMetrics() { | 959 void HttpNetworkTransaction::LogTransactionConnectedMetrics() { |
960 if (logged_response_time_) | 960 if (logged_response_time_) |
961 return; | 961 return; |
962 | 962 |
963 logged_response_time_ = true; | 963 logged_response_time_ = true; |
964 | 964 |
965 base::TimeDelta total_duration = response_.response_time - start_time_; | 965 base::TimeDelta total_duration = response_.response_time - start_time_; |
966 | 966 |
967 UMA_HISTOGRAM_CLIPPED_TIMES( | 967 UMA_HISTOGRAM_CUSTOM_TIMES( |
968 "Net.Transaction_Connected_Under_10", | 968 "Net.Transaction_Connected", |
969 total_duration, | 969 total_duration, |
970 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), | 970 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), |
971 100); | 971 100); |
972 | 972 |
973 bool reused_socket = stream_->IsConnectionReused(); | 973 bool reused_socket = stream_->IsConnectionReused(); |
974 if (!reused_socket) { | 974 if (!reused_socket) { |
975 UMA_HISTOGRAM_CLIPPED_TIMES( | 975 UMA_HISTOGRAM_CUSTOM_TIMES( |
976 "Net.Transaction_Connected_New", | 976 "Net.Transaction_Connected_New_b", |
977 total_duration, | 977 total_duration, |
978 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), | 978 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), |
979 100); | 979 100); |
980 | 980 |
981 static const bool use_conn_impact_histogram = | 981 static const bool use_conn_impact_histogram = |
982 base::FieldTrialList::TrialExists("ConnCountImpact"); | 982 base::FieldTrialList::TrialExists("ConnCountImpact"); |
983 if (use_conn_impact_histogram) { | 983 if (use_conn_impact_histogram) { |
984 UMA_HISTOGRAM_CLIPPED_TIMES( | 984 UMA_HISTOGRAM_CUSTOM_TIMES( |
985 base::FieldTrial::MakeName("Net.Transaction_Connected_New", | 985 base::FieldTrial::MakeName("Net.Transaction_Connected_New_b", |
986 "ConnCountImpact"), | 986 "ConnCountImpact"), |
987 total_duration, | 987 total_duration, |
988 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), | 988 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), |
989 100); | 989 100); |
990 } | 990 } |
991 } | 991 } |
992 | 992 |
993 static const bool use_spdy_histogram = | 993 static const bool use_spdy_histogram = |
994 base::FieldTrialList::TrialExists("SpdyImpact"); | 994 base::FieldTrialList::TrialExists("SpdyImpact"); |
995 if (use_spdy_histogram && response_.was_npn_negotiated) { | 995 if (use_spdy_histogram && response_.was_npn_negotiated) { |
996 UMA_HISTOGRAM_CLIPPED_TIMES( | 996 UMA_HISTOGRAM_CUSTOM_TIMES( |
997 base::FieldTrial::MakeName("Net.Transaction_Connected_Under_10", | 997 base::FieldTrial::MakeName("Net.Transaction_Connected", |
998 "SpdyImpact"), | 998 "SpdyImpact"), |
999 total_duration, base::TimeDelta::FromMilliseconds(1), | 999 total_duration, base::TimeDelta::FromMilliseconds(1), |
1000 base::TimeDelta::FromMinutes(10), 100); | 1000 base::TimeDelta::FromMinutes(10), 100); |
1001 | 1001 |
1002 if (!reused_socket) { | 1002 if (!reused_socket) { |
1003 UMA_HISTOGRAM_CLIPPED_TIMES( | 1003 UMA_HISTOGRAM_CUSTOM_TIMES( |
1004 base::FieldTrial::MakeName("Net.Transaction_Connected_New", | 1004 base::FieldTrial::MakeName("Net.Transaction_Connected_New_b", |
1005 "SpdyImpact"), | 1005 "SpdyImpact"), |
1006 total_duration, base::TimeDelta::FromMilliseconds(1), | 1006 total_duration, base::TimeDelta::FromMilliseconds(1), |
1007 base::TimeDelta::FromMinutes(10), 100); | 1007 base::TimeDelta::FromMinutes(10), 100); |
1008 } | 1008 } |
1009 } | 1009 } |
1010 | 1010 |
1011 // Currently, non-zero priority requests are frame or sub-frame resource | 1011 // Currently, non-zero priority requests are frame or sub-frame resource |
1012 // types. This will change when we also prioritize certain subresources like | 1012 // types. This will change when we also prioritize certain subresources like |
1013 // css, js, etc. | 1013 // css, js, etc. |
1014 if (request_->priority) { | 1014 if (request_->priority) { |
1015 UMA_HISTOGRAM_CLIPPED_TIMES( | 1015 UMA_HISTOGRAM_CUSTOM_TIMES( |
1016 "Net.Priority_High_Latency", | 1016 "Net.Priority_High_Latency_b", |
1017 total_duration, | 1017 total_duration, |
1018 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), | 1018 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), |
1019 100); | 1019 100); |
1020 } else { | 1020 } else { |
1021 UMA_HISTOGRAM_CLIPPED_TIMES( | 1021 UMA_HISTOGRAM_CUSTOM_TIMES( |
1022 "Net.Priority_Low_Latency", | 1022 "Net.Priority_Low_Latency_b", |
1023 total_duration, | 1023 total_duration, |
1024 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), | 1024 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), |
1025 100); | 1025 100); |
1026 } | 1026 } |
1027 } | 1027 } |
1028 | 1028 |
1029 void HttpNetworkTransaction::LogTransactionMetrics() const { | 1029 void HttpNetworkTransaction::LogTransactionMetrics() const { |
1030 base::TimeDelta duration = base::Time::Now() - | 1030 base::TimeDelta duration = base::Time::Now() - |
1031 response_.request_time; | 1031 response_.request_time; |
1032 if (60 < duration.InMinutes()) | 1032 if (60 < duration.InMinutes()) |
1033 return; | 1033 return; |
1034 | 1034 |
1035 base::TimeDelta total_duration = base::Time::Now() - start_time_; | 1035 base::TimeDelta total_duration = base::Time::Now() - start_time_; |
1036 | 1036 |
1037 UMA_HISTOGRAM_LONG_TIMES("Net.Transaction_Latency", duration); | 1037 UMA_HISTOGRAM_CUSTOM_TIMES("Net.Transaction_Latency_b", duration, |
1038 UMA_HISTOGRAM_CLIPPED_TIMES("Net.Transaction_Latency_Under_10", duration, | 1038 base::TimeDelta::FromMilliseconds(1), |
1039 base::TimeDelta::FromMilliseconds(1), | 1039 base::TimeDelta::FromMinutes(10), |
1040 base::TimeDelta::FromMinutes(10), | 1040 100); |
1041 100); | 1041 UMA_HISTOGRAM_CUSTOM_TIMES("Net.Transaction_Latency_Total", |
1042 UMA_HISTOGRAM_CLIPPED_TIMES("Net.Transaction_Latency_Total_Under_10", | 1042 total_duration, |
1043 total_duration, | 1043 base::TimeDelta::FromMilliseconds(1), |
1044 base::TimeDelta::FromMilliseconds(1), | 1044 base::TimeDelta::FromMinutes(10), 100); |
1045 base::TimeDelta::FromMinutes(10), 100); | |
1046 if (!stream_->IsConnectionReused()) { | 1045 if (!stream_->IsConnectionReused()) { |
1047 UMA_HISTOGRAM_CLIPPED_TIMES( | 1046 UMA_HISTOGRAM_CUSTOM_TIMES( |
1048 "Net.Transaction_Latency_Total_New_Connection_Under_10", | 1047 "Net.Transaction_Latency_Total_New_Connection", |
1049 total_duration, base::TimeDelta::FromMilliseconds(1), | 1048 total_duration, base::TimeDelta::FromMilliseconds(1), |
1050 base::TimeDelta::FromMinutes(10), 100); | 1049 base::TimeDelta::FromMinutes(10), 100); |
1051 } | 1050 } |
1052 } | 1051 } |
1053 | 1052 |
1054 int HttpNetworkTransaction::HandleCertificateRequest(int error) { | 1053 int HttpNetworkTransaction::HandleCertificateRequest(int error) { |
1055 // There are two paths through which the server can request a certificate | 1054 // There are two paths through which the server can request a certificate |
1056 // from us. The first is during the initial handshake, the second is | 1055 // from us. The first is during the initial handshake, the second is |
1057 // during SSL renegotiation. | 1056 // during SSL renegotiation. |
1058 // | 1057 // |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 1308 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
1310 state); | 1309 state); |
1311 break; | 1310 break; |
1312 } | 1311 } |
1313 return description; | 1312 return description; |
1314 } | 1313 } |
1315 | 1314 |
1316 #undef STATE_CASE | 1315 #undef STATE_CASE |
1317 | 1316 |
1318 } // namespace net | 1317 } // namespace net |
OLD | NEW |