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

Unified Diff: chrome/browser/android/webapk/webapk_metrics.cc

Issue 2301263004: Add WebAPK installation metrics. (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/webapk/webapk_metrics.cc
diff --git a/chrome/browser/android/webapk/webapk_metrics.cc b/chrome/browser/android/webapk/webapk_metrics.cc
new file mode 100644
index 0000000000000000000000000000000000000000..030d11ebc8f5aae2d939749fa1a0a517070db190
--- /dev/null
+++ b/chrome/browser/android/webapk/webapk_metrics.cc
@@ -0,0 +1,34 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/android/webapk/webapk_metrics.h"
+
+#include "base/metrics/histogram_macros.h"
dominickn 2016/09/05 07:34:31 If you're only using SPARSE_SLOWLY, then I think y
Xi Han 2016/09/07 20:58:52 I change to use UMA_HISTOGRAM_ENUMERATION.
+#include "base/metrics/sparse_histogram.h"
+
+namespace webapk {
+
+const char kDismissEventHistogram[] = "WebApk.Install.DismissEvent";
+const char kInstallEventHistogram[] = "WebApk.Install.InstallEvent";
+const char kUserActionHistogram[] = "WebApk.Install.UserAction";
+
+void TrackDismissEvent(int event) {
dominickn 2016/09/05 07:34:31 You could make these take the enum argument direct
Xi Han 2016/09/07 20:58:52 Done.
+ DCHECK_LT(DISMISS_EVENT_MIN, event);
+ DCHECK_LT(event, DISMISS_EVENT_MAX);
+ UMA_HISTOGRAM_SPARSE_SLOWLY(kDismissEventHistogram, event);
+}
+
+void TrackInstallEvent(int event) {
+ DCHECK_LT(INSTALL_EVENT_MIN, event);
+ DCHECK_LT(event, INSTALL_EVENT_MAX);
+ UMA_HISTOGRAM_SPARSE_SLOWLY(kInstallEventHistogram, event);
+}
+
+void TrackUserAction(int event) {
+ DCHECK_LT(USER_ACTION_MIN, event);
+ DCHECK_LT(event, USER_ACTION_MAX);
+ UMA_HISTOGRAM_SPARSE_SLOWLY(kUserActionHistogram, event);
+}
+
+} // namespace webapk

Powered by Google App Engine
This is Rietveld 408576698