diff options
author | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-11 00:31:43 +0000 |
---|---|---|
committer | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-11 00:31:43 +0000 |
commit | b7b7678705a07e54f3d630dc809cb00bc4f758be (patch) | |
tree | 10a5529a21870cf88a8de48fdd8ea7b147af7885 /net | |
parent | b7dbbec00aa43f94a078f2e5852601fb725d4b4b (diff) | |
download | chromium_src-b7b7678705a07e54f3d630dc809cb00bc4f758be.zip chromium_src-b7b7678705a07e54f3d630dc809cb00bc4f758be.tar.gz chromium_src-b7b7678705a07e54f3d630dc809cb00bc4f758be.tar.bz2 |
Add a histogram for measuring SSL Connect times.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/194035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25956 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/http/http_network_transaction.cc | 12 | ||||
-rw-r--r-- | net/http/http_network_transaction.h | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index 7f1495d..1c39524 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -710,6 +710,8 @@ int HttpNetworkTransaction::DoSSLConnect() { if (request_->load_flags & LOAD_VERIFY_EV_CERT) ssl_config_.verify_ev_cert = true; + ssl_connect_start_time_ = base::TimeTicks::Now(); + // Add a SSL socket on top of our existing transport socket. ClientSocket* s = connection_.release_socket(); s = socket_factory_->CreateSSLClientSocket( @@ -723,6 +725,16 @@ int HttpNetworkTransaction::DoSSLConnectComplete(int result) { result = HandleCertificateError(result); if (result == OK) { + DCHECK(ssl_connect_start_time_ != base::TimeTicks()); + base::TimeDelta connect_duration = + base::TimeTicks::Now() - ssl_connect_start_time_; + + UMA_HISTOGRAM_CLIPPED_TIMES("Net.SSL_Connection_Latency", + connect_duration, + base::TimeDelta::FromMilliseconds(1), + base::TimeDelta::FromMinutes(10), + 100); + next_state_ = STATE_WRITE_HEADERS; } else if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) { result = HandleCertificateRequest(result); diff --git a/net/http/http_network_transaction.h b/net/http/http_network_transaction.h index 3ffad74..7a0d635 100644 --- a/net/http/http_network_transaction.h +++ b/net/http/http_network_transaction.h @@ -408,8 +408,8 @@ class HttpNetworkTransaction : public HttpTransaction { // The time the Start method was called. base::Time start_time_; - // The time the Connect() method was called (if it got called). - base::Time connect_start_time_; + // The time the DoSSLConnect() method was called (if it got called). + base::TimeTicks ssl_connect_start_time_; // The next state in the state machine. State next_state_; |