Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Issue 1696005: Add net log entries that summarize transmit and receive byte counts. (Closed)

Created:
10 years, 8 months ago by vandebo (ex-Chrome)
Modified:
9 years, 7 months ago
Reviewers:
eroman
CC:
chromium-reviews, cbentzel+watch_chromium.org, ben+cc_chromium.org, John Grabowski, idana, ncarter (slow), darin-cc_chromium.org, Paweł Hajdan Jr., pam+watch_chromium.org, tim (not reviewing)
Visibility:
Public.

Description

Add net log entries that summarize transmit and receive byte counts. Tx/Rx summaries are integrated into the net log at the last point that bytes were transmitted or received. Hopefully this will help resolve http://crbug.com/37729 by showing if we've received bytes over the network when we hit the "Waiting for cache" bug. This change also modernizes the use of NetLog: - ClientSocket now has a net_log() accessor - ClientSocket::Connect no longer takes a NetLog, instead the TCPClientSocket constructor takes one, others use their transport socket's NetLog - TCPClientSocket creates a new source id with source type SOCKET Also updates PassiveLogCollector infrastructure: - The LiveRequestsObserver lets a RequestTracker update a RequestInfo just before it is displayed. This allows ConnectJobs to be associated with URLRequests while connecting and then reassociated if they are late-bound to a different request. BUG=37729 TEST=tx/rx lines show up in chrome://net-internals/ Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=45449

Patch Set 1 #

Patch Set 2 : Rebase and lint #

Total comments: 43

Patch Set 3 : Address comments #

Total comments: 2

Patch Set 4 : Address comments - fix ConnectJob association, tcp close event #

Total comments: 1

Patch Set 5 : Update a few tests for net log changes #

Patch Set 6 : Rietveld is confused #

Patch Set 7 : Remove LiveRequestsObserver and add first of several unit tests #

Total comments: 12

