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

Issue 103943006: Let MetricsService know about some Android Activities (Closed)

Created:
7 years ago by gone
Modified:
6 years, 11 months ago
CC:
chromium-reviews, jar (doing other things), asvitkine+watch_chromium.org, Kibeom Kim (inactive)
Visibility:
Public.

Description

Let MetricsService know about some Android Activities To tune our crash states more finely, we need to track which Activity is in the foreground when Chrome is killed. Add piping to let MetricsService know when Activities are swapped in and out by the user. The CL makes MetricsService track how many times particular Activities have been launched, as well as how often Chrome was improperly closed while one of these Activities was in the foreground (i.e. crashed). These numbers are concatenated into a histogram, which is then sent to the server. BUG=321346

Patch Set 1 #

Patch Set 2 : Cleaning up #

Patch Set 3 : Fleshing out templates #

Patch Set 4 : Cleaning #

Total comments: 6

Patch Set 5 : Comment addressing #

Patch Set 6 : Separating out Android code #

Patch Set 7 : Copyright #

Total comments: 14

Patch Set 8 : Switching from sparse #

Patch Set 9 : Use regular histograms #

Total comments: 3

Patch Set 10 : Splitting variables #

Total comments: 6

Patch Set 11 : Addressing comments #

Patch Set 12 : NOTREACHED #

Total comments: 20

