| # Copyright 2018 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//third_party/cobalt_config/metrics_registry.gni") |
| import("//third_party/protobuf/proto_library.gni") |
| |
| metrics_registry("internal_metrics_config") { |
| customer_id = 2147483647 |
| project_name = "metrics" |
| namespace = "cobalt.logger" |
| |
| generate_binarypb = false |
| generate_cc = true |
| } |
| |
| proto_library("cobalt_local_aggregation_proto") { |
| proto_in_dir = "//third_party/cobalt" |
| sources = [ |
| "local_aggregation.proto", |
| ] |
| import_dirs = [ "//third_party/protobuf/src" ] |
| generate_python = false |
| cc_generator_options = "lite" |
| deps = [ |
| "//third_party/cobalt/config:cobalt_registry_proto", |
| ] |
| |
| extra_configs = [ |
| "//third_party/cobalt:cobalt_config", |
| "//third_party/cobalt/config:proto_config", |
| ] |
| } |
| |
| source_set("status") { |
| sources = [ |
| "status.h", |
| ] |
| } |
| |
| source_set("event_record") { |
| sources = [ |
| "event_record.h", |
| ] |
| |
| public_configs = [ |
| "//third_party/cobalt:cobalt_config", |
| "//third_party/cobalt/config:proto_config", |
| ] |
| |
| public_deps = [ |
| "//third_party/cobalt:cobalt_proto", |
| "//third_party/cobalt/config:cobalt_registry_proto", |
| ] |
| } |
| |
| source_set("project_context") { |
| sources = [ |
| "project_context.cc", |
| "project_context.h", |
| ] |
| |
| public_configs = [ |
| "//third_party/cobalt:cobalt_config", |
| "//third_party/cobalt/config:proto_config", |
| ] |
| |
| public_deps = [ |
| ":status", |
| "//src/lib/fxl", |
| "//third_party/cobalt/config:cobalt_registry_proto", |
| "//third_party/cobalt/config:project_configs", |
| ] |
| } |
| |
| source_set("project_context_factory") { |
| sources = [ |
| "project_context_factory.cc", |
| "project_context_factory.h", |
| ] |
| |
| public_configs = [ |
| "//third_party/cobalt:cobalt_config", |
| "//third_party/cobalt/config:proto_config", |
| ] |
| |
| deps = [ |
| "//third_party/cobalt/config:cobalt_registry_proto", |
| |
| # This is for base64 decoding. |
| "//third_party/cobalt/util/crypto_util", |
| ] |
| |
| public_deps = [ |
| ":project_context", |
| "//third_party/cobalt/encoder:legacy_project_context", |
| ] |
| } |
| |
| source_set("encoder") { |
| sources = [ |
| "encoder.cc", |
| "encoder.h", |
| ] |
| |
| public_configs = [ "//third_party/cobalt:cobalt_config" ] |
| |
| public_deps = [ |
| ":status", |
| "//src/lib/fxl", |
| "//third_party/abseil-cpp", |
| "//third_party/cobalt/config:cobalt_registry_proto", |
| "//third_party/cobalt/config:packed_event_codes", |
| "//third_party/cobalt/encoder", |
| "//third_party/cobalt/util/crypto_util", |
| ] |
| } |
| |
| source_set("observation_writer") { |
| sources = [ |
| "observation_writer.cc", |
| "observation_writer.h", |
| ] |
| |
| public_configs = [ "//third_party/cobalt:cobalt_config" ] |
| |
| public_deps = [ |
| ":status", |
| "//src/lib/fxl", |
| "//third_party/cobalt:cobalt_proto", |
| "//third_party/cobalt/encoder", |
| "//third_party/cobalt/util:encrypted_message_util", |
| "//zircon/public/lib/trace", |
| ] |
| } |
| |
| source_set("event_aggregator") { |
| sources = [ |
| "event_aggregator.cc", |
| "event_aggregator.h", |
| ] |
| |
| public_configs = [ |
| "//third_party/cobalt:cobalt_config", |
| "//third_party/cobalt/config:proto_config", |
| ] |
| |
| public_deps = [ |
| ":cobalt_local_aggregation_proto", |
| ":encoder", |
| ":event_record", |
| ":observation_writer", |
| ":status", |
| "//src/lib/fxl", |
| "//third_party/cobalt:cobalt_proto", |
| "//third_party/cobalt/algorithms/rappor:rappor_encoder", |
| "//third_party/cobalt/config:cobalt_registry_proto", |
| "//third_party/cobalt/config:packed_event_codes", |
| "//third_party/cobalt/util:consistent_proto_store", |
| "//third_party/cobalt/util:proto_util", |
| ] |
| } |
| |
| source_set("logger_interface") { |
| sources = [ |
| "logger_interface.h", |
| ] |
| |
| public_configs = [ "//third_party/cobalt:cobalt_config" ] |
| |
| public_deps = [ |
| ":encoder", |
| ":status", |
| ] |
| } |
| |
| source_set("internal_metrics") { |
| sources = [ |
| "internal_metrics.cc", |
| "internal_metrics.h", |
| ] |
| |
| public_configs = [ "//third_party/cobalt:cobalt_config" ] |
| |
| public_deps = [ |
| ":internal_metrics_config_cc", |
| ":logger_interface", |
| "//src/lib/fxl", |
| ] |
| } |
| |
| source_set("logger") { |
| sources = [ |
| "logger.cc", |
| "logger.h", |
| ] |
| |
| public_configs = [ "//third_party/cobalt:cobalt_config" ] |
| |
| public_deps = [ |
| ":encoder", |
| ":event_aggregator", |
| ":event_record", |
| ":internal_metrics", |
| ":logger_interface", |
| ":observation_writer", |
| |
| # TODO(rudominer) Remove :project_context from public_deps after |
| # Fuchsia code switches to ProjectContextFactory. |
| ":project_context", |
| ":status", |
| "//third_party/cobalt/config:id", |
| "//zircon/public/lib/trace", |
| ] |
| } |
| |
| source_set("channel_mapper") { |
| sources = [ |
| "channel_mapper.cc", |
| "channel_mapper.h", |
| ] |
| |
| public_configs = [ "//third_party/cobalt:cobalt_config" ] |
| |
| public_deps = [ |
| "//garnet/public/lib/syslog/cpp", |
| "//third_party/cobalt/config:cobalt_registry_proto", |
| ] |
| } |
| |
| source_set("testing_constants") { |
| testonly = true |
| |
| sources = [ |
| "testing_constants.h", |
| ] |
| |
| public_deps = [ |
| "test_registries:all_report_types_test_registry", |
| "test_registries:mixed_time_zone_test_registry", |
| "test_registries:per_device_numeric_stats_test_registry", |
| "test_registries:unique_actives_noise_free_test_registry", |
| "test_registries:unique_actives_test_registry", |
| ] |
| |
| public_configs = [ "//third_party/cobalt:cobalt_config" ] |
| } |
| |
| source_set("logger_test_utils") { |
| testonly = true |
| sources = [ |
| "logger_test_utils.cc", |
| "logger_test_utils.h", |
| ] |
| deps = [ |
| ":cobalt_local_aggregation_proto", |
| ":project_context_factory", |
| "//third_party/cobalt/config:project_configs", |
| "//third_party/cobalt/encoder", |
| "//third_party/cobalt/util:posix_file_system", |
| "//third_party/googletest:gtest", |
| ] |
| public_configs = [ "//third_party/cobalt:cobalt_config" ] |
| } |
| |
| source_set("logger_test") { |
| testonly = true |
| |
| sources = [ |
| "logger_test.cc", |
| ] |
| |
| public_deps = [ |
| ":logger", |
| ":logger_test_utils", |
| ":testing_constants", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| source_set("internal_metrics_test") { |
| testonly = true |
| |
| sources = [ |
| "internal_metrics_test.cc", |
| ] |
| |
| public_deps = [ |
| ":cobalt_local_aggregation_proto", |
| ":internal_metrics", |
| ":logger_test_utils", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| source_set("channel_mapper_test") { |
| testonly = true |
| |
| sources = [ |
| "channel_mapper_test.cc", |
| ] |
| |
| public_deps = [ |
| ":channel_mapper", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":channel_mapper_test", |
| ":internal_metrics_test", |
| ":logger_test", |
| ] |
| } |