Chromium Code Reviews| 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..9eed50491816d0a216dd484268722f7081cb2a21 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 { |
| + |
| +std::string GetAuthHistogramName(const std::string& key) { |
| + std::string histogram_name = "Arc.Auth."; |
|
Luis Héctor Chávez
2017/02/23 18:26:55
constexpr char kArcAuthHistogramPrefix[] = "Arc.Au
khmel
2017/02/23 19:35:25
Done.
|
| + histogram_name += key; |
| + return histogram_name; |
| +} |
| + |
| +} // 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, |
| + const base::TimeDelta& elapsed_time) { |
| + 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)); |