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

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

Issue 2504583002: Merge provisioning success/error handling. (Closed)
Patch Set: Address comments. Created 4 years, 1 month 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') | no next file » | 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 "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 8
9 namespace arc { 9 namespace arc {
10 10
11 void UpdateOptInActionUMA(OptInActionType type) { 11 void UpdateOptInActionUMA(OptInActionType type) {
12 UMA_HISTOGRAM_ENUMERATION("Arc.OptInAction", static_cast<int>(type), 12 UMA_HISTOGRAM_ENUMERATION("Arc.OptInAction", static_cast<int>(type),
13 static_cast<int>(OptInActionType::SIZE)); 13 static_cast<int>(OptInActionType::SIZE));
14 } 14 }
15 15
16 void UpdateOptInCancelUMA(OptInCancelReason reason) { 16 void UpdateOptInCancelUMA(OptInCancelReason reason) {
17 UMA_HISTOGRAM_ENUMERATION("Arc.OptInCancel", static_cast<int>(reason), 17 UMA_HISTOGRAM_ENUMERATION("Arc.OptInCancel", static_cast<int>(reason),
18 static_cast<int>(OptInCancelReason::SIZE)); 18 static_cast<int>(OptInCancelReason::SIZE));
19 } 19 }
20 20
21 void UpdateEnabledStateUMA(bool enabled) { 21 void UpdateEnabledStateUMA(bool enabled) {
22 UMA_HISTOGRAM_BOOLEAN("Arc.State", enabled); 22 UMA_HISTOGRAM_BOOLEAN("Arc.State", enabled);
23 } 23 }
24 24
25 void UpdateProvisioningResultUMA(ProvisioningResult result, bool managed) { 25 void UpdateProvisioningResultUMA(ProvisioningResult result, bool managed) {
26 DCHECK_NE(result, ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR);
26 std::string histogram_name = "Arc.Provisioning.Result."; 27 std::string histogram_name = "Arc.Provisioning.Result.";
27 histogram_name += managed ? "Managed" : "Unmanaged"; 28 histogram_name += managed ? "Managed" : "Unmanaged";
28 base::LinearHistogram::FactoryGet( 29 base::LinearHistogram::FactoryGet(
29 histogram_name, 0, static_cast<int>(ProvisioningResult::SIZE), 30 histogram_name, 0, static_cast<int>(ProvisioningResult::SIZE),
30 static_cast<int>(ProvisioningResult::SIZE) + 1, 31 static_cast<int>(ProvisioningResult::SIZE) + 1,
31 base::HistogramBase::kUmaTargetedHistogramFlag) 32 base::HistogramBase::kUmaTargetedHistogramFlag)
32 ->Add(static_cast<int>(result)); 33 ->Add(static_cast<int>(result));
33 } 34 }
34 35
35 void UpdateProvisioningTiming(const base::TimeDelta& elapsed_time, 36 void UpdateProvisioningTiming(const base::TimeDelta& elapsed_time,
36 bool success, 37 bool success,
37 bool managed) { 38 bool managed) {
38 std::string histogram_name = "Arc.Provisioning.TimeDelta."; 39 std::string histogram_name = "Arc.Provisioning.TimeDelta.";
39 histogram_name += success ? "Success." : "Failure."; 40 histogram_name += success ? "Success." : "Failure.";
40 histogram_name += managed ? "Managed" : "Unmanaged"; 41 histogram_name += managed ? "Managed" : "Unmanaged";
41 // The macro UMA_HISTOGRAM_CUSTOM_TIMES expects a constant string, but since 42 // The macro UMA_HISTOGRAM_CUSTOM_TIMES expects a constant string, but since
42 // this measurement happens very infrequently, we do not need to use a macro 43 // this measurement happens very infrequently, we do not need to use a macro
43 // here. 44 // here.
44 base::Histogram::FactoryTimeGet( 45 base::Histogram::FactoryTimeGet(
45 histogram_name, base::TimeDelta::FromSeconds(1), 46 histogram_name, base::TimeDelta::FromSeconds(1),
46 base::TimeDelta::FromMinutes(6), 50, 47 base::TimeDelta::FromMinutes(6), 50,
47 base::HistogramBase::kUmaTargetedHistogramFlag) 48 base::HistogramBase::kUmaTargetedHistogramFlag)
48 ->AddTime(elapsed_time); 49 ->AddTime(elapsed_time);
49 } 50 }
50 51
51 } // namespace arc 52 } // namespace arc
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/arc/arc_optin_uma.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698