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

Issue 1390993005: Amortize data usage using TrafficStats on Android. (Closed)

Created:
5 years, 2 months ago by sclittle
Modified:
5 years, 1 month ago
CC:
chromium-reviews, blundell+watchlist_chromium.org, cbentzel+watch_chromium.org, sdefresne+watchlist_chromium.org, droger+watchlist_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@data_use_buffering
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Amortize data usage using TrafficStats on Android. This CL adds a DataUseAmortizer interface to the data_usage component, and makes the DataUseAggregator use it to amortize data usage byte counts on supported platforms. This CL also adds an implementation of the DataUseAmortizer based on TrafficStats for Android. TBR=brettw@chromium.org,mmenke@chromium.org BUG=518051 Committed: https://crrev.com/c441f78fcb48ef54a880e32fc2b43996958d3eb9 Cr-Commit-Position: refs/heads/master@{#359198}

Patch Set 1 #

Total comments: 10

Patch Set 2 : Redesigned to move buffering into the amortizers, still needs tests #

Patch Set 3 : Simplified and polished design, still ironing out tests #

Total comments: 62

Patch Set 4 : Addressed comments #

Patch Set 5 : Polished and cleaned up tests #

Total comments: 24

Patch Set 6 : Addressed bengr comments #

Total comments: 2

Patch Set 7 : Fixed nit #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+1168 lines, -249 lines) Patch
M chrome/browser/BUILD.gn View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/DEPS View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/android/data_usage/external_data_use_observer_unittest.cc View 1 2 3 4 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/io_thread.cc View 1 2 3 3 chunks +9 lines, -1 line 0 comments Download
M chrome/browser/net/chrome_network_delegate_unittest.cc View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M components/components_tests.gyp View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
M components/data_usage.gypi View 1 2 1 chunk +22 lines, -1 line 0 comments Download
A + components/data_usage/android/BUILD.gn View 1 2 2 chunks +7 lines, -8 lines 0 comments Download
A + components/data_usage/android/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
A components/data_usage/android/traffic_stats_amortizer.h View 1 2 3 4 5 6 1 chunk +163 lines, -0 lines 0 comments Download
A components/data_usage/android/traffic_stats_amortizer.cc View 1 2 3 4 5 1 chunk +292 lines, -0 lines 2 comments Download
A components/data_usage/android/traffic_stats_amortizer_unittest.cc View 1 2 3 4 5 1 chunk +416 lines, -0 lines 0 comments Download
M components/data_usage/core/BUILD.gn View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M components/data_usage/core/data_use_aggregator.h View 1 2 5 chunks +13 lines, -21 lines 0 comments Download
M components/data_usage/core/data_use_aggregator.cc View 1 2 4 chunks +25 lines, -41 lines 0 comments Download
M components/data_usage/core/data_use_aggregator_unittest.cc View 1 2 3 4 8 chunks +166 lines, -174 lines 0 comments Download
A components/data_usage/core/data_use_amortizer.h View 1 2 3 4 5 1 chunk +42 lines, -0 lines 0 comments Download

Messages

