diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-28 19:42:38 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-28 19:42:38 +0000 |
commit | 053b17df7a9d05dbf338573f40c35d8123fa00ac (patch) | |
tree | 39a3021e975c02e033df1d83a6b3d924e7227e93 /net/http | |
parent | ef49de68beef6d5adf699518f8ef86f47b9f8b33 (diff) | |
download | chromium_src-053b17df7a9d05dbf338573f40c35d8123fa00ac.zip chromium_src-053b17df7a9d05dbf338573f40c35d8123fa00ac.tar.gz chromium_src-053b17df7a9d05dbf338573f40c35d8123fa00ac.tar.bz2 |
Add a histogram to record the dns resolution + tcp connection times.
Review URL: http://codereview.chromium.org/100112
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14765 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r-- | net/http/http_network_transaction.cc | 16 | ||||
-rw-r--r-- | net/http/http_network_transaction.h | 7 |
2 files changed, 19 insertions, 4 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index 3e878ca..af8fea8 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -581,6 +581,8 @@ int HttpNetworkTransaction::DoResolveHost() { port = request_->url.EffectiveIntPort(); } + host_resolution_start_time_ = base::Time::Now(); + DidStartDnsResolution(host, this); return resolver_.Resolve(host, port, &addresses_, &io_callback_); } @@ -612,7 +614,7 @@ int HttpNetworkTransaction::DoTCPConnectComplete(int result) { // If we are using a direct SSL connection, then go ahead and establish the // SSL connection, now. Otherwise, we need to first issue a CONNECT request. if (result == OK) { - LogTCPConnectionMetrics(); + LogTCPConnectedMetrics(); if (using_ssl_ && !using_tunnel_) { next_state_ = STATE_SSL_CONNECT; } else { @@ -969,7 +971,7 @@ int HttpNetworkTransaction::DoDrainBodyForAuthRestartComplete(int result) { return OK; } -void HttpNetworkTransaction::LogTCPConnectionMetrics() const { +void HttpNetworkTransaction::LogTCPConnectedMetrics() const { DCHECK(connect_start_time_ != base::Time()); base::TimeDelta connect_duration = base::Time::Now() - connect_start_time_; @@ -978,6 +980,16 @@ void HttpNetworkTransaction::LogTCPConnectionMetrics() const { "Net.TCP_Connection_Latency", "DnsImpact").data(), connect_duration, base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), 100); + + base::TimeDelta host_resolution_and_tcp_connection_latency = + base::Time::Now() - host_resolution_start_time_; + + UMA_HISTOGRAM_CLIPPED_TIMES( + FieldTrial::MakeName( + "Net.Dns_Resolution_And_TCP_Connection_Latency", "DnsImpact").data(), + host_resolution_and_tcp_connection_latency, + base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), + 100); } void HttpNetworkTransaction::LogTransactionConnectedMetrics() const { diff --git a/net/http/http_network_transaction.h b/net/http/http_network_transaction.h index ed63db0..0ec80af 100644 --- a/net/http/http_network_transaction.h +++ b/net/http/http_network_transaction.h @@ -88,8 +88,8 @@ class HttpNetworkTransaction : public HttpTransaction { int DoDrainBodyForAuthRestart(); int DoDrainBodyForAuthRestartComplete(int result); - // Record histogram of time to acquire a TCP connection. - void LogTCPConnectionMetrics() const; + // Record histograms of latency until Connect() completes. + void LogTCPConnectedMetrics() const; // Record histogram of time until first byte of header is received. void LogTransactionConnectedMetrics() const; @@ -323,6 +323,9 @@ class HttpNetworkTransaction : public HttpTransaction { // The time the Connect() method was called (if it got called). base::Time connect_start_time_; + // The time the host resolution started (if it indeed got started). + base::Time host_resolution_start_time_; + enum State { STATE_RESOLVE_PROXY, STATE_RESOLVE_PROXY_COMPLETE, |