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 import org.chromium.webapk.lib.common.WebApkConstants; | 8 import org.chromium.webapk.lib.common.WebApkConstants; |
9 | 9 |
10 import java.util.concurrent.TimeUnit; | 10 import java.util.concurrent.TimeUnit; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 "WebApk.Install.GooglePlayBindDuration", durationMs, TimeUnit.MI
LLISECONDS); | 117 "WebApk.Install.GooglePlayBindDuration", durationMs, TimeUnit.MI
LLISECONDS); |
118 } | 118 } |
119 | 119 |
120 /** Records the current Shell APK version. */ | 120 /** Records the current Shell APK version. */ |
121 public static void recordShellApkVersion(int shellApkVersion, String package
Name) { | 121 public static void recordShellApkVersion(int shellApkVersion, String package
Name) { |
122 String name = packageName.startsWith(WebApkConstants.WEBAPK_PACKAGE_PREF
IX) | 122 String name = packageName.startsWith(WebApkConstants.WEBAPK_PACKAGE_PREF
IX) |
123 ? "WebApk.ShellApkVersion.BrowserApk" | 123 ? "WebApk.ShellApkVersion.BrowserApk" |
124 : "WebApk.ShellApkVersion.UnboundApk"; | 124 : "WebApk.ShellApkVersion.UnboundApk"; |
125 RecordHistogram.recordSparseSlowlyHistogram(name, shellApkVersion); | 125 RecordHistogram.recordSparseSlowlyHistogram(name, shellApkVersion); |
126 } | 126 } |
| 127 |
| 128 /** |
| 129 * Recorded when a WebAPK is launched from the homescreen. Records the time
elapsed since the |
| 130 * previous WebAPK launch. Not recorded the first time that a WebAPK is laun
ched. |
| 131 */ |
| 132 public static void recordLaunchInterval(long intervalMs) { |
| 133 RecordHistogram.recordCustomTimesHistogram("WebApk.LaunchInterval", inte
rvalMs, |
| 134 TimeUnit.HOURS.toMillis(1), TimeUnit.DAYS.toMillis(30), TimeUnit
.MILLISECONDS, 50); |
| 135 } |
127 } | 136 } |
OLD | NEW |