Commit 9bd1cfdb authored by Mehran Mahmoudi's avatar Mehran Mahmoudi Committed by Commit Bot

[TTS] Add UMA metric for translation condition

Adds a new UMA metric to track whether or not translation conditions are
met for each search term.

Bug: 
Change-Id: Ib240408c8df1862f55f592f5413599a730209fd1
Reviewed-on: https://chromium-review.googlesource.com/679447
Commit-Queue: Mehran Mahmoudi <mahmoudi@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Reviewed-by: default avatarDonn Denman <donnd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504248}
parent fb921410
...@@ -56,6 +56,9 @@ public class ContextualSearchTranslateController { ...@@ -56,6 +56,9 @@ public class ContextualSearchTranslateController {
// Log that conditions were right for translation, even though it may be disabled // Log that conditions were right for translation, even though it may be disabled
// for an experiment so we can compare with the counter factual data. // for an experiment so we can compare with the counter factual data.
ContextualSearchUma.logTranslateOnebox(doForceTranslate); ContextualSearchUma.logTranslateOnebox(doForceTranslate);
// Log whether or not translate conditions are met
ContextualSearchUma.logTranslateCondition(doForceTranslate);
} }
/** /**
......
...@@ -1216,6 +1216,15 @@ public class ContextualSearchUma { ...@@ -1216,6 +1216,15 @@ public class ContextualSearchUma {
"Search.ContextualSearchShouldTranslate", code, FORCE_TRANSLATE_BOUNDARY); "Search.ContextualSearchShouldTranslate", code, FORCE_TRANSLATE_BOUNDARY);
} }
/**
* Logs that whether or not the conditions are met to perform a translation.
* @param isConditionMet Whether the translation conditions were met.
*/
public static void logTranslateCondition(boolean isConditionMet) {
RecordHistogram.recordBooleanHistogram(
"Search.ContextualSearchTranslateCondition", isConditionMet);
}
/** /**
* Logs whether Contextual Cards data was shown. Should be logged on tap if Contextual * Logs whether Contextual Cards data was shown. Should be logged on tap if Contextual
* Cards integration is enabled. * Cards integration is enabled.
......
...@@ -72334,6 +72334,16 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. ...@@ -72334,6 +72334,16 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary> </summary>
</histogram> </histogram>
<histogram name="Search.ContextualSearchTranslateCondition" enum="Boolean">
<owner>donnd@chromium.org</owner>
<owner>mahmoudi@chromium.org</owner>
<owner>twellington@chromium.org</owner>
<summary>
For each contextual search that is triggered by tap, records whether the
translation conditions are met. Implemented for Android.
</summary>
</histogram>
<histogram name="Search.DefaultSearchChangeOrigin" <histogram name="Search.DefaultSearchChangeOrigin"
enum="DefaultSearchChangeOrigin"> enum="DefaultSearchChangeOrigin">
<owner>mathp@chromium.org</owner> <owner>mathp@chromium.org</owner>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment