Commit fe85f61c authored by Xiqi Ruan's avatar Xiqi Ruan Committed by Commit Bot

cros: Change UMA metric naming of policy change count

Fix the difference strings of poliy change count in UMA
histogram and in app time controller.

Bug: 1074447
Change-Id: If598c44e2515aef9d85e4bf45ee0d327b94de24a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2222558Reviewed-by: default avatarYilkal Abe <yilkal@chromium.org>
Reviewed-by: default avatarAga Wronska <agawronska@chromium.org>
Commit-Queue: Xiqi Ruan <xiqiruan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773551}
parent 2f3e33b0
...@@ -55,8 +55,8 @@ const char kAppsWithTimeLimitMetric[] = ...@@ -55,8 +55,8 @@ const char kAppsWithTimeLimitMetric[] =
"SupervisedUsers.PerAppTimeLimits.AppsWithTimeLimit"; "SupervisedUsers.PerAppTimeLimits.AppsWithTimeLimit";
const char kBlockedAppsCountMetric[] = const char kBlockedAppsCountMetric[] =
"SupervisedUsers.PerAppTimeLimits.BlockedAppsCount"; "SupervisedUsers.PerAppTimeLimits.BlockedAppsCount";
const char kPolicyUpdateCountMetric[] = const char kPolicyChangeCountMetric[] =
"SupervisedUsers.PerAppTimeLimits.PolicyUpdateCount"; "SupervisedUsers.PerAppTimeLimits.PolicyChangeCount";
const char kEngagementMetric[] = "SupervisedUsers.PerAppTimeLimits.Engagement"; const char kEngagementMetric[] = "SupervisedUsers.PerAppTimeLimits.Engagement";
namespace { namespace {
...@@ -301,7 +301,7 @@ base::Optional<base::TimeDelta> AppTimeController::GetTimeLimitForApp( ...@@ -301,7 +301,7 @@ base::Optional<base::TimeDelta> AppTimeController::GetTimeLimitForApp(
} }
void AppTimeController::RecordMetricsOnShutdown() const { void AppTimeController::RecordMetricsOnShutdown() const {
base::UmaHistogramCounts1000(kPolicyUpdateCountMetric, base::UmaHistogramCounts1000(kPolicyChangeCountMetric,
patl_policy_update_count_); patl_policy_update_count_);
} }
......
...@@ -31,14 +31,14 @@ class OneShotTimer; ...@@ -31,14 +31,14 @@ class OneShotTimer;
namespace gfx { namespace gfx {
class ImageSkia; class ImageSkia;
} // namespace gfx } // namespace gfx
namespace chromeos { namespace chromeos {
namespace app_time { namespace app_time {
extern const char kAppsWithTimeLimitMetric[]; extern const char kAppsWithTimeLimitMetric[];
extern const char kBlockedAppsCountMetric[]; extern const char kBlockedAppsCountMetric[];
extern const char kPolicyUpdateCountMetric[]; extern const char kPolicyChangeCountMetric[];
extern const char kEngagementMetric[]; extern const char kEngagementMetric[];
class AppServiceWrapper; class AppServiceWrapper;
......
...@@ -571,7 +571,7 @@ TEST_F(AppTimeControllerTest, MetricsTest) { ...@@ -571,7 +571,7 @@ TEST_F(AppTimeControllerTest, MetricsTest) {
controller()->app_registry()->SaveAppActivity(); controller()->app_registry()->SaveAppActivity();
controller()->RecordMetricsOnShutdown(); controller()->RecordMetricsOnShutdown();
DeleteController(); DeleteController();
histogram_tester.ExpectBucketCount(kPolicyUpdateCountMetric, 1, 1); histogram_tester.ExpectBucketCount(kPolicyChangeCountMetric, 1, 1);
InstantiateController(); InstantiateController();
...@@ -583,12 +583,12 @@ TEST_F(AppTimeControllerTest, MetricsTest) { ...@@ -583,12 +583,12 @@ TEST_F(AppTimeControllerTest, MetricsTest) {
// metrics. // metrics.
histogram_tester.ExpectBucketCount(kBlockedAppsCountMetric, 1, 1); histogram_tester.ExpectBucketCount(kBlockedAppsCountMetric, 1, 1);
histogram_tester.ExpectBucketCount(kAppsWithTimeLimitMetric, 1, 1); histogram_tester.ExpectBucketCount(kAppsWithTimeLimitMetric, 1, 1);
histogram_tester.ExpectBucketCount(kPolicyUpdateCountMetric, 1, 1); histogram_tester.ExpectBucketCount(kPolicyChangeCountMetric, 1, 1);
controller()->RecordMetricsOnShutdown(); controller()->RecordMetricsOnShutdown();
DeleteController(); DeleteController();
// There was actually no policy update when the controller was reinstantiated. // There was actually no policy update when the controller was reinstantiated.
histogram_tester.ExpectBucketCount(kPolicyUpdateCountMetric, 0, 1); histogram_tester.ExpectBucketCount(kPolicyChangeCountMetric, 0, 1);
} }
TEST_F(AppTimeControllerTest, SetLastResetTimeTest) { TEST_F(AppTimeControllerTest, SetLastResetTimeTest) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment