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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java

Issue 2639533003: [Content suggestions] Report updates in the UI to UMA. (Closed)
Patch Set: Fix errors #2 Created 3 years, 11 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 | chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java
index f4682007e76b913302e0b2090c9b20512b043453..1a71ee6b6f8f44458bfed7a9d8882c0222aaae64 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java
@@ -94,6 +94,33 @@ public final class NewTabPageUma {
/** The number of possible results for the NewTabPageLayout calculations. */
public static final int NUM_NTP_LAYOUT_RESULTS = 5;
+ /** Possible results when updating content suggestions list in the UI. Keep in sync with the
+ * ContentSuggestionsUIUpdateResult enum in histograms.xml. Do not remove or change existing
+ * values other than NUM_UI_UPDATE_RESULTS. */
+ @IntDef({UI_UPDATE_SUCCESS_APPENDED, UI_UPDATE_SUCCESS_NONE_SEEN, UI_UPDATE_SUCCESS_1_SEEN,
+ UI_UPDATE_SUCCESS_2_SEEN, UI_UPDATE_SUCCESS_3_SEEN, UI_UPDATE_SUCCESS_MORE_THAN_3_SEEN,
+ UI_UPDATE_FAIL_ALL_SEEN, UI_UPDATE_FAIL_DISABLED})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface ContentSuggestionsUIUpdateResult {}
+ /** The content suggestions are successfully appended (because they are set for the first time
+ * or explicitly marked to be appended). */
+ public static final int UI_UPDATE_SUCCESS_APPENDED = 0;
+ /** Update successful, none of the previous content suggestions have been seen. */
+ public static final int UI_UPDATE_SUCCESS_NONE_SEEN = 1;
+ /** Update successful, 1 previous content suggestion have been seen (and kept). */
dgn 2017/01/20 10:41:57 s/have/has
+ public static final int UI_UPDATE_SUCCESS_1_SEEN = 2;
+ /** Update successful, 2 previous content suggestions have been seen (and kept). */
+ public static final int UI_UPDATE_SUCCESS_2_SEEN = 3;
+ /** Update successful, 2 previous content suggestions have been seen (and kept). */
dgn 2017/01/20 10:41:57 s/2/3
+ public static final int UI_UPDATE_SUCCESS_3_SEEN = 4;
+ /** Update successful, more than 2 previous content suggestions have been seen (and kept). */
dgn 2017/01/20 10:41:57 s/2/3
+ public static final int UI_UPDATE_SUCCESS_MORE_THAN_3_SEEN = 5;
+ /** Update failed, all previous content suggestions have been seen (and kept). */
+ public static final int UI_UPDATE_FAIL_ALL_SEEN = 6;
+ /** Update failed, all previous content suggestions have been seen (and kept). */
+ public static final int UI_UPDATE_FAIL_DISABLED = 7;
+ public static final int NUM_UI_UPDATE_RESULTS = 8;
+
// The NTP was loaded in a cold startup.
private static final int LOAD_TYPE_COLD_START = 0;
// The NTP was loaded in a warm startup.
@@ -160,6 +187,16 @@ public final class NewTabPageUma {
}
/**
+ * Records how content suggestions have been updated in the UI.
+ * @param result result key, one of {@link ContentSuggestionsUIUpdateResult}'s values.
+ */
+ public static void recordUIUpdateResult(
+ @ContentSuggestionsUIUpdateResult int result) {
+ RecordHistogram.recordEnumeratedHistogram(
+ "NewTabPage.ContentSuggestions.UIUpdateResult", result, NUM_UI_UPDATE_RESULTS);
+ }
+
+ /**
* Record a NTP impression (even potential ones to make informed product decisions).
* @param impressionType Type of the impression from NewTabPageUma.java
*/
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698