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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java

Issue 2930553002: Add UMA metric to track the time elapsed since a WebAPK was last launched (Closed)
Patch Set: Merge branch 'master' into last_launched Created 3 years, 6 months 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 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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698