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 // Generate an id in range [0, |kGroupsPerDomain|). | |
38 // If the |g_random_group_id| is equal to its initial value | |
39 // (|kGroupsPerDomain|), the value of |g_random_group_id| is changed. | |
40 void GenerateRandomId(); | |
Ilya Sherman
2013/09/12 23:43:40
Please move this declaration into the anonymous na
jdomingos
2013/09/13 21:56:23
Done.
| |
41 | |
42 void SetRandomIdForTesting(size_t value); | |
Ilya Sherman
2013/09/12 23:43:40
Please add documentation for this function.
jdomingos
2013/09/13 21:56:23
Done.
| |
43 | |
44 // Returns a string which contains group_|group_id|. If the | |
45 // group_id corresponds to an unmonitored domain returns an empty string. | |
46 std::string GroupIdToString(size_t group_id); | |
47 | |
48 } // namespace password_manager_metrics_util | |
49 | |
50 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_METRICS_UTIL_H_ | |
OLD | NEW |