Chromium Code Reviews| 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; |
| } |
| } |