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

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

Issue 15950009: Add histograms for tracking the number of client hellos send. This will let us understand how frequ… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | tools/metrics/histograms/histograms.xml » ('j') | 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.h" 8 #include "base/message_loop.h"
9 #include "base/metrics/histogram.h"
9 #include "base/stl_util.h" 10 #include "base/stl_util.h"
10 #include "base/string_number_conversions.h" 11 #include "base/string_number_conversions.h"
11 #include "base/values.h" 12 #include "base/values.h"
12 #include "net/base/io_buffer.h" 13 #include "net/base/io_buffer.h"
13 #include "net/base/net_errors.h" 14 #include "net/base/net_errors.h"
14 #include "net/quic/quic_connection_helper.h" 15 #include "net/quic/quic_connection_helper.h"
15 #include "net/quic/quic_crypto_client_stream_factory.h" 16 #include "net/quic/quic_crypto_client_stream_factory.h"
16 #include "net/quic/quic_stream_factory.h" 17 #include "net/quic/quic_stream_factory.h"
17 #include "net/udp/datagram_client_socket.h" 18 #include "net/udp/datagram_client_socket.h"
18 19
(...skipping 27 matching lines...) Expand all
46 // TODO(rch): pass in full host port proxy pair 47 // TODO(rch): pass in full host port proxy pair
47 net_log_.BeginEvent( 48 net_log_.BeginEvent(
48 NetLog::TYPE_QUIC_SESSION, 49 NetLog::TYPE_QUIC_SESSION,
49 NetLog::StringCallback("host", &server_hostname)); 50 NetLog::StringCallback("host", &server_hostname));
50 } 51 }
51 52
52 QuicClientSession::~QuicClientSession() { 53 QuicClientSession::~QuicClientSession() {
53 DCHECK(callback_.is_null()); 54 DCHECK(callback_.is_null());
54 connection()->set_debug_visitor(NULL); 55 connection()->set_debug_visitor(NULL);
55 net_log_.EndEvent(NetLog::TYPE_QUIC_SESSION); 56 net_log_.EndEvent(NetLog::TYPE_QUIC_SESSION);
57 UMA_HISTOGRAM_BOOLEAN("Net.QuicCryptoHandshakeConfirmed",
58 IsCryptoHandshakeConfirmed());
59 UMA_HISTOGRAM_BOOLEAN("Net.QuicEncryptionEstablished",
60 IsEncryptionEstablished());
61 UMA_HISTOGRAM_COUNTS("Net.QuicNumSentClientHellos",
jar (doing other things) 2013/05/30 21:08:33 maybe better: UMA_HISTOGRAM_ENUMERATION("...", sa
62 crypto_stream_->num_sent_client_hellos());
63 if (IsCryptoHandshakeConfirmed()) {
64 UMA_HISTOGRAM_COUNTS("Net.QuicCryptoHandshakeConfirmedNumSentClientHellos",
jar (doing other things) 2013/05/30 21:08:33 nit: To get better ordering of histograms... alpha
65 crypto_stream_->num_sent_client_hellos());
66 }
56 } 67 }
57 68
58 QuicReliableClientStream* QuicClientSession::CreateOutgoingReliableStream() { 69 QuicReliableClientStream* QuicClientSession::CreateOutgoingReliableStream() {
59 if (!crypto_stream_->encryption_established()) { 70 if (!crypto_stream_->encryption_established()) {
60 DLOG(INFO) << "Encryption not active so no outgoing stream created."; 71 DLOG(INFO) << "Encryption not active so no outgoing stream created.";
61 return NULL; 72 return NULL;
62 } 73 }
63 if (GetNumOpenStreams() >= get_max_open_streams()) { 74 if (GetNumOpenStreams() >= get_max_open_streams()) {
64 DLOG(INFO) << "Failed to create a new outgoing stream. " 75 DLOG(INFO) << "Failed to create a new outgoing stream. "
65 << "Already " << GetNumOpenStreams() << " open."; 76 << "Already " << GetNumOpenStreams() << " open.";
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 // use a weak pointer to be safe. 208 // use a weak pointer to be safe.
198 connection()->ProcessUdpPacket(local_address, peer_address, packet); 209 connection()->ProcessUdpPacket(local_address, peer_address, packet);
199 if (!connection()->connected()) { 210 if (!connection()->connected()) {
200 stream_factory_->OnSessionClose(this); 211 stream_factory_->OnSessionClose(this);
201 return; 212 return;
202 } 213 }
203 StartReading(); 214 StartReading();
204 } 215 }
205 216
206 } // namespace net 217 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698