Don't preload rarely seen large images
[chromium-blink-merge.git] / components / rappor / rappor_parameters.h
blob807b246cd3205df8243d6a159be89f74bf75e741
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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_RAPPOR_RAPPOR_PARAMETERS_H_
6 #define COMPONENTS_RAPPOR_RAPPOR_PARAMETERS_H_
8 #include <string>
10 namespace rappor {
12 enum Probability {
13 PROBABILITY_75, // 75%
14 PROBABILITY_50, // 50%
15 PROBABILITY_25, // 25%
19 // A metric is reported when its reporting group is in the set of groups
20 // passed in to RapporService::Start()
21 enum RecordingGroup {
22 // Metrics for UMA users.
23 UMA_RAPPOR_GROUP = 1 << 0,
24 // Metrics related to SafeBrowsing, for SafeBrowsing users.
25 SAFEBROWSING_RAPPOR_GROUP = 1 << 1,
28 // An object describing a rappor metric and the parameters used to generate it.
30 // For a full description of the rappor metrics, see
31 // http://www.chromium.org/developers/design-documents/rappor
32 struct RapporParameters {
33 // Get a string representing the parameters, for DCHECK_EQ.
34 std::string ToString() const;
36 // The maximum number of cohorts we divide clients into.
37 static const int kMaxCohorts;
39 // The number of cohorts to divide the reports for this metric into.
40 // This should divide kMaxCohorts evenly so that each cohort has an equal
41 // probability of being assigned users.
42 int num_cohorts;
44 // The number of bytes stored in the Bloom filter.
45 int bloom_filter_size_bytes;
46 // The number of hash functions used in the Bloom filter.
47 int bloom_filter_hash_function_count;
49 // The probability that a bit will be redacted with fake data.
50 Probability fake_prob;
51 // The probability that a fake bit will be a one.
52 Probability fake_one_prob;
54 // The probability that a one bit in the redacted data reports as one.
55 Probability one_coin_prob;
56 // The probability that a zero bit in the redacted data reports as one.
57 Probability zero_coin_prob;
59 // The reporting level this metric is reported at.
60 RecordingGroup recording_group;
63 } // namespace rappor
65 #endif // COMPONENTS_RAPPOR_RAPPOR_PARAMETERS_H_