Patch Set 8 : More tests and address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1539 lines, -404 lines) Patch
M chrome/browser/dom_ui/net_internals_ui.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/net/chrome_net_log.h View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/net/chrome_net_log.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/net/passive_log_collector.h View 1 2 3 4 5 6 7 8 chunks +72 lines, -16 lines 0 comments Download
M chrome/browser/net/passive_log_collector.cc View 1 2 3 4 5 6 7 15 chunks +223 lines, -45 lines 0 comments Download
M chrome/browser/net/passive_log_collector_unittest.cc View 1 2 3 4 5 6 7 7 chunks +846 lines, -20 lines 0 comments Download
M chrome/browser/net/view_net_internals_job_factory.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/sync/notifier/communicator/ssl_socket_adapter.h View 1 2 4 chunks +6 lines, -7 lines 0 comments Download
M chrome/browser/sync/notifier/communicator/ssl_socket_adapter.cc View 3 chunks +3 lines, -4 lines 0 comments Download
M net/base/net_log.h View 1 2 3 6 chunks +12 lines, -7 lines 0 comments Download
M net/base/net_log.cc View 1 2 3 2 chunks +8 lines, -1 line 0 comments Download
M net/base/net_log_event_type_list.h View 1 2 3 4 chunks +20 lines, -4 lines 0 comments Download
M net/ftp/ftp_network_transaction.cc View 2 chunks +6 lines, -4 lines 0 comments Download
M net/http/http_network_transaction.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M net/socket/client_socket.h View 1 2 3 chunks +5 lines, -3 lines 0 comments Download
M net/socket/client_socket_factory.h View 3 chunks +3 lines, -2 lines 0 comments Download
M net/socket/client_socket_factory.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M net/socket/client_socket_pool_base.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M net/socket/client_socket_pool_base.cc View 1 2 3 7 chunks +18 lines, -14 lines 0 comments Download
M net/socket/client_socket_pool_base_unittest.cc View 1 2 3 4 9 chunks +31 lines, -21 lines 0 comments Download
M net/socket/socket_test_util.h View 1 2 3 4 5 6 7 chunks +12 lines, -11 lines 0 comments Download
M net/socket/socket_test_util.cc View 1 2 3 4 5 6 6 chunks +13 lines, -11 lines 0 comments Download
M net/socket/socks5_client_socket.h View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M net/socket/socks5_client_socket.cc View 1 2 8 chunks +8 lines, -11 lines 0 comments Download
M net/socket/socks5_client_socket_unittest.cc View 1 2 11 chunks +45 lines, -35 lines 0 comments Download
M net/socket/socks_client_socket.h View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M net/socket/socks_client_socket.cc View 1 2 7 chunks +8 lines, -11 lines 0 comments Download
M net/socket/socks_client_socket_pool.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M net/socket/socks_client_socket_pool_unittest.cc View 1 2 chunks +4 lines, -4 lines 0 comments Download
M net/socket/socks_client_socket_unittest.cc View 11 chunks +30 lines, -30 lines 0 comments Download
M net/socket/ssl_client_socket_mac.h View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M net/socket/ssl_client_socket_mac.cc View 1 2 3 4 5 6 4 chunks +7 lines, -10 lines 0 comments Download
M net/socket/ssl_client_socket_nss.h View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M net/socket/ssl_client_socket_nss.cc View 1 2 6 chunks +8 lines, -10 lines 0 comments Download
M net/socket/ssl_client_socket_unittest.cc View 1 2 3 4 15 chunks +28 lines, -28 lines 0 comments Download
M net/socket/ssl_client_socket_win.h View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M net/socket/ssl_client_socket_win.cc View 1 2 5 chunks +7 lines, -9 lines 0 comments Download
M net/socket/tcp_client_socket_libevent.h View 1 2 2 chunks +5 lines, -3 lines 0 comments Download
M net/socket/tcp_client_socket_libevent.cc View 1 2 3 10 chunks +15 lines, -14 lines 0 comments Download
M net/socket/tcp_client_socket_pool.cc View 1 1 chunk +3 lines, -2 lines 0 comments Download
M net/socket/tcp_client_socket_pool_unittest.cc View 1 2 10 chunks +19 lines, -4 lines 0 comments Download
M net/socket/tcp_client_socket_unittest.cc View 1 2 3 4 10 chunks +13 lines, -13 lines 0 comments Download
M net/socket/tcp_client_socket_win.h View 1 2 3 4 2 chunks +4 lines, -3 lines 0 comments Download
M net/socket/tcp_client_socket_win.cc View 1 2 3 4 5 6 7 9 chunks +17 lines, -16 lines 0 comments Download
M net/socket/tcp_pinger.h View 2 chunks +3 lines, -3 lines 0 comments Download
M net/socket_stream/socket_stream.cc View 3 chunks +5 lines, -4 lines 0 comments Download
M net/spdy/spdy_session.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 10 (0 generated)
vandebo (ex-Chrome)
Eric, this should be a lot closer to what you expected. Thanks.
10 years, 8 months ago (2010-04-21 02:29:41 UTC) #1
eroman
Nice change! (thanks for doing this) I have reviewed everything except PassiveLogCollector -- I will ...
10 years, 8 months ago (2010-04-21 18:32:22 UTC) #2
eroman
I just ran this change locally, and got a crash: chrome.dll!`anonymous namespace'::InvalidParameter() Line 143 C++ ...
10 years, 8 months ago (2010-04-21 19:56:49 UTC) #3
vandebo (ex-Chrome)
I hadn't seen that crash, but I've addressed it. http://codereview.chromium.org/1696005/diff/2001/3005 File chrome/browser/net/passive_log_collector.h (right): http://codereview.chromium.org/1696005/diff/2001/3005#newcode112 chrome/browser/net/passive_log_collector.h:112: ...
10 years, 8 months ago (2010-04-21 21:21:22 UTC) #4
eroman
http://codereview.chromium.org/1696005/diff/2001/3004 File chrome/browser/net/passive_log_collector.cc (right): http://codereview.chromium.org/1696005/diff/2001/3004#newcode190 chrome/browser/net/passive_log_collector.cc:190: OnLiveRequest(&list.back(), req_it->first)); Doesn't this suffer the problem that if ...
10 years, 8 months ago (2010-04-21 21:42:37 UTC) #5
eroman
http://codereview.chromium.org/1696005/diff/15001/16004 File chrome/browser/net/passive_log_collector.cc (right): http://codereview.chromium.org/1696005/diff/15001/16004#newcode374 chrome/browser/net/passive_log_collector.cc:374: case net::NetLog::TYPE_TCP_CLOSE: I don't think this is the right ...
10 years, 8 months ago (2010-04-21 21:59:11 UTC) #6
vandebo (ex-Chrome)
http://codereview.chromium.org/1696005/diff/2001/3004 File chrome/browser/net/passive_log_collector.cc (right): http://codereview.chromium.org/1696005/diff/2001/3004#newcode190 chrome/browser/net/passive_log_collector.cc:190: OnLiveRequest(&list.back(), req_it->first)); On 2010/04/21 21:42:37, eroman wrote: > Doesn't ...
10 years, 8 months ago (2010-04-21 23:59:31 UTC) #7
vandebo (ex-Chrome)
http://codereview.chromium.org/1696005/diff/2001/3018 File net/socket/client_socket_pool_base.cc (right): http://codereview.chromium.org/1696005/diff/2001/3018#newcode237 net/socket/client_socket_pool_base.cc:237: NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID, job_net_log.source().id); On 2010/04/21 21:42:37, eroman wrote: > On ...
10 years, 8 months ago (2010-04-22 07:06:52 UTC) #8
eroman
lgtm http://codereview.chromium.org/1696005/diff/61001/5007 File chrome/browser/net/passive_log_collector.cc (right): http://codereview.chromium.org/1696005/diff/61001/5007#newcode326 chrome/browser/net/passive_log_collector.cc:326: StringPrintf("Used ConnectJob id=%d", connect_id)); i think %u may ...
10 years, 8 months ago (2010-04-22 21:46:08 UTC) #9
vandebo (ex-Chrome)
10 years, 8 months ago (2010-04-23 01:55:31 UTC) #10
Thanks for the review eric.  I'll submit after green trybots.

http://codereview.chromium.org/1696005/diff/61001/5007
File chrome/browser/net/passive_log_collector.cc (right):

http://codereview.chromium.org/1696005/diff/61001/5007#newcode326
chrome/browser/net/passive_log_collector.cc:326: StringPrintf("Used ConnectJob
id=%d", connect_id));
On 2010/04/22 21:46:09, eroman wrote:
> i think %u may be more appropriate for a uint32.

Done.

http://codereview.chromium.org/1696005/diff/61001/5007#newcode355
chrome/browser/net/passive_log_collector.cc:355: uint32 int_arg;
On 2010/04/22 21:46:09, eroman wrote:
> nit: perhaps this should just be |int| since the stored parameters is an int.

Done.

http://codereview.chromium.org/1696005/diff/61001/5007#newcode388
chrome/browser/net/passive_log_collector.cc:388: Entry new_entry(0,
net::NetLog::TYPE_TODO_STRING, base::TimeTicks(),
On 2010/04/22 21:46:09, eroman wrote:
> i wander if we shouldn't use a different |order| than 0 here.

We don't expect this code to run very frequently - Just after the data has been
cleared or if something has gone wrong. I don't think it's worth adding an
accesser to get the current value and I'm not sure UINT_MAX is particularly
better.  Thoughts?

http://codereview.chromium.org/1696005/diff/61001/5008
File chrome/browser/net/passive_log_collector.h (right):

http://codereview.chromium.org/1696005/diff/61001/5008#newcode64
chrome/browser/net/passive_log_collector.h:64: uint32 last_tx_rx_position;
On 2010/04/22 21:46:09, eroman wrote:
> can you add a comment for this?

Done.

http://codereview.chromium.org/1696005/diff/61001/5008#newcode65
chrome/browser/net/passive_log_collector.h:65: base::TimeTicks last_tx_rx_time;
On 2010/04/22 21:46:09, eroman wrote:
> can you add a comment for this?

Done.

http://codereview.chromium.org/1696005/diff/61001/5008#newcode105
chrome/browser/net/passive_log_collector.h:105: virtual void
OnLiveRequest(RequestInfo* info) const {}
On 2010/04/22 21:46:09, eroman wrote:
> Can you add a comment for this?

Done.

Powered by Google App Engine
This is Rietveld 408576698