blob: 1b8a0242483966cd4cdfd9bfe03b2b204a7fe065 [file] [log] [blame]
# Copyright 2017 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("//build/components.gni")
import("//build/config.gni")
import("//third_party/cobalt/metrics_registry.gni")
metrics_registry("metrics_registry") {
# This must match the ID of our Cobalt project as specified in:
# third_party/cobalt_config/projects.yaml
project_id = 1334068210
namespace = "fuchsia_system_metrics"
generate_cc = true
generate_binarypb = false
}
source_set("system_metrics_daemon_lib") {
sources = [
"activity_listener.cc",
"activity_listener.h",
"cpu_stats_fetcher.h",
"cpu_stats_fetcher_impl.cc",
"cpu_stats_fetcher_impl.h",
"system_metrics_daemon.cc",
"system_metrics_daemon.h",
]
public_deps = [
":metrics_registry_cc",
"//sdk/fidl/fuchsia.kernel:fuchsia.kernel_cpp",
"//sdk/fidl/fuchsia.metrics:fuchsia.metrics_hlcpp",
"//sdk/fidl/fuchsia.ui.activity:fuchsia.ui.activity_hlcpp",
"//sdk/lib/component/incoming/cpp",
"//sdk/lib/diagnostics/reader/cpp:archive_reader",
"//sdk/lib/inspect/component/cpp",
"//sdk/lib/sys/cpp",
"//sdk/lib/syslog/cpp",
"//src/cobalt/bin/utils:clock",
"//src/cobalt/bin/utils:error_utils",
"//src/lib/cobalt/cpp:metric_event_builder",
"//src/lib/fsl",
"//src/lib/fxl:fxl_cli",
"//third_party/cobalt/src/lib/client/cpp:buckets_config",
"//zircon/system/ulib/abs_clock",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/trace",
"//zircon/system/ulib/trace-provider",
"//zircon/system/ulib/zx",
]
# TODO(https://fxbug.dev/42136089): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
executable("system-metrics") {
output_name = "cobalt_system_metrics"
sources = [ "system_metrics_main.cc" ]
deps = [
":system_metrics_daemon_lib",
"//sdk/lib/sys/cpp",
]
}
fuchsia_package_with_single_component("cobalt_system_metrics") {
manifest = "meta/cobalt_system_metrics.cml"
deps = [ ":system-metrics" ]
}
executable("cobalt_system_metrics_unittests") {
testonly = true
sources = [ "system_metrics_daemon_test.cc" ]
deps = [
":system_metrics_daemon_lib",
"testing:fake_fetchers",
"//sdk/fidl/fuchsia.metrics:fuchsia.metrics_hlcpp",
"//sdk/lib/inspect/testing/cpp",
"//sdk/lib/sys/cpp/testing:unit",
"//src/cobalt/bin/testing:fake_clock_lib",
"//src/cobalt/bin/testing:log_metric_method",
"//src/cobalt/bin/testing:stub_metric_event_logger_lib",
"//src/cobalt/bin/utils:clock",
"//src/lib/fsl",
"//src/lib/fxl/test:gtest_main",
"//src/lib/testing/loop_fixture",
]
# TODO(67363): Temporarily disable lsan for this target. Reenable once all leaks are fixed.
deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ]
}