OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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.metrics; | 5 package org.chromium.chrome.browser.metrics; |
6 | 6 |
7 import org.chromium.base.metrics.RecordHistogram; | 7 import org.chromium.base.metrics.RecordHistogram; |
8 | 8 |
9 import java.util.concurrent.TimeUnit; | 9 import java.util.concurrent.TimeUnit; |
10 | 10 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 /** | 83 /** |
84 * Records whether installing a WebAPK from Google Play succeeded. If not, r
ecords the reason | 84 * Records whether installing a WebAPK from Google Play succeeded. If not, r
ecords the reason |
85 * that the install failed. | 85 * that the install failed. |
86 */ | 86 */ |
87 public static void recordGooglePlayInstallResult(int result) { | 87 public static void recordGooglePlayInstallResult(int result) { |
88 assert result >= 0 && result < GOOGLE_PLAY_INSTALL_RESULT_MAX; | 88 assert result >= 0 && result < GOOGLE_PLAY_INSTALL_RESULT_MAX; |
89 RecordHistogram.recordEnumeratedHistogram( | 89 RecordHistogram.recordEnumeratedHistogram( |
90 "WebApk.Install.GooglePlayInstallResult", result, GOOGLE_PLAY_IN
STALL_RESULT_MAX); | 90 "WebApk.Install.GooglePlayInstallResult", result, GOOGLE_PLAY_IN
STALL_RESULT_MAX); |
91 } | 91 } |
92 | 92 |
| 93 /** |
| 94 * Records whether updating a WebAPK from Google Play succeeded. If not, rec
ords the reason |
| 95 * that the update failed. |
| 96 */ |
| 97 public static void recordGooglePlayUpdateResult(int result) { |
| 98 assert result >= 0 && result < GOOGLE_PLAY_INSTALL_RESULT_MAX; |
| 99 RecordHistogram.recordEnumeratedHistogram( |
| 100 "WebApk.Update.GooglePlayUpdateResult", result, GOOGLE_PLAY_INST
ALL_RESULT_MAX); |
| 101 } |
| 102 |
93 /** Records the duration of a WebAPK session (from launch/foreground to back
ground). */ | 103 /** Records the duration of a WebAPK session (from launch/foreground to back
ground). */ |
94 public static void recordWebApkSessionDuration(long duration) { | 104 public static void recordWebApkSessionDuration(long duration) { |
95 RecordHistogram.recordLongTimesHistogram( | 105 RecordHistogram.recordLongTimesHistogram( |
96 "WebApk.Session.TotalDuration", duration, TimeUnit.MILLISECONDS)
; | 106 "WebApk.Session.TotalDuration", duration, TimeUnit.MILLISECONDS)
; |
97 } | 107 } |
98 } | 108 } |
OLD | NEW |