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

Issue 2567263003: Basic UkmService implementation (Closed)

Created:
4 years ago by Steven Holte
Modified:
3 years, 10 months ago
CC:
chromium-reviews, blundell+watchlist_chromium.org, sdefresne+watchlist_chromium.org, droger+watchlist_chromium.org, asvitkine+watch_chromium.org, Zhen Wang
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Basic UkmService implementation A basic Url-Keyed Metrics (UKM) service behind a flag. This implementation will send messages to the UKM server which only contain UKM client ids. Other contents are left for a later CL. This version includes a manual copy of the protobuf specs, adapted for the chromium tree, which we'll want to replace with some more automated sync later. BUG=673020 Review-Url: https://codereview.chromium.org/2567263003 Cr-Commit-Position: refs/heads/master@{#445535} Committed: https://chromium.googlesource.com/chromium/src/+/7b74c62cf72ddd74d30777d71898556c8a0eb499

Patch Set 1 #

Patch Set 2 : Start/Stop #

Patch Set 3 : Feature #

Patch Set 4 : Proto and client_id #

Total comments: 57

Patch Set 5 : Updated #

Total comments: 6

Patch Set 6 : Clang-format #

Total comments: 6

Patch Set 7 : Rebase #

Patch Set 8 : RegisterPrefs #

Total comments: 22

Patch Set 9 : Minor changes #

Total comments: 4

Patch Set 10 : Fix Errors #

Patch Set 11 : Fix small bugs #

Total comments: 10

Patch Set 12 : constexpr and default functions #

Patch Set 13 : Purge on HistoryDelete #

Patch Set 14 : Clear Browsing Data handling and tests #

Patch Set 15 : ios Clear Browsing Data #

Patch Set 16 : ios includes and typos #

Patch Set 17 : Rebase #

Patch Set 18 : Deps #

Patch Set 19 : More deps #

Patch Set 20 : ios fix #

Patch Set 21 : More deps #

Patch Set 22 : RemoveObservers #

Patch Set 23 : Observe helper #

Total comments: 4

Patch Set 24 : Check OFFICIAL_BUILD #

Total comments: 4

Patch Set 25 : ScopedObserver #

Patch Set 26 : Rebase #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+1095 lines, -10 lines) Patch
M chrome/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/metrics/chrome_metrics_service_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 7 chunks +16 lines, -4 lines 0 comments Download
M chrome/browser/metrics/chrome_metrics_service_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 11 chunks +37 lines, -0 lines 0 comments Download
M components/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M components/metrics/metrics_service_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +7 lines, -0 lines 0 comments Download
M components/metrics/metrics_service_client.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M components/metrics/persisted_logs.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -0 lines 0 comments Download
M components/metrics/persisted_logs.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +8 lines, -0 lines 0 comments Download
M components/metrics/persisted_logs_metrics.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M components/metrics/persisted_logs_metrics_impl.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M components/metrics/proto/BUILD.gn View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
A components/metrics/proto/ukm/report.proto View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +26 lines, -0 lines 0 comments Download
A components/metrics/proto/ukm/source.proto View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +29 lines, -0 lines 0 comments Download
M components/metrics/test_metrics_service_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +24 lines, -1 line 0 comments Download
M components/metrics_services_manager/BUILD.gn View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M components/metrics_services_manager/DEPS View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M components/metrics_services_manager/metrics_services_manager.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M components/metrics_services_manager/metrics_services_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 4 chunks +17 lines, -2 lines 0 comments Download
A components/ukm/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +71 lines, -0 lines 0 comments Download
A components/ukm/DEPS View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
A components/ukm/OWNERS View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
A components/ukm/metrics_reporting_scheduler.h View 1 2 3 1 chunk +37 lines, -0 lines 0 comments Download
A components/ukm/metrics_reporting_scheduler.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +31 lines, -0 lines 0 comments Download
A components/ukm/observers/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +3 lines, -0 lines 0 comments Download
A components/ukm/observers/history_delete_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +47 lines, -0 lines 0 comments Download
A components/ukm/observers/history_delete_observer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +37 lines, -0 lines 0 comments Download
A components/ukm/persisted_logs_metrics_impl.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +33 lines, -0 lines 0 comments Download
A components/ukm/persisted_logs_metrics_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +38 lines, -0 lines 0 comments Download
A components/ukm/ukm_pref_names.h View 1 chunk +19 lines, -0 lines 0 comments Download
A components/ukm/ukm_pref_names.cc View 1 2 3 4 5 6 7 8 1 chunk +17 lines, -0 lines 0 comments Download
A components/ukm/ukm_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +116 lines, -0 lines 0 comments Download
A components/ukm/ukm_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +250 lines, -0 lines 1 comment Download
A components/ukm/ukm_service_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +76 lines, -0 lines 0 comments Download
M ios/chrome/browser/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download
M ios/chrome/browser/metrics/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +4 lines, -0 lines 0 comments Download
M ios/chrome/browser/metrics/ios_chrome_metrics_service_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 7 chunks +21 lines, -0 lines 0 comments Download
M ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 6 chunks +36 lines, -1 line 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +63 lines, -0 lines 0 comments Download