Total messages: 31 (8 generated)
sclittle
PTAL for sanity check. Thanks in advance!
5 years, 2 months ago (2015-10-10 08:35:02 UTC) #2
tbansal1
https://codereview.chromium.org/1390993005/diff/1/chrome/browser/net/chrome_network_delegate_unittest.cc File chrome/browser/net/chrome_network_delegate_unittest.cc (right): https://codereview.chromium.org/1390993005/diff/1/chrome/browser/net/chrome_network_delegate_unittest.cc#newcode104 chrome/browser/net/chrome_network_delegate_unittest.cc:104: .Pass()), nit: don't think Pass() is needed https://codereview.chromium.org/1390993005/diff/1/components/data_usage/android/traffic_stats_amortizer.cc File ...
5 years, 2 months ago (2015-10-12 21:23:20 UTC) #3
bengr
https://codereview.chromium.org/1390993005/diff/1/components/data_usage/android/traffic_stats_amortizer.cc File components/data_usage/android/traffic_stats_amortizer.cc (right): https://codereview.chromium.org/1390993005/diff/1/components/data_usage/android/traffic_stats_amortizer.cc#newcode51 components/data_usage/android/traffic_stats_amortizer.cc:51: RefreshTrafficStats(); Say more. How far behind is TrafficStats? https://codereview.chromium.org/1390993005/diff/1/components/data_usage/android/traffic_stats_amortizer.cc#newcode69 ...
5 years, 2 months ago (2015-10-12 21:33:08 UTC) #4
sclittle
PTAL, I'm still ironing out some tests but the production code's all there.
5 years, 1 month ago (2015-11-10 10:26:28 UTC) #6
bengr
https://codereview.chromium.org/1390993005/diff/60001/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/1390993005/diff/60001/chrome/browser/io_thread.cc#newcode613 chrome/browser/io_thread.cc:613: data_use_amortizer.reset(new data_usage::android::TrafficStatsAmortizer()); It would be better if you didn't ...
5 years, 1 month ago (2015-11-10 18:12:51 UTC) #7
tbansal1
https://codereview.chromium.org/1390993005/diff/60001/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/1390993005/diff/60001/chrome/browser/io_thread.cc#newcode613 chrome/browser/io_thread.cc:613: data_use_amortizer.reset(new data_usage::android::TrafficStatsAmortizer()); Why can this not be constructed in ...
5 years, 1 month ago (2015-11-10 18:53:55 UTC) #8
tbansal1
5 years, 1 month ago (2015-11-10 18:53:57 UTC) #9
tbansal1
5 years, 1 month ago (2015-11-10 18:53:57 UTC) #10
sclittle
https://codereview.chromium.org/1390993005/diff/60001/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/1390993005/diff/60001/chrome/browser/io_thread.cc#newcode613 chrome/browser/io_thread.cc:613: data_use_amortizer.reset(new data_usage::android::TrafficStatsAmortizer()); On 2015/11/10 18:12:50, bengr wrote: > It ...
5 years, 1 month ago (2015-11-11 02:10:08 UTC) #11
sclittle
mmenke: io_thread.cc, chrome_network_delegate_unittest.cc Thanks in advance!
5 years, 1 month ago (2015-11-11 02:15:49 UTC) #13
bengr
https://codereview.chromium.org/1390993005/diff/60001/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/1390993005/diff/60001/chrome/browser/io_thread.cc#newcode613 chrome/browser/io_thread.cc:613: data_use_amortizer.reset(new data_usage::android::TrafficStatsAmortizer()); On 2015/11/11 02:10:07, sclittle wrote: > On ...
5 years, 1 month ago (2015-11-11 15:41:38 UTC) #14
sclittle
https://codereview.chromium.org/1390993005/diff/100001/components/data_usage/android/traffic_stats_amortizer.cc File components/data_usage/android/traffic_stats_amortizer.cc (right): https://codereview.chromium.org/1390993005/diff/100001/components/data_usage/android/traffic_stats_amortizer.cc#newcode107 components/data_usage/android/traffic_stats_amortizer.cc:107: // Amortize the difference between |desired_post_amortization_total_tx_bytes| On 2015/11/11 15:41:38, ...
5 years, 1 month ago (2015-11-11 20:02:21 UTC) #15
sclittle
thestig: chrome/browser/* Switching out mmenke@ with thestig@ since mmenke@ is travelling.
5 years, 1 month ago (2015-11-11 20:04:55 UTC) #17
Lei Zhang
On 2015/11/11 20:04:55, sclittle wrote: > thestig: chrome/browser/* > > Switching out mmenke@ with thestig@ ...
5 years, 1 month ago (2015-11-11 20:08:19 UTC) #18
bengr
lgtm with a nit. https://codereview.chromium.org/1390993005/diff/120001/components/data_usage/android/traffic_stats_amortizer.h File components/data_usage/android/traffic_stats_amortizer.h (right): https://codereview.chromium.org/1390993005/diff/120001/components/data_usage/android/traffic_stats_amortizer.h#newcode38 components/data_usage/android/traffic_stats_amortizer.h:38: // TrafficStats have been available ...
5 years, 1 month ago (2015-11-11 22:52:53 UTC) #19
sclittle
https://codereview.chromium.org/1390993005/diff/120001/components/data_usage/android/traffic_stats_amortizer.h File components/data_usage/android/traffic_stats_amortizer.h (right): https://codereview.chromium.org/1390993005/diff/120001/components/data_usage/android/traffic_stats_amortizer.h#newcode38 components/data_usage/android/traffic_stats_amortizer.h:38: // TrafficStats have been available in Android since API ...
5 years, 1 month ago (2015-11-11 22:56:25 UTC) #20
sclittle
TBR-ing to brettw@ and mmenke@ for "url/" and "net/" added to DEPS respectively.
5 years, 1 month ago (2015-11-11 22:59:55 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1390993005/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1390993005/140001
5 years, 1 month ago (2015-11-11 23:01:09 UTC) #25
commit-bot: I haz the power
Committed patchset #7 (id:140001)
5 years, 1 month ago (2015-11-12 01:12:21 UTC) #26
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/c441f78fcb48ef54a880e32fc2b43996958d3eb9 Cr-Commit-Position: refs/heads/master@{#359198}
5 years, 1 month ago (2015-11-12 20:02:16 UTC) #27
mmenke
https://codereview.chromium.org/1390993005/diff/140001/components/data_usage/android/traffic_stats_amortizer.cc File components/data_usage/android/traffic_stats_amortizer.cc (right): https://codereview.chromium.org/1390993005/diff/140001/components/data_usage/android/traffic_stats_amortizer.cc#newcode78 components/data_usage/android/traffic_stats_amortizer.cc:78: int64_t desired_post_amortization_total) { So you're adding data use from ...
5 years, 1 month ago (2015-11-12 20:14:51 UTC) #29
bengr
https://codereview.chromium.org/1390993005/diff/140001/components/data_usage/android/traffic_stats_amortizer.cc File components/data_usage/android/traffic_stats_amortizer.cc (right): https://codereview.chromium.org/1390993005/diff/140001/components/data_usage/android/traffic_stats_amortizer.cc#newcode78 components/data_usage/android/traffic_stats_amortizer.cc:78: int64_t desired_post_amortization_total) { On 2015/11/12 20:14:50, mmenke (OOO Nov ...
5 years, 1 month ago (2015-11-12 20:42:03 UTC) #30
mmenke
5 years, 1 month ago (2015-11-12 22:02:57 UTC) #31
Message was sent while issue was closed.
On 2015/11/12 20:42:03, bengr wrote:
>
https://codereview.chromium.org/1390993005/diff/140001/components/data_usage/...
> File components/data_usage/android/traffic_stats_amortizer.cc (right):
> 
>
https://codereview.chromium.org/1390993005/diff/140001/components/data_usage/...
> components/data_usage/android/traffic_stats_amortizer.cc:78: int64_t
> desired_post_amortization_total) {
> On 2015/11/12 20:14:50, mmenke (OOO Nov 11 - Nov 15) wrote:
> > So you're adding data use from all monitored URLRequests and then amortizing
> > based on aggregate data use on Android?  What about URLRequestContexts that
> > don't use a ChromeNetworkDelegate, or things that directly use a sockets? 
> (GCM
> > does that, wouldn't be surprised if other stuff does as well).
> 
> This is a source of noise in the accounting. We hope to characterize this
noise
> and to improve on accuracy.

Great, just wanted to make sure it was on your radar.

Powered by Google App Engine
This is Rietveld 408576698