Chromium Code Reviews| 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 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1068 | 1068 |
| 1069 UMA_HISTOGRAM_LONG_TIMES("Net.Transaction_Latency", duration); | 1069 UMA_HISTOGRAM_LONG_TIMES("Net.Transaction_Latency", duration); |
| 1070 UMA_HISTOGRAM_CLIPPED_TIMES("Net.Transaction_Latency_Under_10", duration, | 1070 UMA_HISTOGRAM_CLIPPED_TIMES("Net.Transaction_Latency_Under_10", duration, |
| 1071 base::TimeDelta::FromMilliseconds(1), | 1071 base::TimeDelta::FromMilliseconds(1), |
| 1072 base::TimeDelta::FromMinutes(10), | 1072 base::TimeDelta::FromMinutes(10), |
| 1073 100); | 1073 100); |
| 1074 UMA_HISTOGRAM_CLIPPED_TIMES("Net.Transaction_Latency_Total_Under_10", | 1074 UMA_HISTOGRAM_CLIPPED_TIMES("Net.Transaction_Latency_Total_Under_10", |
| 1075 total_duration, | 1075 total_duration, |
| 1076 base::TimeDelta::FromMilliseconds(1), | 1076 base::TimeDelta::FromMilliseconds(1), |
| 1077 base::TimeDelta::FromMinutes(10), 100); | 1077 base::TimeDelta::FromMinutes(10), 100); |
| 1078 | |
| 1079 int num_kb = stream_->GetBytesReceived() / 1024; | |
|
willchan no longer on Chromium
2011/06/06 10:57:36
I think the way you have this structured isn't wha
Gagan
2011/06/06 20:27:10
Good point.
Done.
| |
| 1080 if (num_kb < 1024 && stream_->GetRTTMs() > 0) { // Ignore responses > 1MB | |
| 1081 double num_rtt = static_cast<double>(duration.InMilliseconds()) / | |
| 1082 stream_->GetRTTMs(); | |
| 1083 int num_rtt_scaled = (4 * num_rtt); | |
| 1084 int val = 1024 * num_rtt_scaled + num_kb; // Supports ~500 RTT of 1418 B. | |
| 1085 HISTOGRAM_CUSTOM_COUNTS("Net.RTT_vs_KB", val, 4096, 3048000, 1000); | |
| 1086 LOG(ERROR) << "rtt = " << stream_->GetRTTMs() << "\tnum_rtt = " << num_rtt | |
| 1087 << "\tnum_kb = " << num_kb << "\tval = " << val; | |
| 1088 } | |
| 1089 | |
| 1078 if (!stream_->IsConnectionReused()) { | 1090 if (!stream_->IsConnectionReused()) { |
| 1079 UMA_HISTOGRAM_CLIPPED_TIMES( | 1091 UMA_HISTOGRAM_CLIPPED_TIMES( |
| 1080 "Net.Transaction_Latency_Total_New_Connection_Under_10", | 1092 "Net.Transaction_Latency_Total_New_Connection_Under_10", |
| 1081 total_duration, base::TimeDelta::FromMilliseconds(1), | 1093 total_duration, base::TimeDelta::FromMilliseconds(1), |
| 1082 base::TimeDelta::FromMinutes(10), 100); | 1094 base::TimeDelta::FromMinutes(10), 100); |
| 1083 } | 1095 } |
| 1084 } | 1096 } |
| 1085 | 1097 |
| 1086 int HttpNetworkTransaction::HandleCertificateRequest(int error) { | 1098 int HttpNetworkTransaction::HandleCertificateRequest(int error) { |
| 1087 // There are two paths through which the server can request a certificate | 1099 // There are two paths through which the server can request a certificate |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1341 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 1353 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
| 1342 state); | 1354 state); |
| 1343 break; | 1355 break; |
| 1344 } | 1356 } |
| 1345 return description; | 1357 return description; |
| 1346 } | 1358 } |
| 1347 | 1359 |
| 1348 #undef STATE_CASE | 1360 #undef STATE_CASE |
| 1349 | 1361 |
| 1350 } // namespace net | 1362 } // namespace net |
| OLD | NEW |