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

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: Addressed comments 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
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestJourneyLoggerTest.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 minimum expected value of CustomCountHistograms is always set to 1. I t is still possible
19 // to log the value 0 to that type of histogram.
20 private static final int MIN_EXPECTED_SAMPLE = 1;
19 private static final int MAX_EXPECTED_SAMPLE = 49; 21 private static final int MAX_EXPECTED_SAMPLE = 49;
20 private static final int NUMBER_BUCKETS = 50; 22 private static final int NUMBER_BUCKETS = 50;
21 23
22 private static class SectionStats { 24 private static class SectionStats {
23 private int mNumberSuggestionsShown; 25 private int mNumberSuggestionsShown;
24 private int mNumberSelectionChanges; 26 private int mNumberSelectionChanges;
25 private int mNumberSelectionEdits; 27 private int mNumberSelectionEdits;
26 private int mNumberSelectionAdds; 28 private int mNumberSelectionAdds;
27 private boolean mIsRequested; 29 private boolean mIsRequested;
28 } 30 }
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 Math.min(mSections[i].mNumberSelectionEdits, MAX_EXPECTE D_SAMPLE), 120 Math.min(mSections[i].mNumberSelectionEdits, MAX_EXPECTE D_SAMPLE),
119 MIN_EXPECTED_SAMPLE, MAX_EXPECTED_SAMPLE, NUMBER_BUCKETS ); 121 MIN_EXPECTED_SAMPLE, MAX_EXPECTED_SAMPLE, NUMBER_BUCKETS );
120 RecordHistogram.recordCustomCountHistogram( 122 RecordHistogram.recordCustomCountHistogram(
121 "PaymentRequest.NumberOfSuggestionsShown." + nameSuffix, 123 "PaymentRequest.NumberOfSuggestionsShown." + nameSuffix,
122 Math.min(mSections[i].mNumberSuggestionsShown, MAX_EXPEC TED_SAMPLE), 124 Math.min(mSections[i].mNumberSuggestionsShown, MAX_EXPEC TED_SAMPLE),
123 MIN_EXPECTED_SAMPLE, MAX_EXPECTED_SAMPLE, NUMBER_BUCKETS ); 125 MIN_EXPECTED_SAMPLE, MAX_EXPECTED_SAMPLE, NUMBER_BUCKETS );
124 } 126 }
125 } 127 }
126 } 128 }
127 } 129 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestJourneyLoggerTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698