OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |