Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: net/quic/quic_client_session.cc

Issue 299423002: Test divisor for zero before generating statistic (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/metrics/sparse_histogram.h" 10 #include "base/metrics/sparse_histogram.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 } else { 237 } else {
238 if (port_selected) { 238 if (port_selected) {
239 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.ConnectSelectPortForHTTPS", 239 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.ConnectSelectPortForHTTPS",
240 round_trip_handshakes, 0, 3, 4); 240 round_trip_handshakes, 0, 3, 4);
241 } else { 241 } else {
242 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.ConnectRandomPortForHTTPS", 242 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.ConnectRandomPortForHTTPS",
243 round_trip_handshakes, 0, 3, 4); 243 round_trip_handshakes, 0, 3, 4);
244 } 244 }
245 } 245 }
246 const QuicConnectionStats stats = connection()->GetStats(); 246 const QuicConnectionStats stats = connection()->GetStats();
247 uint64 reordering = 247 uint64 reordering = (stats.min_rtt_us == 0) ? GG_UINT64_C(100)
Ryan Hamilton 2014/05/24 21:34:21 nit: no need for GG_UINT64_C() around the 100 here
248 GG_UINT64_C(100) * stats.max_time_reordering_us / stats.min_rtt_us; 248 : GG_UINT64_C(100) * stats.max_time_reordering_us / stats.min_rtt_us;
249 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.MaxReorderingTime", 249 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.MaxReorderingTime",
250 reordering, 0, 100, 50); 250 reordering, 0, 100, 50);
251 if (stats.min_rtt_us > 100) { 251 if (stats.min_rtt_us > 100) {
252 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.MaxReorderingTimeLongRtt", 252 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.MaxReorderingTimeLongRtt",
253 reordering, 0, 100, 50); 253 reordering, 0, 100, 50);
254 } 254 }
255 UMA_HISTOGRAM_COUNTS("Net.QuicSession.MaxReordering", 255 UMA_HISTOGRAM_COUNTS("Net.QuicSession.MaxReordering",
256 stats.max_sequence_reordering); 256 stats.max_sequence_reordering);
257 } 257 }
258 258
259 void QuicClientSession::OnStreamFrames( 259 void QuicClientSession::OnStreamFrames(
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 RecordUnexpectedNotGoingAway(NOTIFY_FACTORY_OF_SESSION_CLOSED); 788 RecordUnexpectedNotGoingAway(NOTIFY_FACTORY_OF_SESSION_CLOSED);
789 789
790 going_away_ = true; 790 going_away_ = true;
791 DCHECK_EQ(0u, GetNumOpenStreams()); 791 DCHECK_EQ(0u, GetNumOpenStreams());
792 // Will delete |this|. 792 // Will delete |this|.
793 if (stream_factory_) 793 if (stream_factory_)
794 stream_factory_->OnSessionClosed(this); 794 stream_factory_->OnSessionClosed(this);
795 } 795 }
796 796
797 } // namespace net 797 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698