Remove StringUsed metric type and HighFrequencyStringCounts report type
These are not in use right now.
Bug: 42098
Change-Id: Id278bf8e366c580bf4719f6340fb5a4df60e7895
diff --git a/src/bin/config_parser/src/config_validator/metric_definitions.go b/src/bin/config_parser/src/config_validator/metric_definitions.go
index 6072cee..81042f1 100644
--- a/src/bin/config_parser/src/config_validator/metric_definitions.go
+++ b/src/bin/config_parser/src/config_validator/metric_definitions.go
@@ -223,8 +223,6 @@
return validateMetricDimensions(m)
case config.MetricDefinition_INT_HISTOGRAM:
return validateIntHistogram(m)
- case config.MetricDefinition_STRING_USED:
- return validateStringUsed(m)
case config.MetricDefinition_CUSTOM:
return validateCustom(m)
}
@@ -266,13 +264,6 @@
return validateMetricDimensions(m)
}
-func validateStringUsed(m config.MetricDefinition) error {
- if len(m.MetricDimensions) > 0 {
- return fmt.Errorf("metric_dimensions must not be set for metrics of type STRING_USED")
- }
- return nil
-}
-
// TODO(ninai): remove this function when Cobalt 1.0 is done.
func validateCustomOld(m config.MetricDefinition) error {
if len(m.MetricDimensions) > 0 {
diff --git a/src/bin/config_parser/src/config_validator/metric_definitions_test.go b/src/bin/config_parser/src/config_validator/metric_definitions_test.go
index 9d1263f..e0bc323 100644
--- a/src/bin/config_parser/src/config_validator/metric_definitions_test.go
+++ b/src/bin/config_parser/src/config_validator/metric_definitions_test.go
@@ -407,15 +407,6 @@
}
}
-func TestValidateStringUsedEventCodesSet(t *testing.T) {
- m := makeValidMetric()
- m.MetricDimensions[0].EventCodes = map[uint32]string{1: "hello"}
-
- if err := validateStringUsed(m); err == nil {
- t.Error("Accepted STRING_USED metric with event_codes set.")
- }
-}
-
func TestValidateCustomEventCodesSetOld(t *testing.T) {
m := makeValidMetric()
m.Parts = map[string]*config.MetricPart{"hello": nil}
diff --git a/src/bin/config_parser/src/config_validator/report_definitions.go b/src/bin/config_parser/src/config_validator/report_definitions.go
index 3cf53d6..47a67cf 100644
--- a/src/bin/config_parser/src/config_validator/report_definitions.go
+++ b/src/bin/config_parser/src/config_validator/report_definitions.go
@@ -48,9 +48,6 @@
config.MetricDefinition_INT_HISTOGRAM: map[config.ReportDefinition_ReportType]bool{
config.ReportDefinition_INT_RANGE_HISTOGRAM: true,
},
- config.MetricDefinition_STRING_USED: map[config.ReportDefinition_ReportType]bool{
- config.ReportDefinition_HIGH_FREQUENCY_STRING_COUNTS: true,
- },
config.MetricDefinition_CUSTOM: map[config.ReportDefinition_ReportType]bool{
config.ReportDefinition_CUSTOM_RAW_DUMP: true,
},
@@ -135,8 +132,6 @@
switch r.ReportType {
case config.ReportDefinition_SIMPLE_OCCURRENCE_COUNT:
return validateSimpleOccurrenceCountReportDef(r)
- case config.ReportDefinition_HIGH_FREQUENCY_STRING_COUNTS:
- return validateHighFrequencyStringCountsReportDef(r)
case config.ReportDefinition_UNIQUE_N_DAY_ACTIVES:
return validateUniqueActivesReportDef(r)
case config.ReportDefinition_PER_DEVICE_NUMERIC_STATS:
@@ -158,14 +153,6 @@
return nil
}
-func validateHighFrequencyStringCountsReportDef(r config.ReportDefinition) error {
- if err := validateLocalPrivacyNoiseLevel(r); err != nil {
- return err
- }
-
- return nil
-}
-
func validateUniqueActivesReportDef(r config.ReportDefinition) error {
if err := validateWindowSize(r); err != nil {
return err
diff --git a/src/bin/config_parser/src/config_validator/report_definitions_test.go b/src/bin/config_parser/src/config_validator/report_definitions_test.go
index ae79f28..926362c 100644
--- a/src/bin/config_parser/src/config_validator/report_definitions_test.go
+++ b/src/bin/config_parser/src/config_validator/report_definitions_test.go
@@ -107,16 +107,6 @@
}
}
-// Test that local_privacy_noise_level must be set if the report type is HIGH_FREQUENCY_STRING_COUNTS.
-func TestValidateReportDefinitionForHighFrequencyStringCounts(t *testing.T) {
- r := makeValidReport()
- r.ReportType = config.ReportDefinition_HIGH_FREQUENCY_STRING_COUNTS
-
- if err := validateReportDefinition(r); err == nil {
- t.Error("Accepted report definition of type HIGH_FREQUENCY_STRING_COUNTS with local_privacy_noise_level unset.")
- }
-}
-
// Test that local_privacy_noise_level and window_size must be set if the report type is UNIQUE_N_DAY_ACTIVES.
func TestValidateReportDefinitionForUniqueActives(t *testing.T) {
r := makeValidReport()
diff --git a/src/bin/test_app/test_app.cc b/src/bin/test_app/test_app.cc
index 33269cc..1a8d1fd 100644
--- a/src/bin/test_app/test_app.cc
+++ b/src/bin/test_app/test_app.cc
@@ -1173,8 +1173,6 @@
return "MEMORY_USAGE";
case MetricDefinition::INT_HISTOGRAM:
return "INT_HISTOGRAM";
- case MetricDefinition::STRING_USED:
- return "STRING_USED";
case MetricDefinition::CUSTOM:
return "CUSTOM";
default:
@@ -1195,8 +1193,6 @@
return "NUMERIC_AGGREGATION";
case ReportDefinition::INT_RANGE_HISTOGRAM:
return "INT_RANGE_HISTOGRAM";
- case ReportDefinition::HIGH_FREQUENCY_STRING_COUNTS:
- return "HIGH_FREQUENCY_STRING_COUNTS";
case ReportDefinition::NUMERIC_PERF_RAW_DUMP:
return "NUMERIC_PERF_RAW_DUMP";
case ReportDefinition::UNIQUE_N_DAY_ACTIVES:
diff --git a/src/lib/crypto_util/hash.h b/src/lib/crypto_util/hash.h
index f44c75c..f83f33b 100644
--- a/src/lib/crypto_util/hash.h
+++ b/src/lib/crypto_util/hash.h
@@ -25,10 +25,6 @@
namespace hash {
-// Note(rudominer) Hash() is used for generating the Bloom Filter bits for
-// String RAPPOR. We allow up to 1024 Bloom bits and so we need to consume
-// two bytes of digest per hash in the Bloom filter. We allow up to 8 hashes
-// and so the DIGEST_SIZE must be at least 16.
static const size_t DIGEST_SIZE = 32; // SHA-256 outputs 32 bytes.
// Computes the SHA256 digest of |data_len| bytes from |data| and writes the
diff --git a/src/logger/encoder.cc b/src/logger/encoder.cc
index 04824b9..781a6f5 100644
--- a/src/logger/encoder.cc
+++ b/src/logger/encoder.cc
@@ -9,6 +9,7 @@
#include "src/algorithms/rappor/rappor_config_helper.h"
#include "src/algorithms/rappor/rappor_encoder.h"
+#include "src/lib/crypto_util/hash.h"
#include "src/logger/project_context.h"
#include "src/logging.h"
#include "src/pb/observation2.pb.h"
@@ -23,7 +24,6 @@
using ::cobalt::crypto::hash::DIGEST_SIZE;
using ::cobalt::rappor::BasicRapporEncoder;
using ::cobalt::rappor::RapporConfigHelper;
-using ::cobalt::rappor::RapporEncoder;
using ::cobalt::system_data::ClientSecret;
using ::cobalt::system_data::SystemDataInterface;
using ::google::protobuf::RepeatedField;
@@ -98,45 +98,6 @@
return result;
}
-Encoder::Result Encoder::EncodeRapporObservation(MetricRef metric, const ReportDefinition* report,
- uint32_t day_index, const std::string& str) const {
- auto result = MakeObservation(metric, report, day_index);
- auto* observation = result.observation.get();
- auto* rappor_observation = observation->mutable_string_rappor();
-
- rappor::RapporConfig rappor_config;
- rappor_config.num_hashes = RapporConfigHelper::kNumHashes;
- rappor_config.num_cohorts = RapporConfigHelper::StringRapporNumCohorts(*report);
- rappor_config.num_bloom_bits = RapporConfigHelper::StringRapporNumBloomBits(*report);
- rappor_config.prob_rr = RapporConfigHelper::kProbRR;
- float prob_bit_flip = RapporConfigHelper::ProbBitFlip(*report, metric.FullyQualifiedName());
- rappor_config.prob_0_becomes_1 = prob_bit_flip;
- rappor_config.prob_1_stays_1 = 1.0f - prob_bit_flip;
-
- RapporEncoder rappor_encoder(rappor_config, client_secret_);
- ValuePart string_value;
- string_value.set_string_value(str);
- switch (rappor_encoder.Encode(string_value, rappor_observation)) {
- case rappor::kOK:
- break;
-
- case rappor::kInvalidConfig:
- LOG(ERROR) << "RapporEncoder returned kInvalidConfig for: Report " << report->report_name()
- << " for metric " << metric.metric_name() << " in project "
- << metric.ProjectDebugString() << ".";
- result.status = kInvalidConfig;
- return result;
-
- case rappor::kInvalidInput:
- LOG(ERROR) << "RapporEncoder returned kInvalidInput for: Report " << report->report_name()
- << " for metric " << metric.metric_name() << " in project "
- << metric.ProjectDebugString() << ".";
- result.status = kInvalidArguments;
- return result;
- }
- return result;
-}
-
Encoder::Result Encoder::EncodeIntegerEventObservation(
MetricRef metric, const ReportDefinition* report, uint32_t day_index,
const RepeatedField<uint32_t>& event_codes, const std::string& component, int64_t value) const {
diff --git a/src/logger/encoder.h b/src/logger/encoder.h
index b571095..30e01c4 100644
--- a/src/logger/encoder.h
+++ b/src/logger/encoder.h
@@ -202,25 +202,6 @@
Result EncodeCustomObservation(MetricRef metric, const ReportDefinition* report,
uint32_t day_index, EventValuesPtr event_values) const;
- // Encodes an Observation of type RapporObservation.
- //
- // metric: Provides access to the names and IDs of the customer, project and
- // metric associated with the Observation being encoded.
- //
- // report: The definition of the Report associated with the Observation being
- // encoded. In addition to the common fields always required, this method also
- // requires that the |local_privacy_noise_level| field be set. This is used to
- // determine the p and q values for String RAPPOR. Additionally
- // The fields |expected_population_size| and |expected_string_set_size| from
- // the ReportDefinition will be consulted when configuring the String
- // RAPPOR algorithm.
- //
- // day_index: The day index associated with the Observation being encoded.
- //
- // str: The string to encode using String RAPPOR.
- Result EncodeRapporObservation(MetricRef metric, const ReportDefinition* report,
- uint32_t day_index, const std::string& str) const;
-
// Encodes an Observation of type UniqueActivesObservation.
//
// metric: Provides access to the names and IDs of the customer, project and
diff --git a/src/logger/encoder_test.cc b/src/logger/encoder_test.cc
index e4d65c4..38afd35 100644
--- a/src/logger/encoder_test.cc
+++ b/src/logger/encoder_test.cc
@@ -268,23 +268,6 @@
}
}
-TEST_F(EncoderTest, EncodeRapporObservation) {
- const char kMetricName[] = "ModuleDownloads";
- const char kReportName[] = "ModuleDownloads_HeavyHitters";
- const uint32_t kExpectedMetricId = 7;
- auto pair = GetMetricAndReport(kMetricName, kReportName);
- auto result = encoder_->EncodeRapporObservation(project_context_->RefMetric(pair.first),
- pair.second, kDayIndex, "Supercalifragilistic");
- CheckResult(result, kExpectedMetricId, kModuleDownloadsModuleDownloadsHeavyHittersReportId,
- kDayIndex);
- CheckDefaultSystemProfile(result);
- ASSERT_TRUE(result.observation->has_string_rappor());
- const RapporObservation& obs = result.observation->string_rappor();
- EXPECT_LT(obs.cohort(), 256u);
- // Expect 128 Bloom bits and so 16 bytes.
- EXPECT_EQ(obs.data().size(), 16u);
-}
-
TEST_F(EncoderTest, EncodeCustomObservation) {
const char kMetricName[] = "ModuleInstalls";
const char kReportName[] = "ModuleInstalls_DetailedData";
diff --git a/src/logger/event_loggers.cc b/src/logger/event_loggers.cc
index 21e37b9..bf4fd7a 100644
--- a/src/logger/event_loggers.cc
+++ b/src/logger/event_loggers.cc
@@ -59,10 +59,6 @@
return std::make_unique<internal::IntHistogramEventLogger>(encoder, event_aggregator,
observation_writer, system_data);
}
- case MetricDefinition::STRING_USED: {
- return std::make_unique<internal::StringUsedEventLogger>(encoder, event_aggregator,
- observation_writer, system_data);
- }
case MetricDefinition::CUSTOM: {
return std::make_unique<internal::CustomEventLogger>(encoder, event_aggregator,
observation_writer, system_data);
@@ -133,9 +129,6 @@
for (const auto& bucket : e.buckets()) {
ss << "| " << bucket.index() << " = " << bucket.count() << std::endl;
}
- } else if (event->has_string_used_event()) {
- const auto& e = event->string_used_event();
- ss << "StringUsedEvent: " << e.str() << std::endl;
} else if (event->has_custom_event()) {
const auto& e = event->custom_event();
ss << "CustomEvent:";
@@ -743,29 +736,6 @@
}
}
-/////////////// StringUsedEventLogger method implementations ///////////////////
-
-Encoder::Result StringUsedEventLogger::MaybeEncodeImmediateObservation(
- const ReportDefinition& report, bool /*may_invalidate*/, EventRecord* event_record) {
- TRACE_DURATION("cobalt_core", "StringUsedEventLogger::MaybeEncodeImmediateObservation");
- const MetricDefinition& metric = *(event_record->metric());
- const Event& event = *(event_record->event());
- CHECK(event.has_string_used_event());
- const auto& string_used_event = event_record->event()->string_used_event();
- switch (report.report_type()) {
- // Each report type has its own logic for generating immediate
- // observations.
- case ReportDefinition::HIGH_FREQUENCY_STRING_COUNTS: {
- return encoder()->EncodeRapporObservation(event_record->project_context()->RefMetric(&metric),
- &report, event.day_index(),
- string_used_event.str());
- }
-
- default:
- return BadReportType(event_record->project_context()->FullMetricName(metric), report);
- }
-}
-
/////////////// CustomEventLogger method implementations ///////////////////////
Status CustomEventLogger::ValidateEvent(const EventRecord& /*event_record*/) {
diff --git a/src/logger/event_loggers.h b/src/logger/event_loggers.h
index 16b1abf..13eba19 100644
--- a/src/logger/event_loggers.h
+++ b/src/logger/event_loggers.h
@@ -251,18 +251,6 @@
EventRecord* event_record) override;
};
-// Implementation of EventLogger for metrics of type STRING_USED.
-class StringUsedEventLogger : public EventLogger {
- public:
- using EventLogger::EventLogger;
- ~StringUsedEventLogger() override = default;
-
- private:
- Encoder::Result MaybeEncodeImmediateObservation(const ReportDefinition& report,
- bool may_invalidate,
- EventRecord* event_record) override;
-};
-
// Implementation of EventLogger for metrics of type CUSTOM.
class CustomEventLogger : public EventLogger {
public:
diff --git a/src/logger/event_loggers_test.cc b/src/logger/event_loggers_test.cc
index f94017f..fce08fc 100644
--- a/src/logger/event_loggers_test.cc
+++ b/src/logger/event_loggers_test.cc
@@ -228,18 +228,6 @@
return logger_->Log(std::move(event_record), mock_clock_->now());
}
- Status LogString(uint32_t metric_id, const std::string& str) {
- auto event_record = std::make_unique<EventRecord>(project_context_, metric_id);
- auto* string_used_event = event_record->event()->mutable_string_used_event();
- string_used_event->set_str(str);
- Status valid;
- if (kOK != (valid = logger_->PrepareAndValidateEvent(metric_id, MetricDefinition::STRING_USED,
- event_record.get()))) {
- return valid;
- }
- return logger_->Log(std::move(event_record), mock_clock_->now());
- }
-
Status LogCustomEvent(uint32_t metric_id, const std::vector<std::string>& dimension_names,
const std::vector<CustomDimensionValue>& values) {
auto event_record = std::make_unique<EventRecord>(project_context_, metric_id);
@@ -282,8 +270,6 @@
class IntHistogramEventLoggerTest : public EventLoggersTest<internal::IntHistogramEventLogger> {};
-class StringUsedEventLoggerTest : public EventLoggersTest<internal::StringUsedEventLogger> {};
-
class CustomEventLoggerTest : public EventLoggersTest<internal::CustomEventLogger> {};
// Creates a Logger whose ProjectContext contains only EVENT_OCCURRED metrics,
@@ -608,20 +594,6 @@
}
}
-// Tests the StringUsedEventLogger.
-TEST_F(StringUsedEventLoggerTest, Log) {
- ASSERT_EQ(kOK,
- LogString(testing::all_report_types::kModuleDownloadsMetricId, "www.mymodule.com"));
- Observation2 observation;
- uint32_t expected_report_id =
- testing::all_report_types::kModuleDownloadsModuleDownloadsHeavyHittersReportId;
- ASSERT_TRUE(FetchSingleObservation(&observation, expected_report_id, observation_store_.get(),
- update_recipient_.get()));
-
- ASSERT_TRUE(observation.has_string_rappor());
- EXPECT_FALSE(observation.string_rappor().data().empty());
-}
-
// Tests the CustomEventLogger.
TEST_F(CustomEventLoggerTest, LogCustomEvent) {
CustomDimensionValue module_value, number_value;
diff --git a/src/logger/fake_logger.cc b/src/logger/fake_logger.cc
index 53773a9..56f389b 100644
--- a/src/logger/fake_logger.cc
+++ b/src/logger/fake_logger.cc
@@ -115,17 +115,6 @@
return Status::kOK;
}
-Status FakeLogger::LogString(uint32_t metric_id, const std::string& str) {
- call_count_ += 1;
-
- Event event;
- event.set_metric_id(metric_id);
- event.mutable_string_used_event()->set_str(str);
- last_event_logged_ = event;
-
- return Status::kOK;
-}
-
Status FakeLogger::LogCustomEvent(uint32_t metric_id, EventValuesPtr event_values) {
call_count_ += 1;
diff --git a/src/logger/fake_logger.h b/src/logger/fake_logger.h
index 34a44bb..a6b4435 100644
--- a/src/logger/fake_logger.h
+++ b/src/logger/fake_logger.h
@@ -49,8 +49,6 @@
Status LogIntHistogram(uint32_t metric_id, const std::vector<uint32_t>& event_codes,
const std::string& component, HistogramPtr histogram) override;
- Status LogString(uint32_t metric_id, const std::string& str) override;
-
Status LogCustomEvent(uint32_t metric_id, EventValuesPtr event_values) override;
uint32_t call_count() { return call_count_; }
diff --git a/src/logger/logger.cc b/src/logger/logger.cc
index 7858ec6..a6bf523 100644
--- a/src/logger/logger.cc
+++ b/src/logger/logger.cc
@@ -135,14 +135,6 @@
return Log(metric_id, MetricDefinition::INT_HISTOGRAM, std::move(event_record));
}
-Status Logger::LogString(uint32_t metric_id, const std::string& str) {
- internal_metrics_->LoggerCalled(LoggerMethod::LogString, project_context_->project());
- auto event_record = std::make_unique<EventRecord>(project_context_, metric_id);
- auto* string_used_event = event_record->event()->mutable_string_used_event();
- string_used_event->set_str(str);
- return Log(metric_id, MetricDefinition::STRING_USED, std::move(event_record));
-}
-
Status Logger::LogCustomEvent(uint32_t metric_id, EventValuesPtr event_values) {
internal_metrics_->LoggerCalled(LoggerMethod::LogCustomEvent, project_context_->project());
auto event_record = std::make_unique<EventRecord>(project_context_, metric_id);
diff --git a/src/logger/logger.h b/src/logger/logger.h
index 0502db6..336956f 100644
--- a/src/logger/logger.h
+++ b/src/logger/logger.h
@@ -144,8 +144,6 @@
Status LogIntHistogram(uint32_t metric_id, const std::vector<uint32_t>& event_codes,
const std::string& component, HistogramPtr histogram) override;
- Status LogString(uint32_t metric_id, const std::string& str) override;
-
Status LogCustomEvent(uint32_t metric_id, EventValuesPtr event_values) override;
// LoggerCalled (cobalt_internal::metrics::logger_calls_made) and
diff --git a/src/logger/logger_interface.h b/src/logger/logger_interface.h
index d39017a..e2911bc 100644
--- a/src/logger/logger_interface.h
+++ b/src/logger/logger_interface.h
@@ -168,25 +168,6 @@
std::move(histogram));
}
- // Logs the fact that a given string was used, in a specific context.
- // The semantics of the context and the string is specified in the
- // Metric definition.
- //
- // This method is intended to be used in the following situation:
- // * The string s being logged does not contain PII or passwords.
- // * The set S of all possible strings that may be logged is large.
- // If the set S is small consider using LogEvent() instead.
- // * The ultimate data of interest is the statistical distribution of the
- // most commonly used strings from S over the population of all Fuchsia
- // devices.
- //
- // |metric_id| ID of the Metric the logged Event will belong to. It must
- // be one of the Metrics from the ProjectContext passed to the constructor,
- // and it must be of type STRING_USED.
- //
- // |str| The human-readable string to log.
- virtual Status LogString(uint32_t metric_id, const std::string& str) = 0;
-
// Logs a custom event. The structure of the event is defined in a proto file
// in the project's config folder.
//
diff --git a/src/logger/logger_test.cc b/src/logger/logger_test.cc
index 5097b56..ed6555d 100644
--- a/src/logger/logger_test.cc
+++ b/src/logger/logger_test.cc
@@ -387,21 +387,6 @@
}
}
-// Tests the method LogString().
-TEST_F(LoggerTest, LogString) {
- ASSERT_EQ(kOK, logger_->LogString(testing::all_report_types::kModuleDownloadsMetricId,
- "www.mymodule.com"));
- Observation2 observation;
- uint32_t expected_report_id =
- testing::all_report_types::kModuleDownloadsModuleDownloadsHeavyHittersReportId;
-
- ASSERT_TRUE(FetchSingleObservation(&observation, expected_report_id, observation_store_.get(),
- update_recipient_.get()));
-
- ASSERT_TRUE(observation.has_string_rappor());
- EXPECT_FALSE(observation.string_rappor().data().empty());
-}
-
// Tests the method LogCustomEvent().
TEST_F(LoggerTest, LogCustomEvent) {
CustomDimensionValue module_value, number_value;
diff --git a/src/logger/logger_test_utils.cc b/src/logger/logger_test_utils.cc
index cd532a1..5c07acc 100644
--- a/src/logger/logger_test_utils.cc
+++ b/src/logger/logger_test_utils.cc
@@ -13,6 +13,7 @@
#include "src/algorithms/rappor/rappor_config_helper.h"
#include "src/algorithms/rappor/rappor_encoder.h"
+#include "src/lib/crypto_util/hash.h"
#include "src/lib/util/encrypted_message_util.h"
#include "src/local_aggregation/aggregation_utils.h"
#include "src/logger/encoder.h"
diff --git a/src/logger/test_registries/all_report_types_test_registry.yaml b/src/logger/test_registries/all_report_types_test_registry.yaml
index a5371ff..070e859 100644
--- a/src/logger/test_registries/all_report_types_test_registry.yaml
+++ b/src/logger/test_registries/all_report_types_test_registry.yaml
@@ -143,18 +143,6 @@
id: 15
report_type: INT_RANGE_HISTOGRAM
-- id: 7
- metric_name: "ModuleDownloads"
- metric_type: STRING_USED
- reports:
- # Report ID: 1447128111
- - report_name: "ModuleDownloads_HeavyHitters"
- id: 16
- report_type: HIGH_FREQUENCY_STRING_COUNTS
- local_privacy_noise_level: SMALL
- expected_population_size: 20000
- expected_string_set_size: 10000
-
- id: 8
metric_name: "ModuleInstalls"
metric_type: CUSTOM
diff --git a/src/logger/test_registries/encoder_test_registry.yaml b/src/logger/test_registries/encoder_test_registry.yaml
index 9d41895..692de2d 100644
--- a/src/logger/test_registries/encoder_test_registry.yaml
+++ b/src/logger/test_registries/encoder_test_registry.yaml
@@ -42,18 +42,6 @@
- OS
- ARCH
-- id: 7
- metric_name: ModuleDownloads
- metric_type: STRING_USED
- reports:
- - report_name: ModuleDownloads_HeavyHitters
- id: 3
- report_type: HIGH_FREQUENCY_STRING_COUNTS
- local_privacy_noise_level: SMALL
- expected_population_size: 20000
- expected_string_set_size: 10000
- system_profile_field: [BOARD_NAME, PRODUCT_NAME]
-
- id: 8
metric_name: ModuleInstalls
metric_type: CUSTOM
diff --git a/src/registry/metric_definition.proto b/src/registry/metric_definition.proto
index 184203e..9562216 100644
--- a/src/registry/metric_definition.proto
+++ b/src/registry/metric_definition.proto
@@ -57,6 +57,9 @@
// A Metric has one of the following types.
// Next ID: 8
enum MetricType {
+ reserved 7;
+ reserved "STRING_USED";
+
UNSET = 0;
// Records that an event has occurred.
@@ -202,25 +205,6 @@
// - INT_RANGE_HISTOGRAM
INT_HISTOGRAM = 6;
- // Records that a given string was used in a specific context. The semantics
- // of the Metric must be specified in comments near the MetricDefintion.
- //
- // This metric type is intended to be used in the following situation:
- // * The string being logged does not contain PII or passwords.
- // * The set of all possible strings that may be logged is large.
- // If the set is small consider using EVENT_OCCURED instead.
- // * The ultimate data of interest is the statistical distribution of the
- // most commonly used strings
- //
- // Event fields:
- // - string s # The string that was used.
- //
- // MetricDefinition fields: None
- //
- // Compatible report types:
- // - HIGH_FREQUENCY_STRING_COUNTS
- STRING_USED = 7;
-
// Allows users of Cobalt to define custom Metrics with custom semantics and
// multiple parts, each with their own data type. A metric of this type is
// associated with a protocol buffer definition and proto messages of that
diff --git a/src/registry/report_definition.proto b/src/registry/report_definition.proto
index b5e41e9..68aa074 100644
--- a/src/registry/report_definition.proto
+++ b/src/registry/report_definition.proto
@@ -57,8 +57,8 @@
// A Report has one of the following types.
enum ReportType {
- reserved 6;
- reserved "STRING_COUNTS_WITH_THRESHOLD";
+ reserved 5, 6;
+ reserved "HIGH_FREQUENCY_STRING_COUNTS", "STRING_COUNTS_WITH_THRESHOLD";
REPORT_TYPE_UNSET = 0;
@@ -136,45 +136,6 @@
// (See report_row.proto)
INT_RANGE_HISTOGRAM = 4;
- // Gives the approximate distribution of the most commonly used strings in a
- // specific context specified by comments in the owning MetricDefinition.
- // Supports the use of local differential privacy.
- //
- // Supported Input Types:
- // - Metric types: STRING_USED
- // Encoding: String RAPPOR
- // Observation type: StringRapporObservation
- //
- // ReportDefinition fields particular to this type:
- // - local_privacy_noise_level # Gives RAPPOR parameters p,q
- // - expected_population_size # Hint for RAPPOR num cohorts
- // - expected_string_set_size # Hint for RAPPOR num bits
- // - candidate_list # All known string values
- // - candidate_file # File with all known string values
- //
- // Report fields:
- // - date
- // - system_profile # One or more fields from the SystemProfile message
- // type (cobalt/observation.proto) describing the
- // system on which the events occurred.
- // - string # The string that was used
- // - count # An estimate of the total number of times the string was used
- // # for the given date, over devices with that system profile.
- // - std_err: # Estimate of the std err in the value of Count estimate.
- //
- // Example report:
- //
- // Date, SystemProfile, String, Count, std_err
- // ------------------------------------------
- // 2018-7-25,<sys-prof 1>,"www.alpha.com", 12345, 1.3
- // 2018-7-25,<sys-prof 1>,"www.beta.com", 23456, 1.3
- // 2018-7-25,<sys-prof 2>,"www.gamma.com", 34567, 1.3
- // 2018-7-25,<sys-prof 2>,"www.delta.com", 78901, 1.3
- //
- // Note that the report will only include the most frequently used strings,
- // the so-called "heavy-hitters."
- HIGH_FREQUENCY_STRING_COUNTS = 5;
-
// Gives a raw dump of the Observations for a day of one of the numeric
// performance metrics.
//
@@ -344,33 +305,20 @@
// after data collection has begun or the data will become corrupted.
LocalPrivacyNoiseLevel local_privacy_noise_level = 4;
- // This field is used only with Report type
- // HIGH_FREQUENCY_STRING_COUNTS.
- // An estimate of the number of different devices that will be participating
- // in collecting data for the report. This helps to tune the RAPPOR
- // algorithm. This must not be changed after data collection has
- // begun or the data may become corrupted.
- uint32 expected_population_size = 5;
+ // This field is not in use.
+ uint32 expected_population_size = 5 [deprecated = true];
- // This field is used only with Report type
- // HIGH_FREQUENCY_STRING_COUNTS.
- // An estimate of the size of the set of all strings that are likely to
- // be logged. This helps to tune the RAPPOR algorithm. This
- // must not be changed after data collection has begun or the data may
- // become corrupted.
- uint32 expected_string_set_size = 6;
+ // This field is not in use.
+ uint32 expected_string_set_size = 6 [deprecated = true];
// Explicit list of known string values. Either this or |candidate_file|
// should be used, not both. Used for the hashed |component_name|
- // field for several Report types and the encoded |string| field for the
- // HIGH_FREQUENCY_STRING_COUNTS Report type.
+ // field for several Report types.
repeated string candidate_list = 8 [(cobalt_options).hide_on_client = true];
// Simple name or full path to file containing known string values.
// Either this or |candidate_list| should be used, not both. Used for the
- // hashed |component_name| field for several report types and the encoded
- // |string| field for the
- // HIGH_FREQUENCY_STRING_COUNTS Report type.
+ // hashed |component_name| field for several report types.
string candidate_file = 9;
// This field is used only with the INT_RANGE_HISTOGRAM Report type, but