-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Human presence] Consolidated metrics constants.
Human presence metrics constants are used from multiple files spread across the ash codebase. This CL brings the constants all together into one header that is referenced from each file. Bug: b:233679833 Change-Id: I4ceb1dc55ce09656723ebf3d79f4719581e48d16 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3822066 Reviewed-by: Alex Newcomer <newcomer@chromium.org> Commit-Queue: Michael Martis <martis@chromium.org> Reviewed-by: Guoxing Zhao <charleszhao@chromium.org> Cr-Commit-Position: refs/heads/main@{#1034954}
- Loading branch information
1 parent
9d7b376
commit 91be349
Showing
7 changed files
with
135 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright 2022 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef ASH_SYSTEM_HUMAN_PRESENCE_HUMAN_PRESENCE_METRICS_H_ | ||
#define ASH_SYSTEM_HUMAN_PRESENCE_HUMAN_PRESENCE_METRICS_H_ | ||
|
||
#include "base/time/time.h" | ||
|
||
namespace ash { | ||
|
||
// Use two namespaces to keep constant names legible. | ||
namespace snooping_protection_metrics { | ||
|
||
constexpr char kEnabledHistogramName[] = | ||
"ChromeOS.HPS.SnoopingProtection.Enabled"; | ||
constexpr char kPositiveDurationHistogramName[] = | ||
"ChromeOS.HPS.SnoopingProtection.Positive.Duration"; | ||
constexpr char kNegativeDurationHistogramName[] = | ||
"ChromeOS.HPS.SnoopingProtection.Negative.Duration"; | ||
constexpr char kFlakeyHistogramName[] = | ||
"ChromeOS.HPS.SnoopingProtection.FlakeyDetection"; | ||
constexpr char kNotificationSuppressionEnabledHistogramName[] = | ||
"ChromeOS.HPS.SnoopingProtectionNotificationSuppression.Enabled"; | ||
|
||
// Number of buckets to log SnoopingProtection present result. | ||
constexpr int kDurationNumBuckets = 100; | ||
|
||
// Minimum value for the SnoopingProtection.Positive.Duration and | ||
// SnoopingProtection.Negative.Duration. | ||
constexpr base::TimeDelta kDurationMin = base::Seconds(1); | ||
|
||
// Maximum value for SnoopingProtection.Positive.Duration; Longer than 1 hour is | ||
// considered as 1 hour. | ||
constexpr base::TimeDelta kPositiveDurationMax = base::Hours(1); | ||
|
||
// Maximum value for SnoopingProtection.Negative.Duration; Longer than 1 day is | ||
// considered as 1 day. | ||
constexpr base::TimeDelta kNegativeDurationMax = base::Hours(24); | ||
|
||
} // namespace snooping_protection_metrics | ||
|
||
namespace quick_dim_metrics { | ||
|
||
constexpr char kEnabledHistogramName[] = "ChromeOS.HPS.QuickDim.Enabled"; | ||
|
||
} // namespace quick_dim_metrics | ||
|
||
} // namespace ash | ||
|
||
#endif // ASH_SYSTEM_HUMAN_PRESENCE_HUMAN_PRESENCE_METRICS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.