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

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: Pretty-print histograms.xml 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..526960cb95d2be43805c4177bd10f6ee7f9447d0 100644
--- a/components/ntp_snippets/remote/ntp_snippets_fetcher.cc
+++ b/components/ntp_snippets/remote/ntp_snippets_fetcher.cc
@@ -545,6 +545,16 @@ 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_GT(params->other_top_language.frequency, 0)
+ << "GetTopLanguages() should not return languages with 0 frequency";
+ float ratio_ui_in_both_languages = params->ui_language.frequency /
+ (params->ui_language.frequency +
+ params->other_top_language.frequency);
+ UMA_HISTOGRAM_PERCENTAGE(
+ "NewTabPage.Languages.UILanguageRatioInTwoTopLanguages",
+ ratio_ui_in_both_languages * 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