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

Issue 2905403002: plumb network upload into the task manager (Closed)

Created:
3 years, 7 months ago by cburn
Modified:
3 years, 6 months ago
Reviewers:
ncarter (slow), mmenke
CC:
chromium-reviews, cbentzel+watch_chromium.org, net-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

This adds the plumbing needed to take data about completed outbound network traffic to the task manager for tracking network usage. There are a number of naming changes to help distinguish between what is and isn't a "rate" and what is sent vs read vs transferred. Read being incoming bytes, sent being outgoing bytes and transfered being either read or sent bytes. The "rates" are not calculated based on what is live on the network. It is instead based on when requests are completed so large uploads will all be registered in one refresh. This update changes the struct BytesReadParam to BytesTrasferedParam and stores both bytes read and bytes sent. It updates how the struct is processed to handle the additional tracking of sent bytes. Tasks have been changed to store the cumulative_bytes_read_ and cumulative_bytes_sent_ which are stored on Refresh() to the last_refresh_cumulative_bytes_sent_ and last_refresh_cumulative_bytes_read_ . These are used to calculate network_sent_rate_ and network_read_rate_ which are summed for the network_usage_rate_. Tasks no longer store a network usage of -1 to signify that they have not had any network traffic, the utility of that flag no longer appears to be used so it was removed. Because of this ReportsNetworkUsage() has been removed. Tasks and Task Groups can now report their cumulative network usage. BUG=720773 Review-Url: https://codereview.chromium.org/2905403002 Cr-Commit-Position: refs/heads/master@{#480988} Committed: https://chromium.googlesource.com/chromium/src/+/e9d2f361a156c914b8e4ac51f98397c33d92573d

Patch Set 1 #

Patch Set 2 : adding browser test to task manager network uploads not being tracked #

Patch Set 3 : Fixed failing IdleWakeups test; missing break statement #

Patch Set 4 : Added aggregate network use for both sent and recieved bytes #

Patch Set 5 : fixed some typos noticed in code review #

Patch Set 6 : fixed negative byte totals #

Total comments: 28

Patch Set 7 : merged byte_read_buffer_ and byte_sent_buffer_ into byte_transfered_buffer_ to make it one pipeline #

Patch Set 8 : updated names and comments for readability #

Patch Set 9 : fixed comments and names as far as possible in only task manager #

Patch Set 10 : missed save caused file to retain old naming #

Patch Set 11 : fixed spelling/parellelism issues #

Total comments: 32

Patch Set 12 : moved test and added task group tests #

Patch Set 13 : added catch for base::TimeDelta() being 0s and causing a div by 0 crash #

Patch Set 14 : added refresh timer tests #

Total comments: 34

Patch Set 15 : changed browser test to be hopefully less flakey #

Patch Set 16 : js formatting, fixing spelling, modifying browser tests #

Total comments: 8

Patch Set 17 : fixed comments #

