New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 720773 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
not working at Google anymore
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Task Manager mislabels network usage

Project Member Reported by a...@chromium.org, May 10 2017

Issue description

(split from bug 720200)

Chrome Version: 60.0.3088.3
OS: macOS 10.11.6 (15G1421)

What steps will reproduce the problem?
(1) Open a Google Drive window
(2) Drop a multi-gigabyte file in it

Issue:
Many megabytes per second are uploaded but that network usage doesn't show in the Task Manager for any task.

If we look at where the value for the "network" column for the task manager comes from, we see that ChromeNetworkDelegate::OnNetworkBytesReceived calls to task_manager::TaskManagerInterface::OnRawBytesRead, which then figures out how to allocate it. The problem is that we're only measuring bytes *read* from the network, meaning downloads, but the UI says "network" which means that it includes uploads too, which it clearly does not.

Either the column needs to accurately indicate that it's only measuring downloads and not uploads, or uploads need to be hooked in as well.
 

Comment 1 by a...@chromium.org, May 10 2017

Cc: afakhry@chromium.org a...@chromium.org

Comment 2 by nick@chromium.org, May 23 2017

Cc: cburn@google.com
Labels: Hotlist-GoodFirstBug

Comment 3 by cburn@google.com, May 26 2017

I have looked into this bug and the network usage only updates after a URLRequest has been completed. 

I have found where the "live" updates can be found in the network stack (at least for the drive example other settings haven't been tested with that). 

In order to capture the amount of data that has been transferred, not a live rate, I have started to mirror the plumbing that gets the received data from NetworkDelegate back to the task manager. This means that once the upload is terminated there is a large spike in network activity (if I uploaded a 100M file when that is completed and the PUT request is complete I will get a speed of 100M/S for that refresh on the task manager). 

I mirrored the pipeline from the read bytes to sent bytes because I am not sure if in the future there would be a need to add tools specifically for one or the other and I didn't want to shoehorn all currently trackable network traffic into one bit when there might be a reason for 2. 

Comment 4 by nick@chromium.org, Jun 7 2017

Status: Started (was: Assigned)
Project Member

Comment 5 by bugdroid1@chromium.org, Jun 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e9d2f361a156c914b8e4ac51f98397c33d92573d

commit e9d2f361a156c914b8e4ac51f98397c33d92573d
Author: cburn <cburn@google.com>
Date: Tue Jun 20 22:15:03 2017

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}

[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/net/chrome_network_delegate.cc
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/providers/browser_process_task_unittest.cc
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/providers/child_process_task_unittest.cc
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/providers/task.cc
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/providers/task.h
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/sampling/task_group.cc
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/sampling/task_group.h
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/sampling/task_group_unittest.cc
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/sampling/task_manager_impl.cc
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/sampling/task_manager_impl.h
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/sampling/task_manager_io_thread_helper.cc
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/sampling/task_manager_io_thread_helper.h
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/task_manager_browsertest.cc
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/task_manager_browsertest_util.cc
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/task_manager_browsertest_util.h
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/task_manager_interface.cc
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/task_manager_interface.h
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/task_manager_tester.cc
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/test_task_manager.cc
[modify] https://crrev.com/e9d2f361a156c914b8e4ac51f98397c33d92573d/chrome/browser/task_manager/test_task_manager.h

Project Member

Comment 6 by bugdroid1@chromium.org, Jul 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c0a595329cf5a58ed1beb487a84c3213b0247061

commit c0a595329cf5a58ed1beb487a84c3213b0247061
Author: cburn <cburn@google.com>
Date: Thu Jul 06 17:34:39 2017

TaskManager: use an unordered_map for tracking network usage

This CL changes a vector to an unordered_map and splits
BytesTransferredParam into BytesTransferedKey and BytesTransferedParam.
Where the key contains the |origin_pid|, |child_id| and |route_id|. The
BytesTransferedParam contains |byte_read_count| and |byte_sent_count|
and will use those values to increment the entry in the unordered map.

This hoists |content::ResourceRequestInfo::ForRequest(request)| to the
task manager interface so the bytes transferred pipeline can be
simplified from the task manager interface to the task manager. This
also allows for unit tests to be written for
task_manager_io_thread_helper to test that the unordered map is being
filled out appropriately. This is done through dependency injection in
the IoThreadHelperManager.

BUG= 720773 

Review-Url: https://codereview.chromium.org/2964543002
Cr-Commit-Position: refs/heads/master@{#484652}

[modify] https://crrev.com/c0a595329cf5a58ed1beb487a84c3213b0247061/chrome/browser/task_manager/sampling/task_manager_impl.cc
[modify] https://crrev.com/c0a595329cf5a58ed1beb487a84c3213b0247061/chrome/browser/task_manager/sampling/task_manager_impl.h
[modify] https://crrev.com/c0a595329cf5a58ed1beb487a84c3213b0247061/chrome/browser/task_manager/sampling/task_manager_io_thread_helper.cc
[modify] https://crrev.com/c0a595329cf5a58ed1beb487a84c3213b0247061/chrome/browser/task_manager/sampling/task_manager_io_thread_helper.h
[add] https://crrev.com/c0a595329cf5a58ed1beb487a84c3213b0247061/chrome/browser/task_manager/sampling/task_manager_io_thread_helper_unittest.cc
[modify] https://crrev.com/c0a595329cf5a58ed1beb487a84c3213b0247061/chrome/browser/task_manager/task_manager_interface.cc
[modify] https://crrev.com/c0a595329cf5a58ed1beb487a84c3213b0247061/chrome/test/BUILD.gn

Comment 7 by nick@chromium.org, Jul 6 2017

Status: Fixed (was: Started)

Sign in to add a comment