Chromium Code Reviews| Index: net/socket/tcp_client_socket_win.cc |
| =================================================================== |
| --- net/socket/tcp_client_socket_win.cc (revision 88319) |
| +++ net/socket/tcp_client_socket_win.cc (working copy) |
| @@ -487,6 +487,7 @@ |
| core_->write_overlapped_.hEvent = WSACreateEvent(); |
| + connect_start_time_ = base::Time::Now(); |
| if (!connect(socket_, ai->ai_addr, static_cast<int>(ai->ai_addrlen))) { |
| // Connected without waiting! |
| // |
| @@ -525,6 +526,9 @@ |
| net_log_.EndEvent(NetLog::TYPE_TCP_CONNECT_ATTEMPT, params); |
| if (result == OK) { |
| + rtt_ms_ = static_cast<double>((base::Time::Now() - |
| + connect_start_time_).InMicroseconds()) |
| + / 1000.0; |
|
willchan no longer on Chromium
2011/06/09 15:08:54
same comments as in the libevent socket
Gagan
2011/06/09 19:49:26
please let me know if you prefer rtt in microsecon
willchan no longer on Chromium
2011/06/10 15:05:55
milliseconds makes sense to me.
Gagan
2011/06/10 17:44:17
I changed it to micros in the last patch. It allow
|
| use_history_.set_was_ever_connected(); |
| return OK; // Done! |
| } |
| @@ -691,6 +695,7 @@ |
| base::MemoryDebug::MarkAsInitialized(core_->read_buffer_.buf, num); |
| base::StatsCounter read_bytes("tcp.read_bytes"); |
| read_bytes.Add(num); |
| + num_bytes_read_ += num; |
| if (num > 0) |
| use_history_.set_was_used_to_convey_data(); |
| net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_RECEIVED, num, |
| @@ -861,6 +866,7 @@ |
| if (ok) { |
| base::StatsCounter read_bytes("tcp.read_bytes"); |
| read_bytes.Add(num_bytes); |
| + num_bytes_read_ += num_bytes; |
| if (num_bytes > 0) |
| use_history_.set_was_used_to_convey_data(); |
| net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_RECEIVED, |