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 base { | |
11 class TimeDelta; | |
12 } | |
Ilya Sherman
2013/09/12 04:45:45
nit: No longer needed?
jdomingos
2013/09/12 12:01:01
Done.
| |
13 | |
14 namespace password_manager_metrics_util { | |
15 | |
16 // We monitor the performance of the save password heuristic for a handful of | |
17 // domains. For privacy reasons we are not reporting UMA signals by domain, but | |
18 // by a domain group. A domain group can contain mutliple domains, and a domain | |
Ilya Sherman
2013/09/12 04:45:45
nit: "mutliple" -> "multiple"
jdomingos
2013/09/12 12:01:01
Done.
| |
19 // can be contained in multiple groups. | |
20 // For more information see http://goo.gl/vUuFd5. | |
21 | |
22 // The number of group in which each monitored website appears. | |
23 // It is a half of the total number of groups. | |
24 const size_t kGroupsPerDomain = 10u; | |
25 | |
26 // Check whether the |url_host| is monitored or not. If yes, we return | |
27 // the id of the group which contains the domain name otherwise | |
28 // returns -1. | |
Ilya Sherman
2013/09/12 04:45:45
What does it mean for a function that returns an u
jdomingos
2013/09/12 12:01:01
Sorry the previous version used an integer.
Now th
| |
29 unsigned int MonitoredDomainGroupId(const std::string& url_host); | |
30 | |
31 // A version of the UMA_HISTOGRAM_ENUMERATION macro that allows the |name| | |
32 // to vary over the program's runtime. | |
33 void LogUMAHistogramEnumeration(const std::string& name, | |
34 int sample, | |
35 int boundary_value); | |
36 | |
37 // A version of the UMA_HISTOGRAM_COUNTS macro that allows the |name| | |
38 // to vary over the program's runtime. | |
39 void LogUMAHistogramCounts(const std::string& name, int sample); | |
40 | |
41 // A version of the UMA_HISTOGRAM_BOOLEAN macro that allows the |name| | |
42 // to vary over the program's runtime. | |
43 void LogUMAHistogramBoolean(const std::string& name, bool sample); | |
44 | |
45 // Generate an id in range [0, |kGroupsPerDomain|). | |
46 // If the |random_group_id| is equal to its initial value (|kGroupsPerDomain|), | |
47 // the value of |random_id| is not changed. | |
Ilya Sherman
2013/09/12 04:45:45
|random_group_id| and |random_id| are not variable
Ilya Sherman
2013/09/12 04:45:45
This sentence seems like it describes the opposite
jdomingos
2013/09/12 12:01:01
Done.
jdomingos
2013/09/12 12:01:01
Done.
| |
48 void GenerateRandomId(); | |
Ilya Sherman
2013/09/12 04:45:45
This seems like it should be an internal method, t
jdomingos
2013/09/12 12:01:01
Done.
| |
49 | |
50 void SetRandomIdForTesting(unsigned int value); | |
51 | |
52 // Returns a string which contains group_|group_id| | |
53 std::string AppendGroup(unsigned int group_id); | |
Ilya Sherman
2013/09/12 04:45:45
nit: IMO this function would be better named somet
jdomingos
2013/09/12 12:01:01
Done.
| |
54 | |
55 } // namespace password_manager_metrics_util | |
56 | |
57 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_METRICS_UTIL_H_ | |
OLD | NEW |