OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_RAPPOR_RAPPOR_PARAMETERS_H_ | 5 #ifndef COMPONENTS_RAPPOR_RAPPOR_PARAMETERS_H_ |
6 #define COMPONENTS_RAPPOR_RAPPOR_PARAMETERS_H_ | 6 #define COMPONENTS_RAPPOR_RAPPOR_PARAMETERS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 namespace rappor { | 10 namespace rappor { |
11 | 11 |
12 enum Probability { | 12 enum Probability { |
13 PROBABILITY_75, // 75% | 13 PROBABILITY_75, // 75% |
14 PROBABILITY_50, // 50% | 14 PROBABILITY_50, // 50% |
15 PROBABILITY_25, // 25% | |
15 }; | 16 }; |
16 | 17 |
17 // An object describing a rappor metric and the parameters used to generate it. | 18 // An object describing a rappor metric and the parameters used to generate it. |
18 // | 19 // |
19 // For a full description of the rappor metrics, see | 20 // For a full description of the rappor metrics, see |
20 // http://www.chromium.org/developers/design-documents/rappor | 21 // http://www.chromium.org/developers/design-documents/rappor |
21 struct RapporParameters { | 22 struct RapporParameters { |
22 // Get a string representing the parameters, for DCHECK_EQ. | 23 // Get a string representing the parameters, for DCHECK_EQ. |
23 std::string ToString() const; | 24 std::string ToString() const; |
24 | 25 |
26 // The maximum number of cohorts we divide clients into. | |
27 static const int kMaxCohorts; | |
28 // The number of cohorts to divide the reports for this metric into. | |
Alexei Svitkine (slow)
2014/05/22 13:17:11
Nit: Empty line before this please.
Steven Holte
2014/05/23 21:54:05
Done.
| |
29 int num_cohorts; | |
30 | |
25 // The number of bytes stored in the Bloom filter. | 31 // The number of bytes stored in the Bloom filter. |
26 int bloom_filter_size_bytes; | 32 int bloom_filter_size_bytes; |
27 // The number of hash functions used in the Bloom filter. | 33 // The number of hash functions used in the Bloom filter. |
28 int bloom_filter_hash_function_count; | 34 int bloom_filter_hash_function_count; |
29 | 35 |
30 // The probability that a bit will be redacted with fake data. | 36 // The probability that a bit will be redacted with fake data. |
31 Probability fake_prob; | 37 Probability fake_prob; |
32 // The probability that a fake bit will be a one. | 38 // The probability that a fake bit will be a one. |
33 Probability fake_one_prob; | 39 Probability fake_one_prob; |
34 | 40 |
35 // The probability that a one bit in the redacted data reports as one. | 41 // The probability that a one bit in the redacted data reports as one. |
36 Probability one_coin_prob; | 42 Probability one_coin_prob; |
37 // The probability that a zero bit in the redacted data reports as one. | 43 // The probability that a zero bit in the redacted data reports as one. |
38 Probability zero_coin_prob; | 44 Probability zero_coin_prob; |
39 }; | 45 }; |
40 | 46 |
41 } // namespace rappor | 47 } // namespace rappor |
42 | 48 |
43 #endif // COMPONENTS_RAPPOR_RAPPOR_PARAMETERS_H_ | 49 #endif // COMPONENTS_RAPPOR_RAPPOR_PARAMETERS_H_ |
OLD | NEW |