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

Issue 2722983006: Add UKM initial_url and session_id fields. (Closed)

Created:
3 years, 9 months ago by Bryan McQuade
Modified:
3 years, 9 months ago
Reviewers:
rkaplow
CC:
asvitkine+watch_chromium.org, chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add UKM initial_url and session_id fields. This change adds support for logging the following new fields in UKM: 1. initial_url: the initial URL of a source, in cases where the URL of a source changes 2. session_id: a counter that's incremented for each browsing session (similar to the UMA session_id field) Logging of both of these fields is gated on field trial params, and is disabled by default. We'll start logging once the server-side changes for these fields are in place. BUG=697944 Review-Url: https://codereview.chromium.org/2722983006 Cr-Commit-Position: refs/heads/master@{#454382} Committed: https://chromium.googlesource.com/chromium/src/+/7894b9acb1c4de15bf778042b826a72f3e358069

Patch Set 1 #

Patch Set 2 : rebase #

Patch Set 3 : renames #

Patch Set 4 : add tests #

Patch Set 5 : add missing dep #

Total comments: 7

Patch Set 6 : fix android build #

Patch Set 7 : address comments #

Patch Set 8 : fix android build take 2 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+205 lines, -5 lines) Patch
M components/metrics/proto/ukm/report.proto View 1 chunk +7 lines, -1 line 0 comments Download
M components/metrics/proto/ukm/source.proto View 2 chunks +6 lines, -1 line 0 comments Download
M components/ukm/BUILD.gn View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M components/ukm/test_ukm_service.cc View 1 chunk +1 line, -0 lines 0 comments Download
M components/ukm/ukm_pref_names.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/ukm/ukm_pref_names.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M components/ukm/ukm_service.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M components/ukm/ukm_service.cc View 1 2 3 4 5 6 11 chunks +35 lines, -3 lines 0 comments Download
M components/ukm/ukm_service_unittest.cc View 1 2 3 4 5 6 7 6 chunks +120 lines, -0 lines 0 comments Download
M components/ukm/ukm_source.h View 1 2 3 4 5 6 1 chunk +16 lines, -0 lines 0 comments Download
M components/ukm/ukm_source.cc View 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 37 (29 generated)
Bryan McQuade
rkaplow, PTAL, thanks!
3 years, 9 months ago (2017-03-02 18:02:05 UTC) #19
Bryan McQuade
https://codereview.chromium.org/2722983006/diff/80001/components/ukm/ukm_service_unittest.cc File components/ukm/ukm_service_unittest.cc (right): https://codereview.chromium.org/2722983006/diff/80001/components/ukm/ukm_service_unittest.cc#newcode33 components/ukm/ukm_service_unittest.cc:33: class ScopedUkmFeatureParams { just to give credit, this class ...
3 years, 9 months ago (2017-03-02 18:21:09 UTC) #22
rkaplow
lgtm https://codereview.chromium.org/2722983006/diff/80001/components/ukm/ukm_service.cc File components/ukm/ukm_service.cc (right): https://codereview.chromium.org/2722983006/diff/80001/components/ukm/ukm_service.cc#newcode98 components/ukm/ukm_service.cc:98: pref_service->SetInteger(prefs::kUkmSessionId, 0); I don't super love the setting ...
3 years, 9 months ago (2017-03-02 18:46:54 UTC) #23
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/2722983006/120001
3 years, 9 months ago (2017-03-02 19:08:16 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm64_dbg_recipe/builds/221307) linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, ...
3 years, 9 months ago (2017-03-02 19:34:07 UTC) #30
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/2722983006/140001
3 years, 9 months ago (2017-03-02 20:07:00 UTC) #33
commit-bot: I haz the power
Committed patchset #8 (id:140001) as https://chromium.googlesource.com/chromium/src/+/7894b9acb1c4de15bf778042b826a72f3e358069
3 years, 9 months ago (2017-03-02 21:32:02 UTC) #36
Bryan McQuade
3 years, 9 months ago (2017-03-02 22:18:32 UTC) #37
Message was sent while issue was closed.
Forgot to post these comments earlier. I addressed them, thanks!

https://codereview.chromium.org/2722983006/diff/80001/components/ukm/ukm_serv...
File components/ukm/ukm_service.cc (right):

https://codereview.chromium.org/2722983006/diff/80001/components/ukm/ukm_serv...
components/ukm/ukm_service.cc:98: pref_service->SetInteger(prefs::kUkmSessionId,
0);
On 2017/03/02 at 18:46:54, rkaplow (slow) wrote:
> I don't super love the setting of session inside a method called
GenerateClientId, similar later on we load 
> session_id_ = LoadSessionId(pref_service_);
> 
> within ResetClientID. It's not terrible but it's a bit hidden.
> 
> 
> 
> I wonder if it would be more straightforward to replace this with a method
called
> 
> ResetClientState, with everything the same except the return being void.
> 
> Anyways this is a bit minor. This still LG but if you agree that version would
be better I'd add a TODO

Yeah, I think it makes sense to rename to something more generic. I'll defer
that to another change since we're close to branch point, but I've added a TODO
for this.

https://codereview.chromium.org/2722983006/diff/80001/components/ukm/ukm_serv...
File components/ukm/ukm_service_unittest.cc (right):

https://codereview.chromium.org/2722983006/diff/80001/components/ukm/ukm_serv...
components/ukm/ukm_service_unittest.cc:33: class ScopedUkmFeatureParams {
On 2017/03/02 at 18:46:54, rkaplow (slow) wrote:
> On 2017/03/02 18:21:08, Bryan McQuade wrote:
> > just to give credit, this class is based on a similar class in
> >
components/subresource_filter/core/browser/subresource_filter_features_test_support.h
> 
> This isn't really UKM specific either. If this has been useful, maybe we
should move this into variations? Can you add a TODO on this and assign to me?

Sure, I added a TODO for you.

https://codereview.chromium.org/2722983006/diff/80001/components/ukm/ukm_sour...
File components/ukm/ukm_source.h (right):

https://codereview.chromium.org/2722983006/diff/80001/components/ukm/ukm_sour...
components/ukm/ukm_source.h:31: void UpdateUrl(const GURL& url);
On 2017/03/02 at 18:46:54, rkaplow (slow) wrote:
> can you comment on this (with some init url details)

Done

Powered by Google App Engine
This is Rietveld 408576698