diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-24 19:44:20 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-24 19:44:20 +0000 |
commit | bc3875bbcc3bde53e875e367eff047554b7b3c34 (patch) | |
tree | 9dfbd91fa06e4e1a41ee10a9af9365079fcf07b8 /net/http | |
parent | d69cfad7d31eed5f73afb14ea143c9bf9658874d (diff) | |
download | chromium_src-bc3875bbcc3bde53e875e367eff047554b7b3c34.zip chromium_src-bc3875bbcc3bde53e875e367eff047554b7b3c34.tar.gz chromium_src-bc3875bbcc3bde53e875e367eff047554b7b3c34.tar.bz2 |
Add more histograms to understand idle sockets.
Add Net.SocketIdleTimeBeforeNextUse histograms to track how long a socket is idle before being requested again.
Replace Net.SocketIdleTimeOnIOError with Net.SocketIdleTimeOnIOError2 which raises the sample max to 6 seconds and increases to 100 buckets. I had incorrectly misread the code and assumed we closed idle sockets after 10 seconds. We close idle sockets between 5 minutes and 5 minutes and 10 seconds of idle time.
Review URL: http://codereview.chromium.org/173256
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24130 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r-- | net/http/http_network_transaction.cc | 60 |
1 files changed, 50 insertions, 10 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index d37bab4..7098d6b 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -1137,6 +1137,40 @@ void HttpNetworkTransaction::LogTCPConnectedMetrics( base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), 100); } + + switch (handle.reuse_type()) { + case ClientSocketHandle::UNUSED: + break; + case ClientSocketHandle::UNUSED_IDLE: + UMA_HISTOGRAM_CUSTOM_TIMES( + "Net.SocketIdleTimeBeforeNextUse_UnusedSocket", + handle.idle_time(), base::TimeDelta::FromMilliseconds(1), + base::TimeDelta::FromMinutes(6), 100); + if (use_late_binding_histogram) { + UMA_HISTOGRAM_CUSTOM_TIMES( + FieldTrial::MakeName("Net.SocketIdleTimeBeforeNextUse_UnusedSocket", + "SocketLateBinding").data(), + handle.idle_time(), base::TimeDelta::FromMilliseconds(1), + base::TimeDelta::FromMinutes(6), 100); + } + break; + case ClientSocketHandle::REUSED_IDLE: + UMA_HISTOGRAM_CUSTOM_TIMES( + "Net.SocketIdleTimeBeforeNextUse_ReusedSocket", + handle.idle_time(), base::TimeDelta::FromMilliseconds(1), + base::TimeDelta::FromMinutes(6), 100); + if (use_late_binding_histogram) { + UMA_HISTOGRAM_CUSTOM_TIMES( + FieldTrial::MakeName("Net.SocketIdleTimeBeforeNextUse_ReusedSocket", + "SocketLateBinding").data(), + handle.idle_time(), base::TimeDelta::FromMilliseconds(1), + base::TimeDelta::FromMinutes(6), 100); + } + break; + default: + NOTREACHED(); + break; + } } void HttpNetworkTransaction::LogIOErrorMetrics( @@ -1163,23 +1197,29 @@ void HttpNetworkTransaction::LogIOErrorMetrics( case ClientSocketHandle::UNUSED: break; case ClientSocketHandle::UNUSED_IDLE: - UMA_HISTOGRAM_TIMES("Net.SocketIdleTimeOnIOError_UnusedSocket", - handle.idle_time()); + UMA_HISTOGRAM_CUSTOM_TIMES( + "Net.SocketIdleTimeOnIOError2_UnusedSocket", + handle.idle_time(), base::TimeDelta::FromMilliseconds(1), + base::TimeDelta::FromMinutes(6), 100); if (use_late_binding_histogram) { - UMA_HISTOGRAM_TIMES( - FieldTrial::MakeName("Net.SocketIdleTimeOnIOError_UnusedSocket", + UMA_HISTOGRAM_CUSTOM_TIMES( + FieldTrial::MakeName("Net.SocketIdleTimeOnIOError2_UnusedSocket", "SocketLateBinding").data(), - handle.idle_time()); + handle.idle_time(), base::TimeDelta::FromMilliseconds(1), + base::TimeDelta::FromMinutes(6), 100); } break; case ClientSocketHandle::REUSED_IDLE: - UMA_HISTOGRAM_TIMES("Net.SocketIdleTimeOnIOError_ReusedSocket", - handle.idle_time()); + UMA_HISTOGRAM_CUSTOM_TIMES( + "Net.SocketIdleTimeOnIOError2_ReusedSocket", + handle.idle_time(), base::TimeDelta::FromMilliseconds(1), + base::TimeDelta::FromMinutes(6), 100); if (use_late_binding_histogram) { - UMA_HISTOGRAM_TIMES( - FieldTrial::MakeName("Net.SocketIdleTimeOnIOError_ReusedSocket", + UMA_HISTOGRAM_CUSTOM_TIMES( + FieldTrial::MakeName("Net.SocketIdleTimeOnIOError2_ReusedSocket", "SocketLateBinding").data(), - handle.idle_time()); + handle.idle_time(), base::TimeDelta::FromMilliseconds(1), + base::TimeDelta::FromMinutes(6), 100); } break; default: |