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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestJourneyLogger.java

Issue 2455513004: [Payments] Fix the Payment Request histogram check failure in tests. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.payments; 5 package org.chromium.chrome.browser.payments;
6 6
7 import org.chromium.base.metrics.RecordHistogram; 7 import org.chromium.base.metrics.RecordHistogram;
8 8
9 /** 9 /**
10 * A class used to record journey metrics for the Payment Request feature. 10 * A class used to record journey metrics for the Payment Request feature.
11 */ 11 */
12 public class PaymentRequestJourneyLogger { 12 public class PaymentRequestJourneyLogger {
13 public static final int SECTION_CONTACT_INFO = 0; 13 public static final int SECTION_CONTACT_INFO = 0;
14 public static final int SECTION_CREDIT_CARDS = 1; 14 public static final int SECTION_CREDIT_CARDS = 1;
15 public static final int SECTION_SHIPPING_ADDRESS = 2; 15 public static final int SECTION_SHIPPING_ADDRESS = 2;
16 public static final int SECTION_MAX = 3; 16 public static final int SECTION_MAX = 3;
17 17
18 private static final int MIN_EXPECTED_SAMPLE = 0; 18 // The min has to be set to 1 even though we can log 0.
please use gerrit instead 2016/10/26 22:01:14 Please explain why min has to be 1 and why can log
sebsg 2016/10/26 23:42:03 Please tell me if this is more clear. I'm making a
19 private static final int MIN_EXPECTED_SAMPLE = 1;
19 private static final int MAX_EXPECTED_SAMPLE = 49; 20 private static final int MAX_EXPECTED_SAMPLE = 49;
20 private static final int NUMBER_BUCKETS = 50; 21 private static final int NUMBER_BUCKETS = 50;
21 22
22 private static class SectionStats { 23 private static class SectionStats {
23 private int mNumberSuggestionsShown; 24 private int mNumberSuggestionsShown;
24 private int mNumberSelectionChanges; 25 private int mNumberSelectionChanges;
25 private int mNumberSelectionEdits; 26 private int mNumberSelectionEdits;
26 private int mNumberSelectionAdds; 27 private int mNumberSelectionAdds;
27 private boolean mIsRequested; 28 private boolean mIsRequested;
28 } 29 }
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 Math.min(mSections[i].mNumberSelectionEdits, MAX_EXPECTE D_SAMPLE), 119 Math.min(mSections[i].mNumberSelectionEdits, MAX_EXPECTE D_SAMPLE),
119 MIN_EXPECTED_SAMPLE, MAX_EXPECTED_SAMPLE, NUMBER_BUCKETS ); 120 MIN_EXPECTED_SAMPLE, MAX_EXPECTED_SAMPLE, NUMBER_BUCKETS );
120 RecordHistogram.recordCustomCountHistogram( 121 RecordHistogram.recordCustomCountHistogram(
121 "PaymentRequest.NumberOfSuggestionsShown." + nameSuffix, 122 "PaymentRequest.NumberOfSuggestionsShown." + nameSuffix,
122 Math.min(mSections[i].mNumberSuggestionsShown, MAX_EXPEC TED_SAMPLE), 123 Math.min(mSections[i].mNumberSuggestionsShown, MAX_EXPEC TED_SAMPLE),
123 MIN_EXPECTED_SAMPLE, MAX_EXPECTED_SAMPLE, NUMBER_BUCKETS ); 124 MIN_EXPECTED_SAMPLE, MAX_EXPECTED_SAMPLE, NUMBER_BUCKETS );
124 } 125 }
125 } 126 }
126 } 127 }
127 } 128 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698