| 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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 reordering, 0, kMaxReordering, 50); | 330 reordering, 0, kMaxReordering, 50); |
| 331 if (stats.min_rtt_us > 100 * 1000) { | 331 if (stats.min_rtt_us > 100 * 1000) { |
| 332 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.MaxReorderingTimeLongRtt", | 332 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.MaxReorderingTimeLongRtt", |
| 333 reordering, 0, kMaxReordering, 50); | 333 reordering, 0, kMaxReordering, 50); |
| 334 } | 334 } |
| 335 UMA_HISTOGRAM_COUNTS( | 335 UMA_HISTOGRAM_COUNTS( |
| 336 "Net.QuicSession.MaxReordering", | 336 "Net.QuicSession.MaxReordering", |
| 337 static_cast<base::HistogramBase::Sample>(stats.max_sequence_reordering)); | 337 static_cast<base::HistogramBase::Sample>(stats.max_sequence_reordering)); |
| 338 } | 338 } |
| 339 | 339 |
| 340 void QuicClientSession::OnStreamFrames( | 340 void QuicClientSession::OnStreamFrame(const QuicStreamFrame& frame) { |
| 341 const std::vector<QuicStreamFrame>& frames) { | |
| 342 // Record total number of stream frames. | 341 // Record total number of stream frames. |
| 343 UMA_HISTOGRAM_COUNTS("Net.QuicNumStreamFramesInPacket", frames.size()); | 342 UMA_HISTOGRAM_COUNTS("Net.QuicNumStreamFramesInPacket", 1); |
| 344 | 343 |
| 345 // Record number of frames per stream in packet. | 344 // Record number of frames per stream in packet. |
| 346 typedef std::map<QuicStreamId, size_t> FrameCounter; | 345 UMA_HISTOGRAM_COUNTS("Net.QuicNumStreamFramesPerStreamInPacket", 1); |
| 347 FrameCounter frames_per_stream; | |
| 348 for (size_t i = 0; i < frames.size(); ++i) { | |
| 349 frames_per_stream[frames[i].stream_id]++; | |
| 350 } | |
| 351 for (FrameCounter::const_iterator it = frames_per_stream.begin(); | |
| 352 it != frames_per_stream.end(); ++it) { | |
| 353 UMA_HISTOGRAM_COUNTS("Net.QuicNumStreamFramesPerStreamInPacket", | |
| 354 it->second); | |
| 355 } | |
| 356 | 346 |
| 357 return QuicSpdySession::OnStreamFrames(frames); | 347 return QuicSpdySession::OnStreamFrame(frame); |
| 358 } | 348 } |
| 359 | 349 |
| 360 void QuicClientSession::AddObserver(Observer* observer) { | 350 void QuicClientSession::AddObserver(Observer* observer) { |
| 361 if (going_away_) { | 351 if (going_away_) { |
| 362 RecordUnexpectedObservers(ADD_OBSERVER); | 352 RecordUnexpectedObservers(ADD_OBSERVER); |
| 363 observer->OnSessionClosed(ERR_UNEXPECTED); | 353 observer->OnSessionClosed(ERR_UNEXPECTED); |
| 364 return; | 354 return; |
| 365 } | 355 } |
| 366 | 356 |
| 367 DCHECK(!ContainsKey(observers_, observer)); | 357 DCHECK(!ContainsKey(observers_, observer)); |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 return; | 935 return; |
| 946 | 936 |
| 947 // TODO(rch): re-enable this code once beta is cut. | 937 // TODO(rch): re-enable this code once beta is cut. |
| 948 // if (stream_factory_) | 938 // if (stream_factory_) |
| 949 // stream_factory_->OnSessionConnectTimeout(this); | 939 // stream_factory_->OnSessionConnectTimeout(this); |
| 950 // CloseAllStreams(ERR_QUIC_HANDSHAKE_FAILED); | 940 // CloseAllStreams(ERR_QUIC_HANDSHAKE_FAILED); |
| 951 // DCHECK_EQ(0u, GetNumOpenStreams()); | 941 // DCHECK_EQ(0u, GetNumOpenStreams()); |
| 952 } | 942 } |
| 953 | 943 |
| 954 } // namespace net | 944 } // namespace net |
| OLD | NEW |