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

Issue 2417773005: Record the time since Chromium is in background for background data use (Closed)

Created:
4 years, 2 months ago by Raj
Modified:
4 years, 1 month ago
CC:
chromium-reviews, jam, darin-cc_chromium.org, asvitkine+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Record the time since Chromium is in background for background data use DataUse.BackgroundToDataRecievedPerByte.[User|System] histogram is recorded for each background downstream byte. DataUse.BackgroundToFirstDownstream.[User|System] histogram is recorded for the first background downstream byte. BUG=648808 Committed: https://crrev.com/8766555a6c807796f6c177a3fe4ed81598620324 Cr-Commit-Position: refs/heads/master@{#426386}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Addressed kundaji comments #

Patch Set 3 : Fix compile error #

Total comments: 10

Patch Set 4 : Addressed holte comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+184 lines, -9 lines) Patch
M components/data_use_measurement/content/data_use_measurement.h View 1 4 chunks +12 lines, -2 lines 0 comments Download
M components/data_use_measurement/content/data_use_measurement.cc View 1 2 3 6 chunks +45 lines, -7 lines 0 comments Download
M components/data_use_measurement/content/data_use_measurement_unittest.cc View 1 2 3 1 chunk +99 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 2 chunks +28 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (15 generated)
Raj
4 years, 2 months ago (2016-10-14 03:43:17 UTC) #2
Not at Google. Contact bengr
lgtm https://codereview.chromium.org/2417773005/diff/1/components/data_use_measurement/content/data_use_measurement.cc File components/data_use_measurement/content/data_use_measurement.cc (right): https://codereview.chromium.org/2417773005/diff/1/components/data_use_measurement/content/data_use_measurement.cc#newcode165 components/data_use_measurement/content/data_use_measurement.cc:165: base::TimeTicks::Now() - last_app_background_time_; DCHECK(!last_app_background_time_.is_null()); https://codereview.chromium.org/2417773005/diff/1/components/data_use_measurement/content/data_use_measurement.h File components/data_use_measurement/content/data_use_measurement.h (right): ...
4 years, 2 months ago (2016-10-14 23:10:57 UTC) #3
Raj
holte: ptal histograms.xml https://codereview.chromium.org/2417773005/diff/1/components/data_use_measurement/content/data_use_measurement.cc File components/data_use_measurement/content/data_use_measurement.cc (right): https://codereview.chromium.org/2417773005/diff/1/components/data_use_measurement/content/data_use_measurement.cc#newcode165 components/data_use_measurement/content/data_use_measurement.cc:165: base::TimeTicks::Now() - last_app_background_time_; On 2016/10/14 23:10:57, ...
4 years, 2 months ago (2016-10-15 19:36:15 UTC) #7
Steven Holte
Some naming suggestions, and you are also missing changes to histogram_suffixes. https://codereview.chromium.org/2417773005/diff/40001/components/data_use_measurement/content/data_use_measurement.cc File components/data_use_measurement/content/data_use_measurement.cc (right): ...
4 years, 2 months ago (2016-10-17 21:35:16 UTC) #14
Raj
On 2016/10/17 21:35:16, Steven Holte wrote: > Some naming suggestions, and you are also missing ...
4 years, 2 months ago (2016-10-19 07:05:12 UTC) #15
Raj
https://codereview.chromium.org/2417773005/diff/40001/components/data_use_measurement/content/data_use_measurement.cc File components/data_use_measurement/content/data_use_measurement.cc (right): https://codereview.chromium.org/2417773005/diff/40001/components/data_use_measurement/content/data_use_measurement.cc#newcode53 components/data_use_measurement/content/data_use_measurement.cc:53: int64_t value) { On 2016/10/17 21:35:16, Steven Holte wrote: ...
4 years, 2 months ago (2016-10-19 20:07:20 UTC) #16
Steven Holte
histograms lgtm
4 years, 2 months ago (2016-10-19 23:29:06 UTC) #18
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/2417773005/60001
4 years, 2 months ago (2016-10-20 01:34:37 UTC) #21
commit-bot: I haz the power
Failed to apply the patch. On branch working_branch Your branch is up-to-date with 'origin/refs/pending/heads/master'. nothing ...
4 years, 2 months ago (2016-10-20 03:36:48 UTC) #23
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/8766555a6c807796f6c177a3fe4ed81598620324 Cr-Commit-Position: refs/heads/master@{#426386}
4 years, 2 months ago (2016-10-21 13:14:56 UTC) #25
Ted C
On 2016/10/21 13:14:56, commit-bot: I haz the power wrote: > Patchset 4 (id:??) landed as ...
4 years, 1 month ago (2016-10-24 18:06:23 UTC) #26
Steven Holte
4 years, 1 month ago (2016-10-24 20:35:51 UTC) #27
Message was sent while issue was closed.
On 2016/10/24 18:06:23, Ted C (OOO 10.25 - 30) wrote:
> On 2016/10/21 13:14:56, commit-bot: I haz the power wrote:
> > Patchset 4 (id:??) landed as
> > https://crrev.com/8766555a6c807796f6c177a3fe4ed81598620324
> > Cr-Commit-Position: refs/heads/master@{#426386}
> 
> FYI, I think Chrome just crashed in the background for me as a result
> of this change.
> 
> F/chromium(31165): [FATAL:histogram_base.cc(73)] Check failed:
histogram_name()
> == name (DataUse.BackgroundToFirstDownstream.System vs.
> DataUse.BackgroundToFirstDownstream.User)
> 
> Stack was pretty much garbage though.  I hit it after I toggled Android's
> "Don't keep activities" setting in dev options.
> 
> I "believe" the problem is that the UMA macros cache the values
> internally and this causes the value to change unexpectedly:
> 
> UMA_HISTOGRAM_LONG_TIMES(
>     is_user_traffic ? "DataUse.BackgroundToFirstDownstream.User"
>                     : "DataUse.BackgroundToFirstDownstream.System",
>     time_since_background);
> 
> Again no metrics expert, but I think you need to do:
> 
> if (is_user_traffic) {
>   UMA_HISTOGRAM_LONG_TIMES(
>       "DataUse.BackgroundToFirstDownstream.User",
>       time_since_background);                     
> } else {
>   UMA_HISTOGRAM_LONG_TIMES(
>       "DataUse.BackgroundToFirstDownstream.System",
>       time_since_background);                     
> }

Can confirm, recording two names via a single UMA_HISTOGRAM_LONG_TIMES
invocation is a problem.  You either need two invocations, or use FactoryGet as
in your other histograms.  Sorry for not spotting this one.

Powered by Google App Engine
This is Rietveld 408576698