OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_METRICS_UTIL_H_ | |
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_METRICS_UTIL_H_ | |
7 | |
8 #include <string> | |
9 | |
10 namespace password_manager_metrics_util { | |
11 | |
12 // We monitor the performance of the save password heuristic for a handful of | |
13 // domains. For privacy reasons we are not reporting UMA signals by domain, but | |
14 // by a domain group. A domain group can contain multiple domains, and a domain | |
15 // can be contained in multiple groups. | |
16 // For more information see http://goo.gl/vUuFd5. | |
17 | |
18 // The number of groups in which each monitored website appears. | |
19 // It is a half of the total number of groups. | |
20 const size_t kGroupsPerDomain = 10u; | |
21 | |
22 // Check whether the |url_host| is monitored or not. If yes, we return | |
23 // the id of the group which contains the domain name otherwise | |
24 // returns 0. | |
25 size_t MonitoredDomainGroupId(const std::string& url_host); | |
26 | |
27 // A version of the UMA_HISTOGRAM_ENUMERATION macro that allows the |name| | |
28 // to vary over the program's runtime. | |
29 void LogUMAHistogramEnumeration(const std::string& name, | |
30 int sample, | |
31 int boundary_value); | |
32 | |
33 // A version of the UMA_HISTOGRAM_BOOLEAN macro that allows the |name| | |
34 // to vary over the program's runtime. | |
35 void LogUMAHistogramBoolean(const std::string& name, bool sample); | |
36 | |
37 // Sets the |kGroupsPerDomain| to |value|. Needed in order to test the | |
Ilya Sherman
2013/09/14 03:33:25
|kGroupsPerDomain| is a constant, not a variable,
| |
38 // MonitoredDomainGroupId function with all possible values of | |
39 // |kGroupsPerDomain|. Normally,the value of |kGroupsPerDomain| is | |
40 // randomly generated in range [0, |kGroupsPerDomain|). | |
41 void SetRandomIdForTesting(size_t value); | |
42 | |
43 // Returns a string which contains group_|group_id|. If the | |
44 // group_id corresponds to an unmonitored domain returns an empty string. | |
45 std::string GroupIdToString(size_t group_id); | |
46 | |
47 } // namespace password_manager_metrics_util | |
48 | |
49 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_METRICS_UTIL_H_ | |
OLD | NEW |