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

Unified Diff: chrome/browser/chromeos/arc/arc_optin_uma.cc

Issue 2704383006: arc: Handle metrics for Auth operations. (Closed)
Patch Set: nits Created 3 years, 10 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
« no previous file with comments | « chrome/browser/chromeos/arc/arc_optin_uma.h ('k') | components/arc/common/auth.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/arc/arc_optin_uma.cc
diff --git a/chrome/browser/chromeos/arc/arc_optin_uma.cc b/chrome/browser/chromeos/arc/arc_optin_uma.cc
index cea4e1c4a8762618f5ec4217a37c07fd0251ae4b..c8c435302781ffee9117ad62396a64dda5d2fc8f 100644
--- a/chrome/browser/chromeos/arc/arc_optin_uma.cc
+++ b/chrome/browser/chromeos/arc/arc_optin_uma.cc
@@ -10,6 +10,16 @@
namespace arc {
+namespace {
+
+constexpr char kArcAuthHistogramPrefix[] = "Arc.Auth.";
+
+std::string GetAuthHistogramName(const std::string& key) {
+ return kArcAuthHistogramPrefix + key;
dcheng 2017/02/23 19:50:19 Just add the Arc.Auth. prefix to the UMAs, it'll b
khmel 2017/02/23 20:06:35 Done.
+}
+
+} // namespace
+
void UpdateOptInActionUMA(OptInActionType type) {
UMA_HISTOGRAM_ENUMERATION("Arc.OptInAction", static_cast<int>(type),
static_cast<int>(OptInActionType::SIZE));
@@ -51,6 +61,20 @@ void UpdateProvisioningTiming(const base::TimeDelta& elapsed_time,
->AddTime(elapsed_time);
}
+void UpdateAuthTiming(const std::string& key,
dcheng 2017/02/23 19:50:19 And then pass this as const char* to save some tem
khmel 2017/02/23 20:06:35 Done.
+ const base::TimeDelta& elapsed_time) {
dcheng 2017/02/23 19:50:19 Nit: pass by value
khmel 2017/02/23 20:06:36 Done.
+ base::Histogram::FactoryTimeGet(
+ GetAuthHistogramName(key), base::TimeDelta::FromSeconds(1) /* minimum */,
+ base::TimeDelta::FromMinutes(3) /* maximum */, 50 /* bucket_count */,
+ base::HistogramBase::kUmaTargetedHistogramFlag)
+ ->AddTime(elapsed_time);
+}
+
+void UpdateAuthAttempts(const std::string& key, int32_t value) {
+ UMA_HISTOGRAM_CUSTOM_COUNTS(GetAuthHistogramName(key), value, 0 /* minimum */,
+ 5 /* maximum */, 6 /* bucket_count */);
+}
+
void UpdateSilentAuthCodeUMA(OptInSilentAuthCode state) {
UMA_HISTOGRAM_ENUMERATION("Arc.OptInSilentAuthCode", static_cast<int>(state),
static_cast<int>(OptInSilentAuthCode::SIZE));
« no previous file with comments | « chrome/browser/chromeos/arc/arc_optin_uma.h ('k') | components/arc/common/auth.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698