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_METRIC_H_ | 5 #ifndef COMPONENTS_RAPPOR_RAPPOR_METRIC_H_ |
6 #define COMPONENTS_RAPPOR_RAPPOR_METRIC_H_ | 6 #define COMPONENTS_RAPPOR_RAPPOR_METRIC_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "components/rappor/bloom_filter.h" | 13 #include "components/rappor/bloom_filter.h" |
14 #include "components/rappor/byte_vector_utils.h" | 14 #include "components/rappor/byte_vector_utils.h" |
15 #include "components/rappor/rappor_parameters.h" | 15 #include "components/rappor/public/rappor_parameters.h" |
16 | 16 |
17 namespace rappor { | 17 namespace rappor { |
18 | 18 |
19 // A RapporMetric is an object that collects string samples into a Bloom filter, | 19 // A RapporMetric is an object that collects string samples into a Bloom filter, |
20 // and generates randomized reports about the collected data. | 20 // and generates randomized reports about the collected data. |
21 // | 21 // |
22 // This class should not be used directly by metrics clients. Record metrics | 22 // This class should not be used directly by metrics clients. Record metrics |
23 // using RapporService::RecordSample instead. | 23 // using RapporServiceImpl::RecordSample or RapporService::RecordSample instead. |
24 // | 24 // |
25 // For a full description of the rappor metrics, see | 25 // For a full description of the rappor metrics, see |
26 // http://www.chromium.org/developers/design-documents/rappor | 26 // http://www.chromium.org/developers/design-documents/rappor |
27 class RapporMetric { | 27 class RapporMetric { |
28 public: | 28 public: |
29 // Takes the |metric_name| that this will be reported to the server with, | 29 // Takes the |metric_name| that this will be reported to the server with, |
30 // a |parameters| describing size and probability weights used in recording | 30 // a |parameters| describing size and probability weights used in recording |
31 // this metric, and a |cohort| value, which determines the hash functions | 31 // this metric, and a |cohort| value, which determines the hash functions |
32 // used in the Bloom filter. | 32 // used in the Bloom filter. |
33 RapporMetric(const std::string& metric_name, | 33 RapporMetric(const std::string& metric_name, |
(...skipping 22 matching lines...) Expand all Loading... |
56 const RapporParameters parameters_; | 56 const RapporParameters parameters_; |
57 uint32_t sample_count_; | 57 uint32_t sample_count_; |
58 BloomFilter bloom_filter_; | 58 BloomFilter bloom_filter_; |
59 | 59 |
60 DISALLOW_COPY_AND_ASSIGN(RapporMetric); | 60 DISALLOW_COPY_AND_ASSIGN(RapporMetric); |
61 }; | 61 }; |
62 | 62 |
63 } // namespace rappor | 63 } // namespace rappor |
64 | 64 |
65 #endif // COMPONENTS_RAPPOR_RAPPOR_METRIC_H_ | 65 #endif // COMPONENTS_RAPPOR_RAPPOR_METRIC_H_ |
OLD | NEW |