blob: c29b06604f81a10edbe3daf0e7af19ed256288cb [file] [log] [blame]
# Copyright 2019 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/rust/rustc_binary.gni")
import("//build/testing/perf/test.gni")
rustc_binary("reader-bin") {
name = "inspect_rust_reader_benchmarks"
edition = "2018"
with_unit_tests = true
source_root = "src/reader.rs"
deps = [
"//sdk/fidl/fuchsia.inspect:fuchsia.inspect_rust",
"//src/developer/fuchsia-criterion",
"//src/lib/diagnostics/inspect/runtime/rust",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
]
sources = [
"src/reader.rs",
"src/utils.rs",
]
}
rustc_binary("writer-bin") {
name = "inspect_rust_writer_benchmarks"
edition = "2018"
source_root = "src/writer.rs"
deps = [
"//sdk/fidl/fuchsia.inspect:fuchsia.inspect_rust",
"//src/developer/fuchsia-criterion",
"//src/lib/diagnostics/inspect/format/rust",
"//src/lib/diagnostics/inspect/runtime/rust",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:num",
"//third_party/rust_crates:once_cell",
"//third_party/rust_crates:paste",
"//third_party/rust_crates:rand",
]
sources = [
"src/utils.rs",
"src/writer.rs",
]
}
rustc_binary("snapshot-filter-bin") {
name = "inspect_rust_snapshot_filter_benchmarks"
edition = "2021"
source_root = "src/snapshot_filter.rs"
with_unit_tests = true
deps = [
"//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_rust",
"//src/developer/fuchsia-criterion",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/diagnostics/selectors",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:rand",
]
test_deps = [
"//src/lib/diagnostics/testing/diagnostics-assertions/rust:diagnostics-assertions",
"//src/lib/fuchsia",
"//third_party/rust_crates:pretty_assertions",
]
sources = [
"src/snapshot_filter.rs",
"src/utils.rs",
]
}
_reader_benchmark_component = "reader"
_writer_benchmark_component = "writer"
_snapshot_filter_benchmark_component = "snapshot_filter"
fuchsia_component("reader-component") {
component_name = _reader_benchmark_component
manifest = "meta/reader.cml"
deps = [ ":reader-bin" ]
}
fuchsia_component("writer-component") {
component_name = _writer_benchmark_component
manifest = "meta/writer.cml"
deps = [ ":writer-bin" ]
}
fuchsia_component("snapshot-filter-component") {
component_name = _snapshot_filter_benchmark_component
manifest = "meta/snapshot_filter.cml"
deps = [ ":snapshot-filter-bin" ]
}
fuchsia_package("rust-inspect-benchmarks") {
deps = [
":reader-component",
":snapshot-filter-component",
":writer-component",
]
}
fuchsia_unittest_package("rust-inspect-benchmarks-test") {
deps = [ ":snapshot-filter-bin_test" ]
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
}
fuchsia_component_perf_test("rust-inspect-reader-benchmark") {
package = ":rust-inspect-benchmarks"
component_name = _reader_benchmark_component
expected_metric_names_filepath = "//src/tests/end_to_end/perf/expected_metric_names/fuchsia.rust_inspect.reader_benchmarks.txt"
}
fuchsia_component_perf_test("rust-inspect-writer-benchmark") {
package = ":rust-inspect-benchmarks"
component_name = _writer_benchmark_component
expected_metric_names_filepath = "//src/tests/end_to_end/perf/expected_metric_names/fuchsia.rust_inspect.benchmarks.txt"
}
fuchsia_component_perf_test("rust-inspect-snapshot-filter-benchmark") {
package = ":rust-inspect-benchmarks"
component_name = _snapshot_filter_benchmark_component
expected_metric_names_filepath = "//src/tests/end_to_end/perf/expected_metric_names/fuchsia.rust_inspect.selectors.txt"
}
group("bench") {
testonly = true
deps = [
":rust-inspect-reader-benchmark",
":rust-inspect-snapshot-filter-benchmark",
":rust-inspect-writer-benchmark",
]
}
group("tests") {
testonly = true
deps = [ ":rust-inspect-benchmarks-test" ]
}