|
|
Chromium Code Reviews
Description[NTP::SectionOrder] Track category index after it has been moved up.
Add a new metric to track category index after it has been moved up due
to a click. This is done in order to check how stable to order is and
whether it is becoming more stable.
BUG=687505
Review-Url: https://codereview.chromium.org/2668063004
Cr-Commit-Position: refs/heads/master@{#447968}
Committed: https://chromium.googlesource.com/chromium/src/+/7496904fab33e2c38f8c6ec6cfad27ebd158c1f4
Patch Set 1 #
Total comments: 9
Patch Set 2 : clean rebase. #Patch Set 3 : added tests. #
Total comments: 6
Patch Set 4 : treib@ comments. #
Total comments: 2
Patch Set 5 : clean rebase. #Patch Set 6 : tschumann@ comment. #
Messages
Total messages: 36 (20 generated)
vitaliii@chromium.org changed reviewers: + tschumann@chromium.org
Would you like to have a look?
vitaliii@chromium.org changed reviewers: + treib@chromium.org
Hi treib@, Would you mind to review a new metric?
https://codereview.chromium.org/2668063004/diff/1/components/ntp_snippets/con... File components/ntp_snippets/content_suggestions_metrics.cc (right): https://codereview.chromium.org/2668063004/diff/1/components/ntp_snippets/con... components/ntp_snippets/content_suggestions_metrics.cc:59: "NewTabPage.ContentSuggestions.MovedUpCategoryNewIndex"; ".CategoryMovedUpNewIndex"? https://codereview.chromium.org/2668063004/diff/1/components/ntp_snippets/con... components/ntp_snippets/content_suggestions_metrics.cc:337: kMaxCategories); Hm. I guess you'd mostly look at the number of samples in the histogram over a given period of time? Or do you see any use for the actual index values? I'm also a bit worried that this will be hard to interpret: You'd have to "normalize" over number of users of course, but also over total usage - if there are more clicks overall, then there's probably also be more movement in the categories. Or whenever we add a new category, there'll be more movement... But I also can't immediately think of a better way to track this. Any ideas?
Hi treib@, I replied to your comments, PTAL. https://codereview.chromium.org/2668063004/diff/1/components/ntp_snippets/con... File components/ntp_snippets/content_suggestions_metrics.cc (right): https://codereview.chromium.org/2668063004/diff/1/components/ntp_snippets/con... components/ntp_snippets/content_suggestions_metrics.cc:59: "NewTabPage.ContentSuggestions.MovedUpCategoryNewIndex"; On 2017/02/01 13:04:23, Marc Treib wrote: > ".CategoryMovedUpNewIndex"? I like previous one more. Which category? Moved up. The new one feels like an action, "category moved up". Also old one seems more consistent with "OpenedCategoryIndex". Do you feel other way? https://codereview.chromium.org/2668063004/diff/1/components/ntp_snippets/con... components/ntp_snippets/content_suggestions_metrics.cc:337: kMaxCategories); On 2017/02/01 13:04:23, Marc Treib wrote: > Hm. I guess you'd mostly look at the number of samples in the histogram over a > given period of time? Or do you see any use for the actual index values? Partially true. We are worried that top most categories will wiggle around. Thus, we could use data for the first 3 positions and ignore lower positions. > I'm also a bit worried that this will be hard to interpret: You'd have to > "normalize" over number of users of course, but also over total usage - if there > are more clicks overall, then there's probably also be more movement in the > categories. Or whenever we add a new category, there'll be more movement... Number of users - probably, number of clicks - likely not. The order should become more stable with time, so number of clicks should not matter. Ideally new users will introduce some values here, but only before their order settles down. If this highly depends on clicks, we set the thresholds too low. > > But I also can't immediately think of a better way to track this. Any ideas? tschumann@ and I cannot find a better way as well, but this seemed good enough to see how stable the order becomes with time.
lgtm https://codereview.chromium.org/2668063004/diff/1/components/ntp_snippets/con... File components/ntp_snippets/content_suggestions_metrics.cc (right): https://codereview.chromium.org/2668063004/diff/1/components/ntp_snippets/con... components/ntp_snippets/content_suggestions_metrics.cc:59: "NewTabPage.ContentSuggestions.MovedUpCategoryNewIndex"; On 2017/02/01 13:30:18, vitaliii wrote: > On 2017/02/01 13:04:23, Marc Treib wrote: > > ".CategoryMovedUpNewIndex"? > > I like previous one more. > > Which category? Moved up. > > The new one feels like an action, "category moved up". > > Also old one seems more consistent with "OpenedCategoryIndex". > > Do you feel other way? Ah, I wasn't aware of OpenedCategoryIndex. I guess I'd have preferred CategoryOpenedIndex there as well (or actually just CategoryOpened; the "Index" is specified by the "units" field in the .xml), so that all the category-related things start with "Category". But since it's too late for that, I guess it doesn't matter anymore. https://codereview.chromium.org/2668063004/diff/1/components/ntp_snippets/con... components/ntp_snippets/content_suggestions_metrics.cc:337: kMaxCategories); On 2017/02/01 13:30:18, vitaliii wrote: > On 2017/02/01 13:04:23, Marc Treib wrote: > > Hm. I guess you'd mostly look at the number of samples in the histogram over a > > given period of time? Or do you see any use for the actual index values? > > Partially true. We are worried that top most categories will wiggle around. > Thus, we could use data for the first 3 positions and ignore lower positions. > > > I'm also a bit worried that this will be hard to interpret: You'd have to > > "normalize" over number of users of course, but also over total usage - if > there > > are more clicks overall, then there's probably also be more movement in the > > categories. Or whenever we add a new category, there'll be more movement... > > Number of users - probably, number of clicks - likely not. The order should > become more stable with time, so number of clicks should not matter. Ideally new > users will introduce some values here, but only before their order settles down. > If this highly depends on clicks, we set the thresholds too low. > > > > > But I also can't immediately think of a better way to track this. Any ideas? > > tschumann@ and I cannot find a better way as well, but this seemed good enough > to see how stable the order becomes with time. Alright, fair enough.
https://codereview.chromium.org/2668063004/diff/1/components/ntp_snippets/con... File components/ntp_snippets/content_suggestions_metrics.cc (right): https://codereview.chromium.org/2668063004/diff/1/components/ntp_snippets/con... components/ntp_snippets/content_suggestions_metrics.cc:337: kMaxCategories); On 2017/02/01 13:40:46, Marc Treib wrote: > On 2017/02/01 13:30:18, vitaliii wrote: > > On 2017/02/01 13:04:23, Marc Treib wrote: > > > Hm. I guess you'd mostly look at the number of samples in the histogram over > a > > > given period of time? Or do you see any use for the actual index values? > > > > Partially true. We are worried that top most categories will wiggle around. > > Thus, we could use data for the first 3 positions and ignore lower positions. > > > > > I'm also a bit worried that this will be hard to interpret: You'd have to > > > "normalize" over number of users of course, but also over total usage - if > > there > > > are more clicks overall, then there's probably also be more movement in the > > > categories. Or whenever we add a new category, there'll be more movement... > > > > Number of users - probably, number of clicks - likely not. The order should > > become more stable with time, so number of clicks should not matter. Ideally > new > > users will introduce some values here, but only before their order settles > down. > > If this highly depends on clicks, we set the thresholds too low. > > > > > > > > But I also can't immediately think of a better way to track this. Any ideas? > > > > tschumann@ and I cannot find a better way as well, but this seemed good enough > > to see how stable the order becomes with time. > > Alright, fair enough. (About tracking only the top 3 or something: No, if we do care about the index (at least in some cases), then let's just track the index.)
The CQ bit was checked by vitaliii@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Hi treib@, I addressed your comments, no need to look. https://codereview.chromium.org/2668063004/diff/1/components/ntp_snippets/con... File components/ntp_snippets/content_suggestions_metrics.cc (right): https://codereview.chromium.org/2668063004/diff/1/components/ntp_snippets/con... components/ntp_snippets/content_suggestions_metrics.cc:59: "NewTabPage.ContentSuggestions.MovedUpCategoryNewIndex"; On 2017/02/01 13:40:46, Marc Treib wrote: > On 2017/02/01 13:30:18, vitaliii wrote: > > On 2017/02/01 13:04:23, Marc Treib wrote: > > > ".CategoryMovedUpNewIndex"? > > > > I like previous one more. > > > > Which category? Moved up. > > > > The new one feels like an action, "category moved up". > > > > Also old one seems more consistent with "OpenedCategoryIndex". > > > > Do you feel other way? > > Ah, I wasn't aware of OpenedCategoryIndex. I guess I'd have preferred > CategoryOpenedIndex there as well (or actually just CategoryOpened; the "Index" > is specified by the "units" field in the .xml), so that all the category-related > things start with "Category". But since it's too late for that, I guess it > doesn't matter anymore. Acknowledged. https://codereview.chromium.org/2668063004/diff/1/components/ntp_snippets/con... components/ntp_snippets/content_suggestions_metrics.cc:337: kMaxCategories); On 2017/02/01 13:42:37, Marc Treib wrote: > On 2017/02/01 13:40:46, Marc Treib wrote: > > On 2017/02/01 13:30:18, vitaliii wrote: > > > On 2017/02/01 13:04:23, Marc Treib wrote: > > > > Hm. I guess you'd mostly look at the number of samples in the histogram > over > > a > > > > given period of time? Or do you see any use for the actual index values? > > > > > > Partially true. We are worried that top most categories will wiggle around. > > > Thus, we could use data for the first 3 positions and ignore lower > positions. > > > > > > > I'm also a bit worried that this will be hard to interpret: You'd have to > > > > "normalize" over number of users of course, but also over total usage - if > > > there > > > > are more clicks overall, then there's probably also be more movement in > the > > > > categories. Or whenever we add a new category, there'll be more > movement... > > > > > > Number of users - probably, number of clicks - likely not. The order should > > > become more stable with time, so number of clicks should not matter. Ideally > > new > > > users will introduce some values here, but only before their order settles > > down. > > > If this highly depends on clicks, we set the thresholds too low. > > > > > > > > > > > But I also can't immediately think of a better way to track this. Any > ideas? > > > > > > tschumann@ and I cannot find a better way as well, but this seemed good > enough > > > to see how stable the order becomes with time. > > > > Alright, fair enough. > > (About tracking only the top 3 or something: No, if we do care about the index > (at least in some cases), then let's just track the index.) Acknowledged. The mention of top 3 was to explain why we need indices.
vitaliii@chromium.org changed reviewers: + asvitkine@chromium.org
Hi asvitkine@, Could you have a look at my histograms.xml change? I am adding a new metric.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm
Patchset #3 (id:40001) has been deleted
The CQ bit was checked by vitaliii@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Hi treib@, could you have another look? I have added tests.
lgtm Nice! Some small suggestions below. https://codereview.chromium.org/2668063004/diff/60001/components/ntp_snippets... File components/ntp_snippets/category_rankers/click_based_category_ranker_unittest.cc (right): https://codereview.chromium.org/2668063004/diff/60001/components/ntp_snippets... components/ntp_snippets/category_rankers/click_based_category_ranker_unittest.cc:695: EXPECT_THAT(histogram_tester.GetAllSamples(kHistogramMovedUpCategoryNewIndex), nit: ASSERT_THAT since this is a precondition (right?) https://codereview.chromium.org/2668063004/diff/60001/components/ntp_snippets... components/ntp_snippets/category_rankers/click_based_category_ranker_unittest.cc:718: ranker()->ClearHistory(/*begin=*/base::Time(), This should reset the category order, right? Maybe ASSERT that? (IMO that'd make the test a bit easier to read, since it's not immediately clear what clearing history would have to do with anything.) https://codereview.chromium.org/2668063004/diff/60001/components/ntp_snippets... components/ntp_snippets/category_rankers/click_based_category_ranker_unittest.cc:736: EXPECT_THAT(histogram_tester.GetAllSamples(kHistogramMovedUpCategoryNewIndex), Also here: ASSERT_THAT?
Hi treib@, I addressed your comments, no need to look. https://codereview.chromium.org/2668063004/diff/60001/components/ntp_snippets... File components/ntp_snippets/category_rankers/click_based_category_ranker_unittest.cc (right): https://codereview.chromium.org/2668063004/diff/60001/components/ntp_snippets... components/ntp_snippets/category_rankers/click_based_category_ranker_unittest.cc:695: EXPECT_THAT(histogram_tester.GetAllSamples(kHistogramMovedUpCategoryNewIndex), On 2017/02/02 11:04:15, Marc Treib wrote: > nit: ASSERT_THAT since this is a precondition (right?) Done. https://codereview.chromium.org/2668063004/diff/60001/components/ntp_snippets... components/ntp_snippets/category_rankers/click_based_category_ranker_unittest.cc:718: ranker()->ClearHistory(/*begin=*/base::Time(), On 2017/02/02 11:04:15, Marc Treib wrote: > This should reset the category order, right? Maybe ASSERT that? (IMO that'd make > the test a bit easier to read, since it's not immediately clear what clearing > history would have to do with anything.) Done. Right, I added ASSERTs for the order. https://codereview.chromium.org/2668063004/diff/60001/components/ntp_snippets... components/ntp_snippets/category_rankers/click_based_category_ranker_unittest.cc:736: EXPECT_THAT(histogram_tester.GetAllSamples(kHistogramMovedUpCategoryNewIndex), On 2017/02/02 11:04:15, Marc Treib wrote: > Also here: ASSERT_THAT? Done.
The CQ bit was checked by vitaliii@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
lgtm https://codereview.chromium.org/2668063004/diff/80001/components/ntp_snippets... File components/ntp_snippets/category_rankers/click_based_category_ranker_unittest.cc (right): https://codereview.chromium.org/2668063004/diff/80001/components/ntp_snippets... components/ntp_snippets/category_rankers/click_based_category_ranker_unittest.cc:675: while (CompareCategories(first, second)) { i had a hard time understanding the loop. The biggest issue was NotifySuggestionOpened(). why not write ranker()->OnSuggestionOpened(second); which is much easier to read? Maybe also extend the comment to: // Increase score of |second| until the order changes. same in line 715. That's a nice example how convenience methods can make the test harder to read.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Patchset #6 (id:120001) has been deleted
Patchset #6 (id:140001) has been deleted
Hi tschumann@, I addressed your comment, no need to look. https://codereview.chromium.org/2668063004/diff/80001/components/ntp_snippets... File components/ntp_snippets/category_rankers/click_based_category_ranker_unittest.cc (right): https://codereview.chromium.org/2668063004/diff/80001/components/ntp_snippets... components/ntp_snippets/category_rankers/click_based_category_ranker_unittest.cc:675: while (CompareCategories(first, second)) { On 2017/02/02 11:45:09, tschumann wrote: > i had a hard time understanding the loop. > The biggest issue was NotifySuggestionOpened(). > why not write > ranker()->OnSuggestionOpened(second); > > which is much easier to read? > > Maybe also extend the comment to: > // Increase score of |second| until the order changes. > > same in line 715. > > That's a nice example how convenience methods can make the test harder to read. Done. I replaced NotifySuggestionOpened(/*times=*/1, category) with ranker()->OnSuggestionOpened(category) in tests where all instances have |times = 1|. In my view for the case |times > 1| this helper shortens the code and makes it easier to read.
The CQ bit was checked by vitaliii@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from asvitkine@chromium.org, treib@chromium.org, tschumann@chromium.org Link to the patchset: https://codereview.chromium.org/2668063004/#ps160001 (title: "tschumann@ comment.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 160001, "attempt_start_ts": 1486109521567520,
"parent_rev": "ca0b0f3cb32cc26808f0979e8a9a0082740c5eac", "commit_rev":
"7496904fab33e2c38f8c6ec6cfad27ebd158c1f4"}
Message was sent while issue was closed.
Description was changed from ========== [NTP::SectionOrder] Track category index after it has been moved up. Add a new metric to track category index after it has been moved up due to a click. This is done in order to check how stable to order is and whether it is becoming more stable. BUG=687505 ========== to ========== [NTP::SectionOrder] Track category index after it has been moved up. Add a new metric to track category index after it has been moved up due to a click. This is done in order to check how stable to order is and whether it is becoming more stable. BUG=687505 Review-Url: https://codereview.chromium.org/2668063004 Cr-Commit-Position: refs/heads/master@{#447968} Committed: https://chromium.googlesource.com/chromium/src/+/7496904fab33e2c38f8c6ec6cfad... ==========
Message was sent while issue was closed.
Committed patchset #6 (id:160001) as https://chromium.googlesource.com/chromium/src/+/7496904fab33e2c38f8c6ec6cfad... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
