Chromium Code Reviews| Index: net/socket/client_socket_pool_base.cc |
| diff --git a/net/socket/client_socket_pool_base.cc b/net/socket/client_socket_pool_base.cc |
| index 8853c1e80305d6fad694f12dbc0b47cb39b7f7de..476f19ad3bfda35eec42a7b0fe675aadc9af3690 100644 |
| --- a/net/socket/client_socket_pool_base.cc |
| +++ b/net/socket/client_socket_pool_base.cc |
| @@ -11,6 +11,7 @@ |
| #include "base/format_macros.h" |
| #include "base/location.h" |
| #include "base/logging.h" |
| +#include "base/metrics/histogram_macros.h" |
| #include "base/single_thread_task_runner.h" |
| #include "base/stl_util.h" |
| #include "base/strings/string_util.h" |
| @@ -975,16 +976,22 @@ void ClientSocketPoolBaseHelper::HandOutSocket( |
| handle->set_pool_id(pool_generation_number_); |
| handle->set_connect_timing(connect_timing); |
| - if (handle->is_reused()) { |
| + if (reuse_type == ClientSocketHandle::REUSED_IDLE) { |
|
mmenke
2016/06/21 21:08:32
This is the same as before, just switched to be co
|
| net_log.AddEvent( |
| NetLog::TYPE_SOCKET_POOL_REUSED_AN_EXISTING_SOCKET, |
| NetLog::IntCallback("idle_ms", |
| static_cast<int>(idle_time.InMilliseconds()))); |
| + |
| + UMA_HISTOGRAM_COUNTS_1000("Net.Socket.IdleSocketReuseTime", |
|
Charlie Harrison
2016/06/21 21:23:20
Any reason not to do this in milliseconds? Seems l
mmenke
2016/06/21 21:34:45
Mostly to make it more readable. "28" is more rea
Charlie Harrison
2016/06/21 21:40:20
Gotcha, thanks for the clarification. Keeping in s
|
| + idle_time.InSeconds()); |
| } |
| - net_log.AddEvent( |
|
Charlie Harrison
2016/06/21 21:23:20
Why remove this?
mmenke
2016/06/21 21:34:45
Thanks for catching that! Mistake due to repeated
|
| - NetLog::TYPE_SOCKET_POOL_BOUND_TO_SOCKET, |
| - handle->socket()->NetLog().source().ToEventParametersCallback()); |
| + if (reuse_type != ClientSocketHandle::UNUSED) { |
| + // The socket being handed out is no longer considered idle, but was |
| + // considered idle until just before this method was called. |
| + UMA_HISTOGRAM_COUNTS_100("Net.Socket.NumIdleSockets", |
|
Charlie Harrison
2016/06/21 21:23:20
suggestion: Consider bumping this from 100 to some
mmenke
2016/06/21 21:34:45
If we really have 100 idle sockets around, I don't
Charlie Harrison
2016/06/21 21:40:20
Yeah my comment was mostly due to your observation
mmenke
2016/06/21 21:44:46
I suspect we'll see it, but I suspect if we have t
Charlie Harrison
2016/06/21 21:52:07
Good point, though we would like to see what the e
|
| + idle_socket_count() + 1); |
| + } |
| handed_out_socket_count_++; |
| group->IncrementActiveSocketCount(); |