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

Side by Side Diff: chrome/browser/chromeos/arc/arc_optin_uma.cc

Issue 2704383006: arc: Handle metrics for Auth operations. (Closed)
Patch Set: nit in histograms.xml 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "chrome/browser/chromeos/arc/arc_optin_uma.h" 5 #include "chrome/browser/chromeos/arc/arc_optin_uma.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/metrics/histogram_functions.h"
9 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
10 11
11 namespace arc { 12 namespace arc {
12 13
13 void UpdateOptInActionUMA(OptInActionType type) { 14 void UpdateOptInActionUMA(OptInActionType type) {
14 UMA_HISTOGRAM_ENUMERATION("Arc.OptInAction", static_cast<int>(type), 15 UMA_HISTOGRAM_ENUMERATION("Arc.OptInAction", static_cast<int>(type),
15 static_cast<int>(OptInActionType::SIZE)); 16 static_cast<int>(OptInActionType::SIZE));
16 } 17 }
17 18
18 void UpdateOptInCancelUMA(OptInCancelReason reason) { 19 void UpdateOptInCancelUMA(OptInCancelReason reason) {
(...skipping 25 matching lines...) Expand all
44 // The macro UMA_HISTOGRAM_CUSTOM_TIMES expects a constant string, but since 45 // The macro UMA_HISTOGRAM_CUSTOM_TIMES expects a constant string, but since
45 // this measurement happens very infrequently, we do not need to use a macro 46 // this measurement happens very infrequently, we do not need to use a macro
46 // here. 47 // here.
47 base::Histogram::FactoryTimeGet( 48 base::Histogram::FactoryTimeGet(
48 histogram_name, base::TimeDelta::FromSeconds(1), 49 histogram_name, base::TimeDelta::FromSeconds(1),
49 base::TimeDelta::FromMinutes(6), 50, 50 base::TimeDelta::FromMinutes(6), 50,
50 base::HistogramBase::kUmaTargetedHistogramFlag) 51 base::HistogramBase::kUmaTargetedHistogramFlag)
51 ->AddTime(elapsed_time); 52 ->AddTime(elapsed_time);
52 } 53 }
53 54
55 void UpdateAuthTiming(const char* histogram_name,
56 base::TimeDelta elapsed_time) {
57 base::UmaHistogramCustomTimes(histogram_name, elapsed_time,
58 base::TimeDelta::FromSeconds(1) /* minimum */,
59 base::TimeDelta::FromMinutes(3) /* maximum */,
60 50 /* bucket_count */);
61 }
62
63 void UpdateAuthCheckinAttempts(int32_t num_attempts) {
64 UMA_HISTOGRAM_SPARSE_SLOWLY("ArcAuth.CheckinAttempts", num_attempts);
65 }
66
54 void UpdateSilentAuthCodeUMA(OptInSilentAuthCode state) { 67 void UpdateSilentAuthCodeUMA(OptInSilentAuthCode state) {
55 UMA_HISTOGRAM_ENUMERATION("Arc.OptInSilentAuthCode", static_cast<int>(state), 68 UMA_HISTOGRAM_ENUMERATION("Arc.OptInSilentAuthCode", static_cast<int>(state),
56 static_cast<int>(OptInSilentAuthCode::SIZE)); 69 static_cast<int>(OptInSilentAuthCode::SIZE));
57 } 70 }
58 71
59 std::ostream& operator<<(std::ostream& os, const ProvisioningResult& result) { 72 std::ostream& operator<<(std::ostream& os, const ProvisioningResult& result) {
60 #define MAP_PROVISIONING_RESULT(name) \ 73 #define MAP_PROVISIONING_RESULT(name) \
61 case ProvisioningResult::name: \ 74 case ProvisioningResult::name: \
62 return os << #name 75 return os << #name
63 76
(...skipping 22 matching lines...) Expand all
86 99
87 #undef MAP_PROVISIONING_RESULT 100 #undef MAP_PROVISIONING_RESULT
88 101
89 // Some compilers report an error even if all values of an enum-class are 102 // Some compilers report an error even if all values of an enum-class are
90 // covered exhaustively in a switch statement. 103 // covered exhaustively in a switch statement.
91 NOTREACHED() << "Invalid value " << static_cast<int>(result); 104 NOTREACHED() << "Invalid value " << static_cast<int>(result);
92 return os; 105 return os;
93 } 106 }
94 107
95 } // namespace arc 108 } // namespace arc
OLDNEW
« 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