Patch Set 13 : Adding more activities, addressing comments #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats (+320 lines, -1 line) Patch
A chrome/android/java/ActivityTypeIds.template View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +11 lines, -0 lines 0 comments Download
A chrome/browser/android/activity_type_ids.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +43 lines, -0 lines 2 comments Download
A chrome/browser/android/activity_type_ids.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +20 lines, -0 lines 2 comments Download
M chrome/browser/metrics/metrics_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +20 lines, -1 line 0 comments Download
M chrome/browser/metrics/metrics_service.cc View 1 2 3 4 5 6 7 4 chunks +15 lines, -0 lines 0 comments Download
A chrome/browser/metrics/metrics_service_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +144 lines, -0 lines 8 comments Download
M chrome/chrome.gyp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +15 lines, -0 lines 0 comments Download
M chrome/common/pref_names.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/common/pref_names.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +23 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 2 chunks +22 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
gone
Sending this out for official review.
7 years ago (2013-12-09 23:39:56 UTC) #1
Yaron
https://chromiumcodereview.appspot.com/103943006/diff/60001/chrome/browser/android/activity_type_ids.h File chrome/browser/android/activity_type_ids.h (right): https://chromiumcodereview.appspot.com/103943006/diff/60001/chrome/browser/android/activity_type_ids.h#newcode17 chrome/browser/android/activity_type_ids.h:17: #endif // DEFINE_ACTIVITY_TYPE_FLAG https://chromiumcodereview.appspot.com/103943006/diff/60001/chrome/browser/android/activity_type_ids.h#newcode27 chrome/browser/android/activity_type_ids.h:27: }; // enum Ids ...
7 years ago (2013-12-10 01:48:17 UTC) #2
gone
https://chromiumcodereview.appspot.com/103943006/diff/60001/chrome/browser/android/activity_type_ids.h File chrome/browser/android/activity_type_ids.h (right): https://chromiumcodereview.appspot.com/103943006/diff/60001/chrome/browser/android/activity_type_ids.h#newcode17 chrome/browser/android/activity_type_ids.h:17: #endif On 2013/12/10 01:48:17, Yaron wrote: > // DEFINE_ACTIVITY_TYPE_FLAG ...
7 years ago (2013-12-10 01:59:38 UTC) #3
Yaron
lgtm Seems sensible to me but need a good look from the uma folk.
7 years ago (2013-12-10 02:04:17 UTC) #4
Ilya Sherman
This looks ok to me, though I'd love to see (most of) the new code ...
7 years ago (2013-12-12 08:55:14 UTC) #5
gone
On 2013/12/12 08:55:14, Ilya Sherman wrote: > This looks ok to me, though I'd love ...
7 years ago (2013-12-16 19:31:35 UTC) #6
Ilya Sherman
Thanks for moving that code out into a separate file -- I think this will ...
7 years ago (2013-12-16 23:54:59 UTC) #7
gone
https://chromiumcodereview.appspot.com/103943006/diff/120001/chrome/browser/metrics/metrics_service_android.cc File chrome/browser/metrics/metrics_service_android.cc (right): https://chromiumcodereview.appspot.com/103943006/diff/120001/chrome/browser/metrics/metrics_service_android.cc#newcode100 chrome/browser/metrics/metrics_service_android.cc:100: } On 2013/12/16 23:54:59, Ilya Sherman wrote: > This ...
7 years ago (2013-12-17 00:17:27 UTC) #8
Ilya Sherman
https://chromiumcodereview.appspot.com/103943006/diff/120001/chrome/browser/metrics/metrics_service_android.cc File chrome/browser/metrics/metrics_service_android.cc (right): https://chromiumcodereview.appspot.com/103943006/diff/120001/chrome/browser/metrics/metrics_service_android.cc#newcode100 chrome/browser/metrics/metrics_service_android.cc:100: } On 2013/12/17 00:17:28, dfalcantara wrote: > On 2013/12/16 ...
7 years ago (2013-12-17 00:32:22 UTC) #9
gone
Still looking at that CL you linked to, but can you take a look at ...
7 years ago (2013-12-17 01:34:30 UTC) #10
Ilya Sherman
https://chromiumcodereview.appspot.com/103943006/diff/160001/chrome/browser/metrics/metrics_service_android.cc File chrome/browser/metrics/metrics_service_android.cc (right): https://chromiumcodereview.appspot.com/103943006/diff/160001/chrome/browser/metrics/metrics_service_android.cc#newcode70 chrome/browser/metrics/metrics_service_android.cc:70: ActivityTypeIds::ACTIVITY_MAX_VALUE); It looks like this histogram only has two ...
7 years ago (2013-12-17 02:13:43 UTC) #11
gone
Current hook is to insert the histogram right before it gets cut, which I guess ...
7 years ago (2013-12-18 23:46:01 UTC) #12
Ilya Sherman
Alexei, please take a look at the use of RecordAndroidStabilityHistograms(). How would you recommend supporting ...
7 years ago (2013-12-19 00:36:36 UTC) #13
gone
Addressed the comments, I think, but still waiting for input on the histogram trigger. https://chromiumcodereview.appspot.com/103943006/diff/180001/chrome/browser/metrics/metrics_service_android.cc ...
7 years ago (2013-12-20 19:24:36 UTC) #14
Ilya Sherman
Remind me, why did we decide to log these as a histogram rather than as ...
7 years ago (2013-12-20 23:28:20 UTC) #15
gone
On 2013/12/20 23:28:20, Ilya Sherman (Away thru Jan 6) wrote: > Remind me, why did ...
7 years ago (2013-12-20 23:34:36 UTC) #16
Ilya Sherman
On 2013/12/20 23:34:36, dfalcantara wrote: > On 2013/12/20 23:28:20, Ilya Sherman (Away thru Jan 6) ...
7 years ago (2013-12-20 23:52:02 UTC) #17
Alexei Svitkine (slow)
https://chromiumcodereview.appspot.com/103943006/diff/260001/chrome/browser/metrics/metrics_service.cc File chrome/browser/metrics/metrics_service.cc (right): https://chromiumcodereview.appspot.com/103943006/diff/260001/chrome/browser/metrics/metrics_service.cc#newcode1292 chrome/browser/metrics/metrics_service.cc:1292: RecordAndroidStabilityHistograms(); One problem with logging these as histograms (compared ...
7 years ago (2013-12-23 16:28:00 UTC) #18
Alexei Svitkine (slow)
https://chromiumcodereview.appspot.com/103943006/diff/260001/chrome/browser/metrics/metrics_service_android.cc File chrome/browser/metrics/metrics_service_android.cc (right): https://chromiumcodereview.appspot.com/103943006/diff/260001/chrome/browser/metrics/metrics_service_android.cc#newcode126 chrome/browser/metrics/metrics_service_android.cc:126: pref->SetInteger(prefs::kStabilityLaunchedActivityFlags, launched_activities); On 2013/12/23 16:28:01, Alexei Svitkine wrote: > ...
7 years ago (2013-12-23 16:29:51 UTC) #19
gone
On 2013/12/23 16:29:51, asvitkine (OOO until Jan 6th) wrote: > https://chromiumcodereview.appspot.com/103943006/diff/260001/chrome/browser/metrics/metrics_service_android.cc > File chrome/browser/metrics/metrics_service_android.cc (right): ...
6 years, 12 months ago (2013-12-26 18:43:27 UTC) #20
gone
Changed the CL to reflect changes for the comments that could be immediately addressed and ...
6 years, 12 months ago (2013-12-28 01:33:13 UTC) #21
gone
On 2013/12/28 01:33:13, dfalcantara wrote: > Changed the CL to reflect changes for the comments ...
6 years, 11 months ago (2014-01-09 18:55:23 UTC) #22
Alexei Svitkine (slow)
I think if you're going to go with histograms, you should ensure these histograms get ...
6 years, 11 months ago (2014-01-09 20:20:11 UTC) #23
gone
On 2014/01/09 20:20:11, Alexei Svitkine wrote: > I think if you're going to go with ...
6 years, 11 months ago (2014-01-09 21:00:55 UTC) #24
Alexei Svitkine (slow)
On 2014/01/09 21:00:55, dfalcantara wrote: > On 2014/01/09 20:20:11, Alexei Svitkine wrote: > > I ...
6 years, 11 months ago (2014-01-09 21:06:28 UTC) #25
gone
Adding Kibeom to look into adding histogram support.
6 years, 11 months ago (2014-01-10 21:32:22 UTC) #26
Kibeom Kim (inactive)
6 years, 11 months ago (2014-01-16 00:18:15 UTC) #27
Continuing at https://codereview.chromium.org/137623002/

