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

Unified Diff: components/ntp_snippets/remote/ntp_snippets_fetcher.cc

Issue 2419013003: [NTP Snippets] Report the share of the UI lang vs. the top non-UI lang (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/remote/ntp_snippets_fetcher.cc
diff --git a/components/ntp_snippets/remote/ntp_snippets_fetcher.cc b/components/ntp_snippets/remote/ntp_snippets_fetcher.cc
index 8e577878ffa620df986580aaed386f777fdc85f4..4055ffcd2756512def0c1bab6f066e31733d804b 100644
--- a/components/ntp_snippets/remote/ntp_snippets_fetcher.cc
+++ b/components/ntp_snippets/remote/ntp_snippets_fetcher.cc
@@ -545,6 +545,15 @@ void NTPSnippetsFetcher::SetUpCommonFetchingParameters(
for (const LanguageModel::LanguageInfo& info : top_languages) {
if (info.language_code != params->ui_language.language_code) {
params->other_top_language = info;
+
+ // Report to UMA how important the UI language is.
+ DCHECK(params->other_top_language.frequency > 0)
Marc Treib 2016/10/14 15:32:56 DCHECK_GT
jkrcal 2016/10/14 16:34:15 Done.
+ << "GetTopLanguages() should not return languages with 0 frequency";
+ float ratio_ui_to_other_top_language =
+ params->ui_language.frequency / params->other_top_language.frequency;
Marc Treib 2016/10/14 15:32:56 Should this be "ui_freq / (ui_freq + other_freq)"
jkrcal 2016/10/14 16:34:15 Well, I meant it as it was. Your suggestion actual
+ UMA_HISTOGRAM_COUNTS_1000(
Alexei Svitkine (slow) 2016/10/14 15:30:15 I think you probably want to use UMA_HISTOGRAM_PER
jkrcal 2016/10/14 16:34:15 This is what I wanted because the result was not s
+ "NewTabPage.Languages.UILanguageToOtherTopLanguageRatio",
+ ratio_ui_to_other_top_language * 100);
break;
}
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698