From 881d754db9ff96e2879ef8ca56fb69ca7c5fbbc7 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 4 Dec 2024 12:32:10 -0800 Subject: [PATCH] x --- CMakeLists.txt | 40 ++++++++++++++++++++++++++++ build_autogenerated.yaml | 20 ++++++++++++++ src/core/BUILD | 6 ++--- tools/run_tests/generated/tests.json | 24 +++++++++++++++++ 4 files changed, 87 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bf560733e432e..97b0329067ed7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1835,6 +1835,7 @@ if(gRPC_BUILD_TESTS) add_dependencies(buildtests_cxx tcp_server_posix_test) endif() add_dependencies(buildtests_cxx tcp_socket_utils_test) + add_dependencies(buildtests_cxx tdigest_test) add_dependencies(buildtests_cxx test_core_channelz_channelz_test) add_dependencies(buildtests_cxx test_core_end2end_channelz_test) add_dependencies(buildtests_cxx test_core_event_engine_posix_timer_heap_test) @@ -33549,6 +33550,45 @@ target_link_libraries(tcp_socket_utils_test ) +endif() +if(gRPC_BUILD_TESTS) + +add_executable(tdigest_test + src/core/util/tdigest.cc + test/core/util/tdigest_test.cc +) +target_compile_features(tdigest_test PUBLIC cxx_std_14) +target_include_directories(tdigest_test + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + ${_gRPC_RE2_INCLUDE_DIR} + ${_gRPC_SSL_INCLUDE_DIR} + ${_gRPC_UPB_GENERATED_DIR} + ${_gRPC_UPB_GRPC_GENERATED_DIR} + ${_gRPC_UPB_INCLUDE_DIR} + ${_gRPC_XXHASH_INCLUDE_DIR} + ${_gRPC_ZLIB_INCLUDE_DIR} + third_party/googletest/googletest/include + third_party/googletest/googletest + third_party/googletest/googlemock/include + third_party/googletest/googlemock + ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(tdigest_test + ${_gRPC_ALLTARGETS_LIBRARIES} + gtest + absl::flat_hash_map + absl::check + absl::log + absl::random_random + absl::status + ${_gRPC_BENCHMARK_LIBRARIES} +) + + endif() if(gRPC_BUILD_TESTS) diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index c9015d2e16699..2f3ee81c0e348 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -21864,6 +21864,26 @@ targets: - gtest - grpc uses_polling: false +- name: tdigest_test + gtest: true + build: test + language: c++ + headers: + - src/core/util/tdigest.h + src: + - src/core/util/tdigest.cc + - test/core/util/tdigest_test.cc + deps: + - gtest + - absl/container:flat_hash_map + - absl/log:check + - absl/log:log + - absl/random:random + - absl/status:status + - benchmark + benchmark: true + defaults: benchmark + uses_polling: false - name: test_core_channelz_channelz_test gtest: true build: test diff --git a/src/core/BUILD b/src/core/BUILD index a2772aa53e5fd..dce0d0a80b33a 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -3959,12 +3959,12 @@ grpc_cc_library( grpc_cc_library( name = "tdigest", - hdrs = [ - "util/tdigest.h", - ], srcs = [ "util/tdigest.cc", ], + hdrs = [ + "util/tdigest.h", + ], external_deps = [ "absl/strings", "absl/status", diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index ebfbbcee2c583..18548d1769961 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -10537,6 +10537,30 @@ ], "uses_polling": false }, + { + "args": [], + "benchmark": true, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "tdigest_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": false + }, { "args": [], "benchmark": false,