From f8b91e3e0873edf7bca559db6ea70ef843fc9918 Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Sat, 13 Jul 2024 08:12:26 -0700 Subject: [PATCH 01/12] bazel: add utils:file_io library There does not appear to be a corresponding test. Signed-off-by: Noah Watkins --- src/v/utils/BUILD | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/v/utils/BUILD b/src/v/utils/BUILD index 97c6b9de5201a..d6e769b709851 100644 --- a/src/v/utils/BUILD +++ b/src/v/utils/BUILD @@ -137,6 +137,24 @@ redpanda_cc_library( ], ) +redpanda_cc_library( + name = "file_io", + srcs = [ + "file_io.cc", + ], + hdrs = [ + "file_io.h", + ], + include_prefix = "utils", + visibility = ["//visibility:public"], + deps = [ + "//src/v/base", + "//src/v/bytes:iobuf", + "//src/v/bytes:iostream", + "@seastar", + ], +) + redpanda_cc_library( name = "unresolved_address", hdrs = [ From 8a1caede553648e7358ad96bc68c5932d5f4c635 Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Sat, 13 Jul 2024 08:34:56 -0700 Subject: [PATCH 02/12] bazel: fix missing boost dependency Signed-off-by: Noah Watkins --- MODULE.bazel | 4 ++++ bazel/thirdparty/boost-intrusive-move-dep.patch | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 bazel/thirdparty/boost-intrusive-move-dep.patch diff --git a/MODULE.bazel b/MODULE.bazel index 903bc5dc3e1f5..a804d2ed29af5 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -14,6 +14,10 @@ bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost") archive_override( module_name = "rules_boost", integrity = "sha256-PcGxb6Ffi1CajH1PIqlAJ6mgqQ5/XW3NNL7TLZvlSBs=", + # TODO(bazel) + # remove patch when https://github.com/nelhage/rules_boost/pull/575 merges + patch_strip = 1, + patches = ["//bazel/thirdparty:boost-intrusive-move-dep.patch"], strip_prefix = "rules_boost-64bf4814222a6782fd0e7536532a257d7fdc9d80", urls = "https://github.com/nelhage/rules_boost/archive/64bf4814222a6782fd0e7536532a257d7fdc9d80.tar.gz", ) diff --git a/bazel/thirdparty/boost-intrusive-move-dep.patch b/bazel/thirdparty/boost-intrusive-move-dep.patch new file mode 100644 index 0000000000000..879466b10131e --- /dev/null +++ b/bazel/thirdparty/boost-intrusive-move-dep.patch @@ -0,0 +1,12 @@ +diff --git a/boost.BUILD b/boost.BUILD +index 16a304b..588030c 100644 +--- a/boost.BUILD ++++ b/boost.BUILD +@@ -1107,6 +1107,7 @@ boost_library( + deps = [ + ":assert", + ":cstdint", ++ ":move", + ":noncopyable", + ":static_assert", + ], From 8ee73810df59d019ab22e3db8920ca0fdbb808f4 Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Sat, 13 Jul 2024 08:38:44 -0700 Subject: [PATCH 03/12] bazel: add utils:tracking_allocator library Signed-off-by: Noah Watkins --- src/v/utils/BUILD | 18 ++++++++++++++++++ src/v/utils/tests/BUILD | 17 +++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/src/v/utils/BUILD b/src/v/utils/BUILD index d6e769b709851..156ae9574415b 100644 --- a/src/v/utils/BUILD +++ b/src/v/utils/BUILD @@ -155,6 +155,24 @@ redpanda_cc_library( ], ) +redpanda_cc_library( + name = "tracking_allocator", + srcs = [ + "tracking_allocator.cc", + ], + hdrs = [ + "tracking_allocator.h", + ], + include_prefix = "utils", + visibility = ["//visibility:public"], + deps = [ + ":human", + "//src/v/container:intrusive", + "//src/v/json", + "@seastar", + ], +) + redpanda_cc_library( name = "unresolved_address", hdrs = [ diff --git a/src/v/utils/tests/BUILD b/src/v/utils/tests/BUILD index e2d54f4805a69..dfd82538b1892 100644 --- a/src/v/utils/tests/BUILD +++ b/src/v/utils/tests/BUILD @@ -235,3 +235,20 @@ redpanda_cc_btest_no_seastar( "@boost//:test", ], ) + +redpanda_cc_btest( + name = "tracking_allocator_test", + timeout = "short", + srcs = [ + "tracking_allocator_tests.cc", + ], + deps = [ + "//src/v/json", + "//src/v/test_utils:seastar_boost", + "//src/v/utils:tracking_allocator", + "@abseil-cpp//absl/container:btree", + "@abseil-cpp//absl/container:flat_hash_map", + "@abseil-cpp//absl/container:flat_hash_set", + "@boost//:test", + ], +) From 32ca978b70b35d33b82d7ea0924628df00cfe433 Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Sat, 13 Jul 2024 08:48:14 -0700 Subject: [PATCH 04/12] bazel: use default public visibility for utils library Signed-off-by: Noah Watkins --- src/v/utils/BUILD | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/src/v/utils/BUILD b/src/v/utils/BUILD index 156ae9574415b..afcb67caca0c4 100644 --- a/src/v/utils/BUILD +++ b/src/v/utils/BUILD @@ -1,5 +1,7 @@ load("//bazel:build.bzl", "redpanda_cc_library") +package(default_visibility = ["//visibility:public"]) + redpanda_cc_library( name = "vint", srcs = [ @@ -10,7 +12,6 @@ redpanda_cc_library( "vint_iostream.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "//src/v/bytes", "//src/v/bytes:iostream", @@ -24,7 +25,6 @@ redpanda_cc_library( "functional.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], ) redpanda_cc_library( @@ -33,7 +33,6 @@ redpanda_cc_library( "inet_address_wrapper.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], ) redpanda_cc_library( @@ -42,7 +41,6 @@ redpanda_cc_library( "tristate.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "//src/v/base", ], @@ -54,7 +52,6 @@ redpanda_cc_library( "memory_data_source.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "//src/v/base", "@seastar", @@ -67,7 +64,6 @@ redpanda_cc_library( "mutex.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "//src/v/base", "//src/v/ssx:semaphore", @@ -80,7 +76,6 @@ redpanda_cc_library( "static_deleter_fn.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], ) redpanda_cc_library( @@ -89,7 +84,6 @@ redpanda_cc_library( "named_type.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "@fmt", ], @@ -101,7 +95,6 @@ redpanda_cc_library( "to_string.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "//src/v/base", "@fmt", @@ -115,7 +108,6 @@ redpanda_cc_library( "object_pool.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "//src/v/base", ], @@ -130,7 +122,6 @@ redpanda_cc_library( "human.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "//src/v/base", "@seastar", @@ -146,7 +137,6 @@ redpanda_cc_library( "file_io.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "//src/v/base", "//src/v/bytes:iobuf", @@ -164,7 +154,6 @@ redpanda_cc_library( "tracking_allocator.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ ":human", "//src/v/container:intrusive", @@ -179,7 +168,6 @@ redpanda_cc_library( "unresolved_address.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "//src/v/serde", ], @@ -195,7 +183,6 @@ redpanda_cc_library( ], exclude_layering_check = True, include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ ":human", ":static_deleter_fn", @@ -217,7 +204,6 @@ redpanda_cc_library( ], exclude_layering_check = True, include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "//src/v/container:fragmented_vector", "//src/v/reflection:adl", @@ -233,7 +219,6 @@ redpanda_cc_library( "uuid.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "//src/v/base", "//src/v/bytes", @@ -254,7 +239,6 @@ redpanda_cc_library( "xid.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "//src/v/base", "//src/v/bytes:iobuf_parser", @@ -276,7 +260,6 @@ redpanda_cc_library( ], exclude_layering_check = True, include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "//src/v/base", "//src/v/bytes", @@ -295,7 +278,6 @@ redpanda_cc_library( "directory_walker.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "//src/v/base", "@seastar", @@ -308,7 +290,6 @@ redpanda_cc_library( "expiring_promise.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "//src/v/base", "@seastar", @@ -324,7 +305,6 @@ redpanda_cc_library( "retry_chain_node.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "//src/v/base", "//src/v/random:fast_prng", @@ -343,7 +323,6 @@ redpanda_cc_library( "bottomless_token_bucket.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "//src/v/base", "@fmt", @@ -357,7 +336,6 @@ redpanda_cc_library( "move_canary.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], ) redpanda_cc_library( @@ -366,7 +344,6 @@ redpanda_cc_library( "exceptions.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ "//src/v/base", "@seastar", @@ -379,7 +356,6 @@ redpanda_cc_library( "stable_iterator_adaptor.h", ], include_prefix = "utils", - visibility = ["//visibility:public"], deps = [ ":exceptions", "//src/v/base", From 264aef47a843698b6bea90801a0d3fb4817815d5 Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Sat, 13 Jul 2024 09:37:23 -0700 Subject: [PATCH 05/12] bazel: update to latest boost rules Contains the intrusive library dependency fix. Signed-off-by: Noah Watkins --- MODULE.bazel | 10 +++----- MODULE.bazel.lock | 25 ++++++++----------- .../thirdparty/boost-intrusive-move-dep.patch | 12 --------- 3 files changed, 14 insertions(+), 33 deletions(-) delete mode 100644 bazel/thirdparty/boost-intrusive-move-dep.patch diff --git a/MODULE.bazel b/MODULE.bazel index a804d2ed29af5..2f45eaa8982cd 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -13,13 +13,9 @@ git_override( bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost") archive_override( module_name = "rules_boost", - integrity = "sha256-PcGxb6Ffi1CajH1PIqlAJ6mgqQ5/XW3NNL7TLZvlSBs=", - # TODO(bazel) - # remove patch when https://github.com/nelhage/rules_boost/pull/575 merges - patch_strip = 1, - patches = ["//bazel/thirdparty:boost-intrusive-move-dep.patch"], - strip_prefix = "rules_boost-64bf4814222a6782fd0e7536532a257d7fdc9d80", - urls = "https://github.com/nelhage/rules_boost/archive/64bf4814222a6782fd0e7536532a257d7fdc9d80.tar.gz", + integrity = "sha256-Sk6Rjh7r4pUyRYQ4QO2qhgZYvdkWbyrLJTCl9oY6Z7I=", + strip_prefix = "rules_boost-21cd44506bd15e06db89aa2866b9be90002d8eec", + urls = "https://github.com/nelhage/rules_boost/archive/21cd44506bd15e06db89aa2866b9be90002d8eec.tar.gz", ) non_module_boost_repositories = use_extension("@com_github_nelhage_rules_boost//:boost/repositories.bzl", "non_module_dependencies") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index b48df307af8a3..ed95372051730 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -101,14 +101,15 @@ "https://bcr.bazel.build/modules/stardoc/0.5.3/MODULE.bazel": "c7f6948dae6999bf0db32c1858ae345f112cacf98f174c7a8bb707e41b974f1c", "https://bcr.bazel.build/modules/stardoc/0.5.3/source.json": "cd53fe968dc8cd98197c052db3db6d82562960c87b61e7a90ee96f8e4e0dda97", "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", - "https://bcr.bazel.build/modules/xz/5.4.5.bcr.2/MODULE.bazel": "463976fb85f578a2535421ba4c38fe90657ab348e4b5d5404b75c061602705d0", - "https://bcr.bazel.build/modules/xz/5.4.5.bcr.2/source.json": "e735da8a3f396bf200ed06c585f670f7667e08c4e1ed2849bae7c2691bcb10cf", + "https://bcr.bazel.build/modules/xz/5.4.5.bcr.3/MODULE.bazel": "1f4f514bd40df12c54548bb7df07643d65e859b272e3b76e90181dfc1a55cb1e", + "https://bcr.bazel.build/modules/xz/5.4.5.bcr.3/source.json": "58cfd8a917944f183a3a808edb2e87de9e60b6269b643d7e3d1597267eaad6a2", "https://bcr.bazel.build/modules/yaml-cpp/0.8.0/MODULE.bazel": "879443fbbf128457a187bea6f278d05789f3fc465bb22c2e0fe7fdb52e45eef0", "https://bcr.bazel.build/modules/yaml-cpp/0.8.0/source.json": "8571372713f5030dbe517fb0cec549cef82aa5b76b4a178f902b95673ab5841c", "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", "https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.1/MODULE.bazel": "6a9fe6e3fc865715a7be9823ce694ceb01e364c35f7a846bf0d2b34762bc066b", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.1/source.json": "887450bc7cc88b10bdac47260206231da59e0c805ae34bf4f9705ec47acc7725", "https://bcr.bazel.build/modules/zlib/1.3/MODULE.bazel": "6a9c02f19a24dcedb05572b2381446e27c272cd383aed11d41d99da9e3167a72", - "https://bcr.bazel.build/modules/zlib/1.3/source.json": "b6b43d0737af846022636e6e255fd4a96fee0d34f08f3830e6e0bac51465c37c", "https://bcr.bazel.build/modules/zstd/1.5.6/MODULE.bazel": "471ebe7d3cdd8c6469390fcf623eb4779ff55fbee0a87f1dc57a1def468b96d4", "https://bcr.bazel.build/modules/zstd/1.5.6/source.json": "02010c3333fc89b44fe861db049968decb6e688411f7f9d4f6791d74f9adfb51" }, @@ -625,22 +626,12 @@ }, "@@rules_boost~//:boost/repositories.bzl%non_module_dependencies": { "general": { - "bzlTransitiveDigest": "re1Sh+xqV/Z6b58MhkCIq7cLdDQBoQFb58tF6oSvUiA=", + "bzlTransitiveDigest": "P8pg+9aYiNv6iouyCFMXd0wcrhmheW4OtSh2fcXDKvQ=", "usagesDigest": "Fq7E2AY4wLbRaJOwytVLKgLUEgCZU0aT53lfMsluHGc=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { - "zlib": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file": "@@rules_boost~//:zlib.BUILD", - "url": "https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.gz", - "sha256": "ff0ba4c292013dbc27530b3a81e1f9a813cd39de01ca5e0f8bf355702efa593e", - "strip_prefix": "zlib-1.3" - } - }, "boost": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", @@ -652,6 +643,12 @@ "patch_cmds_win": [ "Remove-Item -Force doc/pdf/BUILD" ], + "patches": [ + "@@rules_boost~//:zlib.patch" + ], + "patch_args": [ + "-p1" + ], "url": "https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.gz", "sha256": "4d27e9efed0f6f152dc28db6430b9d3dfb40c0345da7342eaa5a987dde57bd95", "strip_prefix": "boost-1.84.0" diff --git a/bazel/thirdparty/boost-intrusive-move-dep.patch b/bazel/thirdparty/boost-intrusive-move-dep.patch deleted file mode 100644 index 879466b10131e..0000000000000 --- a/bazel/thirdparty/boost-intrusive-move-dep.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/boost.BUILD b/boost.BUILD -index 16a304b..588030c 100644 ---- a/boost.BUILD -+++ b/boost.BUILD -@@ -1107,6 +1107,7 @@ boost_library( - deps = [ - ":assert", - ":cstdint", -+ ":move", - ":noncopyable", - ":static_assert", - ], From 1d257d38f883e6aecd54568945f95ef8e563d3d4 Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Sat, 13 Jul 2024 10:20:54 -0700 Subject: [PATCH 06/12] utils: fix sign-compare warning in test Signed-off-by: Noah Watkins --- src/v/utils/tests/coro_bench.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/v/utils/tests/coro_bench.cc b/src/v/utils/tests/coro_bench.cc index 58120d8a61734..9906240802d30 100644 --- a/src/v/utils/tests/coro_bench.cc +++ b/src/v/utils/tests/coro_bench.cc @@ -25,7 +25,7 @@ bool always_false() { template ss::future co_await_in_loop(F f) { perf_tests::start_measuring_time(); - for (int i = 0; i < ITERS; i++) { + for (size_t i = 0; i < ITERS; i++) { co_await f(); } perf_tests::stop_measuring_time(); @@ -37,7 +37,7 @@ ss::future collect_futures(F f) { std::vector> futs; futs.reserve(ITERS); perf_tests::start_measuring_time(); - for (int i = 0; i < ITERS; i++) { + for (size_t i = 0; i < ITERS; i++) { futs.emplace_back(f()); } perf_tests::stop_measuring_time(); From f41ec53a6d8c1a620fe8e9bae21f8f1c56216ccf Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Sat, 13 Jul 2024 10:23:39 -0700 Subject: [PATCH 07/12] bazel: add utils:coro_bench Signed-off-by: Noah Watkins --- src/v/utils/tests/BUILD | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/v/utils/tests/BUILD b/src/v/utils/tests/BUILD index dfd82538b1892..698992dfe54d2 100644 --- a/src/v/utils/tests/BUILD +++ b/src/v/utils/tests/BUILD @@ -252,3 +252,17 @@ redpanda_cc_btest( "@boost//:test", ], ) + +redpanda_cc_bench( + name = "coro_bench", + timeout = "short", + srcs = [ + "coro_bench.cc", + ], + deps = [ + "//src/v/base", + "//src/v/ssx:future_util", + "@seastar", + "@seastar//:benchmark", + ], +) From 5460d57c427909ca30de0a15b1c1af68f24303d5 Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Sat, 13 Jul 2024 10:23:57 -0700 Subject: [PATCH 08/12] bazel: add utils:histogram_bench Signed-off-by: Noah Watkins --- src/v/utils/tests/BUILD | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/v/utils/tests/BUILD b/src/v/utils/tests/BUILD index 698992dfe54d2..0475623a8efc7 100644 --- a/src/v/utils/tests/BUILD +++ b/src/v/utils/tests/BUILD @@ -266,3 +266,17 @@ redpanda_cc_bench( "@seastar//:benchmark", ], ) + +redpanda_cc_bench( + name = "seastar_histogram_bench", + timeout = "short", + srcs = [ + "seastar_histogram_bench.cc", + ], + deps = [ + "//src/v/utils:hdr_hist", + "//src/v/utils:log_hist", + "@seastar", + "@seastar//:benchmark", + ], +) From 921184b0a7cd2d8e91c1c3c9e04a9310e60368ed Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Sat, 13 Jul 2024 14:38:46 -0700 Subject: [PATCH 09/12] bazel: add utils:auto_fmt library Signed-off-by: Noah Watkins --- src/v/utils/BUILD | 12 ++++++++++++ src/v/utils/tests/BUILD | 15 +++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/v/utils/BUILD b/src/v/utils/BUILD index afcb67caca0c4..f38b2b1446cd0 100644 --- a/src/v/utils/BUILD +++ b/src/v/utils/BUILD @@ -2,6 +2,18 @@ load("//bazel:build.bzl", "redpanda_cc_library") package(default_visibility = ["//visibility:public"]) +redpanda_cc_library( + name = "auto_fmt", + hdrs = [ + "auto_fmt.h", + ], + include_prefix = "utils", + deps = [ + "//src/v/reflection:to_tuple", + "@fmt", + ], +) + redpanda_cc_library( name = "vint", srcs = [ diff --git a/src/v/utils/tests/BUILD b/src/v/utils/tests/BUILD index 0475623a8efc7..52f772bfc1aa3 100644 --- a/src/v/utils/tests/BUILD +++ b/src/v/utils/tests/BUILD @@ -280,3 +280,18 @@ redpanda_cc_bench( "@seastar//:benchmark", ], ) + +redpanda_cc_btest_no_seastar( + name = "auto_fmt_test", + timeout = "short", + srcs = [ + "auto_fmt_test.cc", + ], + defines = [ + "BOOST_TEST_MODULE=auto_fmt", + ], + deps = [ + "//src/v/utils:auto_fmt", + "@boost//:test", + ], +) From 52955eb62f4c68a4b2a9be3d8d90bdef4a8b3757 Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Sat, 13 Jul 2024 15:38:58 -0700 Subject: [PATCH 10/12] utils: fix header include path Signed-off-by: Noah Watkins --- src/v/utils/moving_average.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v/utils/moving_average.h b/src/v/utils/moving_average.h index 1896e0fde3421..1c97b8898e42e 100644 --- a/src/v/utils/moving_average.h +++ b/src/v/utils/moving_average.h @@ -11,7 +11,7 @@ #pragma once #include "base/likely.h" #include "base/vassert.h" -#include "named_type.h" +#include "utils/named_type.h" #include #include From 9f536a713dc94c0a5ff9329ac9a1ac65eeae28b0 Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Sat, 13 Jul 2024 15:38:50 -0700 Subject: [PATCH 11/12] bazel: add utils:moving_average_test Signed-off-by: Noah Watkins --- src/v/utils/BUILD | 12 ++++++++++++ src/v/utils/tests/BUILD | 15 +++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/v/utils/BUILD b/src/v/utils/BUILD index f38b2b1446cd0..c392ddd995c2d 100644 --- a/src/v/utils/BUILD +++ b/src/v/utils/BUILD @@ -14,6 +14,18 @@ redpanda_cc_library( ], ) +redpanda_cc_library( + name = "moving_average", + hdrs = [ + "moving_average.h", + ], + include_prefix = "utils", + deps = [ + ":named_type", + "//src/v/base", + ], +) + redpanda_cc_library( name = "vint", srcs = [ diff --git a/src/v/utils/tests/BUILD b/src/v/utils/tests/BUILD index 52f772bfc1aa3..0c38d49957ed9 100644 --- a/src/v/utils/tests/BUILD +++ b/src/v/utils/tests/BUILD @@ -295,3 +295,18 @@ redpanda_cc_btest_no_seastar( "@boost//:test", ], ) + +redpanda_cc_btest( + name = "moving_average_test", + timeout = "short", + srcs = [ + "moving_average_test.cc", + ], + deps = [ + "//src/v/base", + "//src/v/test_utils:seastar_boost", + "//src/v/utils:moving_average", + "@boost//:test", + "@seastar", + ], +) From b4aa62bc1d248060dee29203aaefcb4b084a44c0 Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Sat, 13 Jul 2024 15:54:48 -0700 Subject: [PATCH 12/12] bazel: add missing test dependencies Signed-off-by: Noah Watkins --- src/v/utils/tests/BUILD | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/v/utils/tests/BUILD b/src/v/utils/tests/BUILD index 0c38d49957ed9..263ea5160ae81 100644 --- a/src/v/utils/tests/BUILD +++ b/src/v/utils/tests/BUILD @@ -249,6 +249,8 @@ redpanda_cc_btest( "@abseil-cpp//absl/container:btree", "@abseil-cpp//absl/container:flat_hash_map", "@abseil-cpp//absl/container:flat_hash_set", + "@abseil-cpp//absl/container:node_hash_map", + "@abseil-cpp//absl/container:node_hash_set", "@boost//:test", ], )