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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java

Issue 2285633004: [TTS] Record CTR by week and 28-day intervals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ctr
Patch Set: Added recording of impressions and getCurrentWeekNumber to invalidate the caching. Created 4 years, 3 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: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java
index 5dd1044979f1adda4bf98a3a8706b6df4feedf78..766cb23fe93d262589f5f8ff3d0f351388d649f5 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java
@@ -1171,6 +1171,30 @@ public class ContextualSearchUma {
}
/**
+ * Logs the number of impressions and CTR for the previous week for the current user.
+ * @param previousWeekImpressions The number of impressions the user saw.
Theresa 2016/09/27 20:53:56 nit: "The number of times the user saw the Context
Donn Denman 2016/09/28 00:38:43 Done, here and below.
+ * @param previousWeekCTR The CTR expressed as a percentage.
+ */
+ public static void logPreviousWeekCTR(int previousWeekImpressions, int previousWeekCTR) {
+ RecordHistogram.recordPercentageHistogram(
Theresa 2016/09/27 20:53:56 Impressions is just a regular number, not a percen
Donn Denman 2016/09/28 00:38:43 Nice catch! Done here and below.
+ "Search.ContextualSearchPreviousWeekImpressions", previousWeekImpressions);
+ RecordHistogram.recordPercentageHistogram(
+ "Search.ContextualSearchPreviousWeekCTR", previousWeekCTR);
+ }
+
+ /**
+ * Logs the number of impressions and CTR for previous 28-day period for the current user.
+ * @param previous28DayImpressions The number of impressions the user saw.
+ * @param previous28DayCTR The CTR expressed as a percentage.
+ */
+ public static void logPrevious28DayCTR(int previous28DayImpressions, int previous28DayCTR) {
+ RecordHistogram.recordPercentageHistogram(
+ "Search.ContextualSearchPrevious28DayImpressions", previous28DayImpressions);
+ RecordHistogram.recordPercentageHistogram(
+ "Search.ContextualSearchPrevious28DayCTR", previous28DayCTR);
+ }
+
+ /**
* Get the encoded value to use for the Bar Overlap histogram by encoding all the input
* parameters.
* @param didBarOverlap Whether the selection overlapped the Bar position.

Powered by Google App Engine
This is Rietveld 408576698