Messages

Total messages: 55 (29 generated)
rkaplow
https://codereview.chromium.org/2567263003/diff/60001/components/metrics/metrics_service_client.h File components/metrics/metrics_service_client.h (right): https://codereview.chromium.org/2567263003/diff/60001/components/metrics/metrics_service_client.h#newcode23 components/metrics/metrics_service_client.h:23: namespace ukm { nit, alpha https://codereview.chromium.org/2567263003/diff/60001/components/metrics/persisted_logs.cc File components/metrics/persisted_logs.cc (right): ...
3 years, 11 months ago (2017-01-02 23:23:04 UTC) #4
Steven Holte
https://codereview.chromium.org/2567263003/diff/60001/components/metrics/metrics_service_client.h File components/metrics/metrics_service_client.h (right): https://codereview.chromium.org/2567263003/diff/60001/components/metrics/metrics_service_client.h#newcode23 components/metrics/metrics_service_client.h:23: namespace ukm { On 2017/01/02 23:23:03, rkaplow wrote: > ...
3 years, 11 months ago (2017-01-03 21:16:04 UTC) #5
rkaplow
lgtm lgtm but probably should have alexei review https://codereview.chromium.org/2567263003/diff/60001/components/metrics/metrics_service_client.h File components/metrics/metrics_service_client.h (right): https://codereview.chromium.org/2567263003/diff/60001/components/metrics/metrics_service_client.h#newcode23 components/metrics/metrics_service_client.h:23: namespace ...
3 years, 11 months ago (2017-01-04 17:57:57 UTC) #6
Steven Holte
+asvitkine Will rebase after these CLs land: https://codereview.chromium.org/2610653003/ https://codereview.chromium.org/2614533002/ https://codereview.chromium.org/2567263003/diff/80001/components/ukm/ukm_service.cc File components/ukm/ukm_service.cc (right): https://codereview.chromium.org/2567263003/diff/80001/components/ukm/ukm_service.cc#newcode107 components/ukm/ukm_service.cc:107: ...
3 years, 11 months ago (2017-01-04 22:47:55 UTC) #8
Alexei Svitkine (slow)
https://codereview.chromium.org/2567263003/diff/100001/chrome/browser/metrics/chrome_metrics_service_client.cc File chrome/browser/metrics/chrome_metrics_service_client.cc (right): https://codereview.chromium.org/2567263003/diff/100001/chrome/browser/metrics/chrome_metrics_service_client.cc#newcode568 chrome/browser/metrics/chrome_metrics_service_client.cc:568: ukm_service_.reset( Should we gate this on a base::Feature? https://codereview.chromium.org/2567263003/diff/100001/chrome/browser/metrics/chrome_metrics_service_client.cc#newcode569 ...
3 years, 11 months ago (2017-01-06 16:34:32 UTC) #10
Steven Holte
https://codereview.chromium.org/2567263003/diff/100001/chrome/browser/metrics/chrome_metrics_service_client.cc File chrome/browser/metrics/chrome_metrics_service_client.cc (right): https://codereview.chromium.org/2567263003/diff/100001/chrome/browser/metrics/chrome_metrics_service_client.cc#newcode568 chrome/browser/metrics/chrome_metrics_service_client.cc:568: ukm_service_.reset( On 2017/01/06 16:34:32, Alexei Svitkine (slow) wrote: > ...
3 years, 11 months ago (2017-01-06 20:21:26 UTC) #11
Alexei Svitkine (slow)
https://codereview.chromium.org/2567263003/diff/140001/components/metrics/metrics_service_client.cc File components/metrics/metrics_service_client.cc (right): https://codereview.chromium.org/2567263003/diff/140001/components/metrics/metrics_service_client.cc#newcode12 components/metrics/metrics_service_client.cc:12: return NULL; nullptr https://codereview.chromium.org/2567263003/diff/140001/components/metrics_services_manager/metrics_services_manager.cc File components/metrics_services_manager/metrics_services_manager.cc (right): https://codereview.chromium.org/2567263003/diff/140001/components/metrics_services_manager/metrics_services_manager.cc#newcode106 components/metrics_services_manager/metrics_services_manager.cc:106: ...
3 years, 11 months ago (2017-01-10 17:37:19 UTC) #12
Steven Holte
https://codereview.chromium.org/2567263003/diff/140001/components/metrics/metrics_service_client.cc File components/metrics/metrics_service_client.cc (right): https://codereview.chromium.org/2567263003/diff/140001/components/metrics/metrics_service_client.cc#newcode12 components/metrics/metrics_service_client.cc:12: return NULL; On 2017/01/10 17:37:19, Alexei Svitkine (slow) wrote: ...
3 years, 11 months ago (2017-01-10 22:52:45 UTC) #13
rkaplow
lgtm https://codereview.chromium.org/2567263003/diff/160001/chrome/browser/metrics/chrome_metrics_service_client.cc File chrome/browser/metrics/chrome_metrics_service_client.cc (right): https://codereview.chromium.org/2567263003/diff/160001/chrome/browser/metrics/chrome_metrics_service_client.cc#newcode569 chrome/browser/metrics/chrome_metrics_service_client.cc:569: if (base::FeatureList::IsEnabled(kUkmFeature)) should be ukm::kUkmFeature
3 years, 11 months ago (2017-01-11 22:05:13 UTC) #14
Alexei Svitkine (slow)
lgtm
3 years, 11 months ago (2017-01-11 22:12:17 UTC) #15
Steven Holte
+battre for components/prefs DEP and protos +olivierrobin for ios/chrome/browser/metrics https://codereview.chromium.org/2567263003/diff/160001/chrome/browser/metrics/chrome_metrics_service_client.cc File chrome/browser/metrics/chrome_metrics_service_client.cc (right): https://codereview.chromium.org/2567263003/diff/160001/chrome/browser/metrics/chrome_metrics_service_client.cc#newcode569 chrome/browser/metrics/chrome_metrics_service_client.cc:569: ...
3 years, 11 months ago (2017-01-11 22:52:03 UTC) #17
rkaplow
https://codereview.chromium.org/2567263003/diff/160001/components/ukm/ukm_service.cc File components/ukm/ukm_service.cc (right): https://codereview.chromium.org/2567263003/diff/160001/components/ukm/ukm_service.cc#newcode136 components/ukm/ukm_service.cc:136: registry->RegisterIntegerPref(prefs::kUkmClientId, 0); ah, found another bug while testing locally. ...
3 years, 11 months ago (2017-01-11 23:03:54 UTC) #18
Steven Holte
https://codereview.chromium.org/2567263003/diff/160001/components/ukm/ukm_service.cc File components/ukm/ukm_service.cc (right): https://codereview.chromium.org/2567263003/diff/160001/components/ukm/ukm_service.cc#newcode136 components/ukm/ukm_service.cc:136: registry->RegisterIntegerPref(prefs::kUkmClientId, 0); On 2017/01/11 23:03:53, rkaplow wrote: > ah, ...
3 years, 11 months ago (2017-01-11 23:50:40 UTC) #19
battre
https://codereview.chromium.org/2567263003/diff/200001/components/metrics/proto/ukm/source.proto File components/metrics/proto/ukm/source.proto (right): https://codereview.chromium.org/2567263003/diff/200001/components/metrics/proto/ukm/source.proto#newcode18 components/metrics/proto/ukm/source.proto:18: // appear in FirstTimes, it should be stripped before ...
3 years, 11 months ago (2017-01-12 08:12:56 UTC) #20
Olivier
ios lgtm
3 years, 11 months ago (2017-01-13 13:04:57 UTC) #21
Steven Holte
https://codereview.chromium.org/2567263003/diff/200001/components/metrics/proto/ukm/source.proto File components/metrics/proto/ukm/source.proto (right): https://codereview.chromium.org/2567263003/diff/200001/components/metrics/proto/ukm/source.proto#newcode18 components/metrics/proto/ukm/source.proto:18: // appear in FirstTimes, it should be stripped before ...
3 years, 11 months ago (2017-01-13 23:15:26 UTC) #22
Steven Holte
Added some code to observe history deletions on ios as well, but not sure how/if ...
3 years, 11 months ago (2017-01-14 00:01:37 UTC) #23
Steven Holte
battre@ PTAL
3 years, 11 months ago (2017-01-19 20:08:26 UTC) #34
battre
LGTM with comments. Can you please make sure that somewhere in the repository we explain ...
3 years, 11 months ago (2017-01-20 07:42:30 UTC) #41
Steven Holte
+sdefresne for the dependency on components/history/core/browser from components/ukm/observers https://codereview.chromium.org/2567263003/diff/440001/components/metrics_services_manager/metrics_services_manager.cc File components/metrics_services_manager/metrics_services_manager.cc (right): https://codereview.chromium.org/2567263003/diff/440001/components/metrics_services_manager/metrics_services_manager.cc#newcode108 components/metrics_services_manager/metrics_services_manager.cc:108: // ...
3 years, 11 months ago (2017-01-20 20:07:39 UTC) #44
sdefresne
DEPS on components/history/core/browser lgtm Some other comments on the rest of the code though. https://codereview.chromium.org/2567263003/diff/460001/components/ukm/observers/history_delete_observer.h ...
3 years, 11 months ago (2017-01-23 09:53:05 UTC) #45
Steven Holte
https://codereview.chromium.org/2567263003/diff/460001/components/ukm/observers/history_delete_observer.h File components/ukm/observers/history_delete_observer.h (right): https://codereview.chromium.org/2567263003/diff/460001/components/ukm/observers/history_delete_observer.h#newcode38 components/ukm/observers/history_delete_observer.h:38: std::set<history::HistoryService*> observed_history_services_; On 2017/01/23 09:53:04, sdefresne wrote: > I ...
3 years, 11 months ago (2017-01-23 20:37:30 UTC) #46
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/2567263003/500001
3 years, 11 months ago (2017-01-23 20:40:27 UTC) #49
commit-bot: I haz the power
Committed patchset #26 (id:500001) as https://chromium.googlesource.com/chromium/src/+/7b74c62cf72ddd74d30777d71898556c8a0eb499
3 years, 11 months ago (2017-01-23 23:13:48 UTC) #52
Nico
https://codereview.chromium.org/2567263003/diff/500001/components/ukm/ukm_service.cc File components/ukm/ukm_service.cc (right): https://codereview.chromium.org/2567263003/diff/500001/components/ukm/ukm_service.cc#newcode130 components/ukm/ukm_service.cc:130: CHECK(false); // Remove this once UKM checks sync state. ...
3 years, 10 months ago (2017-01-25 01:05:43 UTC) #54
Steven Holte
3 years, 10 months ago (2017-01-25 01:29:31 UTC) #55
Message was sent while issue was closed.
On 2017/01/25 01:05:43, Nico wrote:
>
https://codereview.chromium.org/2567263003/diff/500001/components/ukm/ukm_ser...
> File components/ukm/ukm_service.cc (right):
> 
>
https://codereview.chromium.org/2567263003/diff/500001/components/ukm/ukm_ser...
> components/ukm/ukm_service.cc:130: CHECK(false);  // Remove this once UKM
checks
> sync state.
> This means that the tests this added fail on bots that do official builds,
e.g.
> here:
> 
>
https://build.chromium.org/p/chromium.fyi/builders/CrWinClang%20tester/builds...
> 
> Please make it so that this code doesn't break tests in official builds.

Doh.  Sent you https://codereview.chromium.org/2652013004/ to remove the check.

Powered by Google App Engine
This is Rietveld 408576698