https://codereview.chromium.org/103943006/diff/400001/chrome/browser/android/...
File chrome/browser/android/activity_type_ids.cc (right):

https://codereview.chromium.org/103943006/diff/400001/chrome/browser/android/...
chrome/browser/android/activity_type_ids.cc:11: // static
On 2014/01/09 20:20:12, Alexei Svitkine wrote:
> Remove this, since this isn't a static function in a class.

Done.

https://codereview.chromium.org/103943006/diff/400001/chrome/browser/android/...
File chrome/browser/android/activity_type_ids.h (right):

https://codereview.chromium.org/103943006/diff/400001/chrome/browser/android/...
chrome/browser/android/activity_type_ids.h:9: #ifndef DEFINE_ACTIVITY_ID
On 2014/01/09 20:20:12, Alexei Svitkine wrote:
> This is a bit messy.
> 
> I suggest splitting into two files, one that just has the macros and names
(e.g.
> like net_error_list.h[1]) and another that includes it that's meant to be used
> directly by C++ code (e.g. with a header guard, the enum declaration, etc).
> 
> [1]
>
https://code.google.com/p/chromium/codesearch#chromium/src/net/base/net_error...
> 
> Then, you won't need these extra ifdefs. 

Done.

https://codereview.chromium.org/103943006/diff/400001/chrome/browser/metrics/...
File chrome/browser/metrics/metrics_service_android.cc (right):

https://codereview.chromium.org/103943006/diff/400001/chrome/browser/metrics/...
chrome/browser/metrics/metrics_service_android.cc:44: PrefService* pref =
g_browser_process->local_state();
On 2014/01/09 20:20:12, Alexei Svitkine wrote:
> Can this be passed as a param? Same for the function below.
> 
> So this file doesn't need to reach into g_browser_process.

Done.

https://codereview.chromium.org/103943006/diff/400001/chrome/browser/metrics/...
chrome/browser/metrics/metrics_service_android.cc:53: for (int activity_type =
ActivityTypeIds::ACTIVITY_NONE;
On 2014/01/09 20:20:12, Alexei Svitkine wrote:
> Nit: You use activity_type here but activity in another function. Standardize
on
> one of the two.

Done.

https://codereview.chromium.org/103943006/diff/400001/chrome/browser/metrics/...
chrome/browser/metrics/metrics_service_android.cc:112: CHECK(type <
ActivityTypeIds::ACTIVITY_MAX_VALUE);
On 2014/01/09 20:20:12, Alexei Svitkine wrote:
> I think that's why you have GetActivityType() to validate the range. Why do it
> here too? Presumably by the time its already an enum, it should be valid (vs.
> when its an int coming from the Java side).

Done.

https://codereview.chromium.org/103943006/diff/400001/chrome/browser/metrics/...
chrome/browser/metrics/metrics_service_android.cc:116: if (activity == type)
return;
On 2014/01/09 20:20:12, Alexei Svitkine wrote:
> Put return on next line.

Done.

Powered by Google App Engine
This is Rietveld 408576698