Patch Set 18 : fixed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+667 lines, -97 lines) Patch
M chrome/browser/net/chrome_network_delegate.cc View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/task_manager/providers/browser_process_task_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -4 lines 0 comments Download
M chrome/browser/task_manager/providers/child_process_task_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +1 line, -3 lines 0 comments Download
M chrome/browser/task_manager/providers/task.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +45 lines, -12 lines 0 comments Download
M chrome/browser/task_manager/providers/task.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +24 lines, -16 lines 0 comments Download
M chrome/browser/task_manager/sampling/task_group.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +11 lines, -3 lines 0 comments Download
M chrome/browser/task_manager/sampling/task_group.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +9 lines, -6 lines 0 comments Download
M chrome/browser/task_manager/sampling/task_group_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +351 lines, -0 lines 0 comments Download
M chrome/browser/task_manager/sampling/task_manager_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +8 lines, -4 lines 0 comments Download
M chrome/browser/task_manager/sampling/task_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +20 lines, -10 lines 0 comments Download
M chrome/browser/task_manager/sampling/task_manager_io_thread_helper.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +30 lines, -18 lines 0 comments Download
M chrome/browser/task_manager/sampling/task_manager_io_thread_helper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +32 lines, -16 lines 0 comments Download
M chrome/browser/task_manager/task_manager_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +74 lines, -0 lines 0 comments Download
M chrome/browser/task_manager/task_manager_browsertest_util.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/task_manager/task_manager_browsertest_util.cc View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/task_manager/task_manager_interface.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +18 lines, -4 lines 0 comments Download
M chrome/browser/task_manager/task_manager_interface.cc View 1 2 3 4 5 6 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/task_manager/task_manager_tester.cc View 1 2 3 4 5 6 7 8 9 2 chunks +11 lines, -0 lines 0 comments Download
M chrome/browser/task_manager/test_task_manager.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/task_manager/test_task_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +10 lines, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 90 (77 generated)
ncarter (slow)
This is looking really good. I have some structural feedback aimed at simplifying the code, ...
3 years, 6 months ago (2017-06-08 23:37:19 UTC) #22
cburn
ptal https://codereview.chromium.org/2905403002/diff/100001/chrome/browser/task_manager/providers/browser_process_task_unittest.cc File chrome/browser/task_manager/providers/browser_process_task_unittest.cc (right): https://codereview.chromium.org/2905403002/diff/100001/chrome/browser/task_manager/providers/browser_process_task_unittest.cc#newcode63 chrome/browser/task_manager/providers/browser_process_task_unittest.cc:63: // Test the provided browser process task for ...
3 years, 6 months ago (2017-06-14 18:04:38 UTC) #45
ncarter (slow)
One bug, one suggestion for expanding the test, and one idea for reducing the code ...
3 years, 6 months ago (2017-06-14 20:20:59 UTC) #46
cburn
ptal https://codereview.chromium.org/2905403002/diff/200001/chrome/browser/task_manager/providers/browser_process_task_unittest.cc File chrome/browser/task_manager/providers/browser_process_task_unittest.cc (right): https://codereview.chromium.org/2905403002/diff/200001/chrome/browser/task_manager/providers/browser_process_task_unittest.cc#newcode160 chrome/browser/task_manager/providers/browser_process_task_unittest.cc:160: EXPECT_EQ(sent_bytes + received_bytes, provided_task_->network_usage_rate()); On 2017/06/14 20:20:58, ncarter ...
3 years, 6 months ago (2017-06-16 21:52:27 UTC) #57
ncarter (slow)
https://codereview.chromium.org/2905403002/diff/260001/chrome/browser/task_manager/providers/browser_process_task_unittest.cc File chrome/browser/task_manager/providers/browser_process_task_unittest.cc (right): https://codereview.chromium.org/2905403002/diff/260001/chrome/browser/task_manager/providers/browser_process_task_unittest.cc#newcode82 chrome/browser/task_manager/providers/browser_process_task_unittest.cc:82: REFRESH_TYPE_NETWORK_USAGE); Now that the main tests of network-usage functionality ...
3 years, 6 months ago (2017-06-16 22:28:30 UTC) #60
ncarter (slow)
https://codereview.chromium.org/2905403002/diff/260001/chrome/browser/task_manager/sampling/task_manager_io_thread_helper.cc File chrome/browser/task_manager/sampling/task_manager_io_thread_helper.cc (right): https://codereview.chromium.org/2905403002/diff/260001/chrome/browser/task_manager/sampling/task_manager_io_thread_helper.cc#newcode65 chrome/browser/task_manager/sampling/task_manager_io_thread_helper.cc:65: bytes_sent); You can also consider using this style: OnNetworkBytesTransfered(request, ...
3 years, 6 months ago (2017-06-17 00:21:02 UTC) #61
cburn
ptal https://codereview.chromium.org/2905403002/diff/260001/chrome/browser/task_manager/providers/browser_process_task_unittest.cc File chrome/browser/task_manager/providers/browser_process_task_unittest.cc (right): https://codereview.chromium.org/2905403002/diff/260001/chrome/browser/task_manager/providers/browser_process_task_unittest.cc#newcode82 chrome/browser/task_manager/providers/browser_process_task_unittest.cc:82: REFRESH_TYPE_NETWORK_USAGE); On 2017/06/16 22:28:30, ncarter (slow) wrote: > ...
3 years, 6 months ago (2017-06-19 22:07:09 UTC) #68
ncarter (slow)
task_manager lgtm w/ a couple nits https://codereview.chromium.org/2905403002/diff/300001/chrome/browser/task_manager/providers/task.h File chrome/browser/task_manager/providers/task.h (right): https://codereview.chromium.org/2905403002/diff/300001/chrome/browser/task_manager/providers/task.h#newcode149 chrome/browser/task_manager/providers/task.h:149: // (sent and ...
3 years, 6 months ago (2017-06-20 19:52:27 UTC) #71
ncarter (slow)
Also: please update your change description now that the scope of your change is complete. ...
3 years, 6 months ago (2017-06-20 19:54:56 UTC) #72
cburn
mmenke, please review chrome/browser/net https://codereview.chromium.org/2905403002/diff/300001/chrome/browser/task_manager/providers/task.h File chrome/browser/task_manager/providers/task.h (right): https://codereview.chromium.org/2905403002/diff/300001/chrome/browser/task_manager/providers/task.h#newcode149 chrome/browser/task_manager/providers/task.h:149: // (sent and recieved), as ...
3 years, 6 months ago (2017-06-20 21:34:56 UTC) #82
mmenke
chrome/browser/net LGTM
3 years, 6 months ago (2017-06-20 21:56:25 UTC) #83
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2905403002/340001
3 years, 6 months ago (2017-06-20 22:05:28 UTC) #87
commit-bot: I haz the power
3 years, 6 months ago (2017-06-20 22:15:25 UTC) #90
Message was sent while issue was closed.
Committed patchset #18 (id:340001) as
https://chromium.googlesource.com/chromium/src/+/e9d2f361a156c914b8e4ac51f983...

Powered by Google App Engine
This is Rietveld 408576698