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

Unified Diff: components/ntp_snippets/content_suggestions_metrics.cc

Issue 2886723002: [Zine] Add a metric to record number of visible sections on NTP. (Closed)
Patch Set: clean rebase. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/ntp_snippets/content_suggestions_metrics.cc
diff --git a/components/ntp_snippets/content_suggestions_metrics.cc b/components/ntp_snippets/content_suggestions_metrics.cc
index c6345f2642f5bb0831781c1219f84686062edc1e..348a555694e6b0e289d46e5ad2fef5c719b6725c 100644
--- a/components/ntp_snippets/content_suggestions_metrics.cc
+++ b/components/ntp_snippets/content_suggestions_metrics.cc
@@ -25,6 +25,8 @@ const int kMaxCategories = 10;
const char kHistogramCountOnNtpOpened[] =
"NewTabPage.ContentSuggestions.CountOnNtpOpened";
+const char kHistogramSectionCountOnNtpOpened[] =
+ "NewTabPage.ContentSuggestions.SectionCountOnNtpOpened";
const char kHistogramShown[] = "NewTabPage.ContentSuggestions.Shown";
const char kHistogramShownAge[] = "NewTabPage.ContentSuggestions.ShownAge";
const char kHistogramShownScore[] =
@@ -212,7 +214,8 @@ void RecordContentSuggestionsUsage() {
} // namespace
void OnPageShown(
- const std::vector<std::pair<Category, int>>& suggestions_per_category) {
+ const std::vector<std::pair<Category, int>>& suggestions_per_category,
+ int visible_categories_count) {
int suggestions_total = 0;
for (const std::pair<Category, int>& item : suggestions_per_category) {
LogCategoryHistogramPosition(kHistogramCountOnNtpOpened, item.first,
@@ -221,6 +224,8 @@ void OnPageShown(
}
UMA_HISTOGRAM_EXACT_LINEAR(kHistogramCountOnNtpOpened, suggestions_total,
kMaxSuggestionsTotal);
+ UMA_HISTOGRAM_EXACT_LINEAR(kHistogramSectionCountOnNtpOpened,
+ visible_categories_count, kMaxCategories);
}
void OnSuggestionShown(int global_position,

Powered by Google App Engine
This is Rietveld 408576698