Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Unified Diff: components/rappor/rappor_parameters.h

Issue 49753002: RAPPOR implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: RapporMetrics StatsTest Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/rappor/rappor_parameters.h
diff --git a/components/rappor/rappor_parameters.h b/components/rappor/rappor_parameters.h
new file mode 100644
index 0000000000000000000000000000000000000000..178c708e3a3e174844fa3abcff59b68ff14dcbc0
--- /dev/null
+++ b/components/rappor/rappor_parameters.h
@@ -0,0 +1,48 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_RAPPOR_RAPPOR_PARAMETERS_H_
+#define COMPONENTS_RAPPOR_RAPPOR_PARAMETERS_H_
+
+#include <ostream>
+#include <string>
+
+namespace rappor {
+
+enum Probability {
+ PROBABILITY_75, // 75%
+ PROBABILITY_50, // 50%
+};
+
+// An object describing a rappor metric and the parameters used to generate it.
+//
+// For a full description of the rappor metrics, see
+// http://www.chromium.org/developers/design-documents/rappor
+struct RapporParameters {
+ // The name of the metric.
+ std::string rappor_name;
+
+ // The number of bytes stored in the Bloom filter.
+ int bloom_filter_size_bytes;
+ // The number of hash functions used in the Bloom filter.
+ int bloom_filter_hash_function_count;
+
+ // The probability that a bit will be redacted with fake data.
+ Probability fake_prob;
+ // The probability that a fake bit will be a one.
+ Probability fake_one_prob;
+
+ // The probability that a one bit in the redacted data reports as one.
+ Probability one_coin_prob;
+ // The probability that a zero bit in the redacted data reports as one.
+ Probability zero_coin_prob;
+};
+
+std::ostream& operator<<(std::ostream& out, const RapporParameters& rhs);
Alexei Svitkine (slow) 2014/01/21 18:14:04 Generally, operator overloads are discouraged. I'd
Steven Holte 2014/01/21 20:25:14 These only exist to make DCHECK_EQ work and I've a
Alexei Svitkine (slow) 2014/01/21 20:30:39 How about just doing DCHECK_EQ() on ToString() res
Steven Holte 2014/01/21 21:05:32 Done.
+
+bool operator==(const RapporParameters& lhs, const RapporParameters& rhs);
+
+} // namespace rappor
+
+#endif // COMPONENTS_RAPPOR_RAPPOR_PARAMETERS_H_

Powered by Google App Engine
This is Rietveld 408576698