| Index: net/socket/tcp_client_socket_libevent.cc
|
| ===================================================================
|
| --- net/socket/tcp_client_socket_libevent.cc (revision 52678)
|
| +++ net/socket/tcp_client_socket_libevent.cc (working copy)
|
| @@ -16,6 +16,7 @@
|
| #include "base/eintr_wrapper.h"
|
| #include "base/logging.h"
|
| #include "base/message_loop.h"
|
| +#include "base/stats_counters.h"
|
| #include "base/string_util.h"
|
| #include "net/base/address_list_net_log_param.h"
|
| #include "net/base/io_buffer.h"
|
| @@ -125,6 +126,9 @@
|
| if (socket_ != kInvalidSocket)
|
| return OK;
|
|
|
| + static StatsCounter connects("tcp.connect");
|
| + connects.Increment();
|
| +
|
| DCHECK(!waiting_connect());
|
|
|
| net_log_.BeginEvent(NetLog::TYPE_TCP_CONNECT,
|
| @@ -309,6 +313,9 @@
|
|
|
| int nread = HANDLE_EINTR(read(socket_, buf->data(), buf_len));
|
| if (nread >= 0) {
|
| + static StatsCounter read_bytes("tcp.read_bytes");
|
| + read_bytes.Add(nread);
|
| +
|
| net_log_.AddEvent(NetLog::TYPE_SOCKET_BYTES_RECEIVED,
|
| new NetLogIntegerParameter("num_bytes", nread));
|
| return nread;
|
| @@ -344,6 +351,8 @@
|
|
|
| int nwrite = HANDLE_EINTR(write(socket_, buf->data(), buf_len));
|
| if (nwrite >= 0) {
|
| + static StatsCounter write_bytes("tcp.write_bytes");
|
| + write_bytes.Add(nwrite);
|
| net_log_.AddEvent(NetLog::TYPE_SOCKET_BYTES_SENT,
|
| new NetLogIntegerParameter("num_bytes", nwrite));
|
| return nwrite;
|
|
|