| 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 "net/quic/quic_client_session.h" | 5 #include "net/quic/quic_client_session.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "base/metrics/sparse_histogram.h" | 10 #include "base/metrics/sparse_histogram.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 wait_for_data_end_time - wait_for_data_start_time; | 299 wait_for_data_end_time - wait_for_data_start_time; |
| 300 const base::HistogramBase::Sample kMaxWaitToRtt = 1000; | 300 const base::HistogramBase::Sample kMaxWaitToRtt = 1000; |
| 301 base::HistogramBase::Sample wait_to_rtt = | 301 base::HistogramBase::Sample wait_to_rtt = |
| 302 static_cast<base::HistogramBase::Sample>( | 302 static_cast<base::HistogramBase::Sample>( |
| 303 100 * wait_time.InMicroseconds() / stats.min_rtt_us); | 303 100 * wait_time.InMicroseconds() / stats.min_rtt_us); |
| 304 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicServerInfo.WaitForDataReadyToRtt", | 304 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicServerInfo.WaitForDataReadyToRtt", |
| 305 wait_to_rtt, 0, kMaxWaitToRtt, 50); | 305 wait_to_rtt, 0, kMaxWaitToRtt, 50); |
| 306 } | 306 } |
| 307 } | 307 } |
| 308 | 308 |
| 309 // The MTU used by QUIC is limited to a fairly small set of predefined values |
| 310 // (initial values and MTU discovery values), but does not fare well when |
| 311 // bucketed. Because of that, a sparse histogram is used here. |
| 312 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicSession.ClientSideMtu", |
| 313 connection()->max_packet_length()); |
| 314 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicSession.ServerSideMtu", |
| 315 stats.max_received_packet_size); |
| 316 |
| 317 UMA_HISTOGRAM_COUNTS("Net.QuicSession.MtuProbesSent", |
| 318 connection()->mtu_probe_count()); |
| 319 |
| 309 if (stats.max_sequence_reordering == 0) | 320 if (stats.max_sequence_reordering == 0) |
| 310 return; | 321 return; |
| 311 const base::HistogramBase::Sample kMaxReordering = 100; | 322 const base::HistogramBase::Sample kMaxReordering = 100; |
| 312 base::HistogramBase::Sample reordering = kMaxReordering; | 323 base::HistogramBase::Sample reordering = kMaxReordering; |
| 313 if (stats.min_rtt_us > 0) { | 324 if (stats.min_rtt_us > 0) { |
| 314 reordering = static_cast<base::HistogramBase::Sample>( | 325 reordering = static_cast<base::HistogramBase::Sample>( |
| 315 100 * stats.max_time_reordering_us / stats.min_rtt_us); | 326 100 * stats.max_time_reordering_us / stats.min_rtt_us); |
| 316 } | 327 } |
| 317 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.MaxReorderingTime", | 328 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.MaxReorderingTime", |
| 318 reordering, 0, kMaxReordering, 50); | 329 reordering, 0, kMaxReordering, 50); |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 return; | 941 return; |
| 931 | 942 |
| 932 // TODO(rch): re-enable this code once beta is cut. | 943 // TODO(rch): re-enable this code once beta is cut. |
| 933 // if (stream_factory_) | 944 // if (stream_factory_) |
| 934 // stream_factory_->OnSessionConnectTimeout(this); | 945 // stream_factory_->OnSessionConnectTimeout(this); |
| 935 // CloseAllStreams(ERR_QUIC_HANDSHAKE_FAILED); | 946 // CloseAllStreams(ERR_QUIC_HANDSHAKE_FAILED); |
| 936 // DCHECK_EQ(0u, GetNumOpenStreams()); | 947 // DCHECK_EQ(0u, GetNumOpenStreams()); |
| 937 } | 948 } |
| 938 | 949 |
| 939 } // namespace net | 950 } // namespace net |
| OLD | NEW |