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

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

Issue 2339393002: Separate ARC++ Provisioning Histogram into managed and unmanaged (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 unified diff | Download patch
« no previous file with comments | « chrome/browser/chromeos/arc/arc_optin_uma.h ('k') | tools/metrics/histograms/histograms.xml » ('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 "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) { 25 void UpdateProvisioningResultUMA(ProvisioningResult result, bool managed) {
26 UMA_HISTOGRAM_ENUMERATION("Arc.Provisioning.Result", static_cast<int>(result), 26 if (managed) {
27 static_cast<int>(ProvisioningResult::SIZE)); 27 UMA_HISTOGRAM_ENUMERATION("Arc.Provisioning.Result.Managed",
Luis Héctor Chávez 2016/09/15 16:00:32 Can you follow the convention in L40 and build the
phweiss 2016/09/15 16:55:51 Yes, but then we cannot use the macro anymore. I'm
Luis Héctor Chávez 2016/09/15 17:22:03 oh that expansion is also gnarlier than the one in
28 static_cast<int>(result),
29 static_cast<int>(ProvisioningResult::SIZE));
30 } else {
31 UMA_HISTOGRAM_ENUMERATION("Arc.Provisioning.Result.Unmanaged",
32 static_cast<int>(result),
33 static_cast<int>(ProvisioningResult::SIZE));
34 }
28 } 35 }
29 36
30 void UpdateProvisioningTiming(const base::TimeDelta& elapsed_time, 37 void UpdateProvisioningTiming(const base::TimeDelta& elapsed_time,
31 bool success, 38 bool success,
32 bool managed) { 39 bool managed) {
33 std::string histogram_name = "Arc.Provisioning.TimeDelta."; 40 std::string histogram_name = "Arc.Provisioning.TimeDelta.";
34 histogram_name += success ? "Success." : "Failure."; 41 histogram_name += success ? "Success." : "Failure.";
35 histogram_name += managed ? "Managed" : "Unmanaged"; 42 histogram_name += managed ? "Managed" : "Unmanaged";
36 // The macro UMA_HISTOGRAM_CUSTOM_TIMES expects a constant string, but since 43 // The macro UMA_HISTOGRAM_CUSTOM_TIMES expects a constant string, but since
37 // this measurement happens very infrequently, we do not need to use a macro 44 // this measurement happens very infrequently, we do not need to use a macro
38 // here. 45 // here.
39 base::Histogram::FactoryTimeGet( 46 base::Histogram::FactoryTimeGet(
40 histogram_name, base::TimeDelta::FromSeconds(1), 47 histogram_name, base::TimeDelta::FromSeconds(1),
41 base::TimeDelta::FromMinutes(6), 50, 48 base::TimeDelta::FromMinutes(6), 50,
42 base::HistogramBase::kUmaTargetedHistogramFlag) 49 base::HistogramBase::kUmaTargetedHistogramFlag)
43 ->AddTime(elapsed_time); 50 ->AddTime(elapsed_time);
44 } 51 }
45 52
46 } // namespace arc 53 } // namespace arc
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/arc/arc_optin_uma.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698