From: Adam C. Emerson Date: Tue, 6 Aug 2019 19:30:57 +0000 (-0400) Subject: neorados: Completion handling benchmark X-Git-Tag: wip-pdonnell-testing-20200918.022351~1203^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8e61ad87e109f8cfaf05720648b6675490bf31d8;p=ceph-ci.git neorados: Completion handling benchmark Signed-off-by: Adam C. Emerson --- diff --git a/src/test/neorados/CMakeLists.txt b/src/test/neorados/CMakeLists.txt index 38f7ae4b056..c9a506a1160 100644 --- a/src/test/neorados/CMakeLists.txt +++ b/src/test/neorados/CMakeLists.txt @@ -1,2 +1,6 @@ add_executable(ceph_test_neorados_start_stop start_stop.cc) target_link_libraries(ceph_test_neorados_start_stop global libneorados ${unittest_libs}) + +add_executable(ceph_test_neorados_completions completions.cc) +target_link_libraries(ceph_test_neorados_completions Boost::system pthread + ${unittest_libs}) diff --git a/src/test/neorados/completions.cc b/src/test/neorados/completions.cc new file mode 100644 index 00000000000..d9c0e087005 --- /dev/null +++ b/src/test/neorados/completions.cc @@ -0,0 +1,20 @@ +#include +#include +#include + +constexpr int max_completions = 10'000'000; +int completed = 0; + +boost::asio::io_context c; + +void nested_cb() { + if (++completed < max_completions) + c.post(&nested_cb); +} + +int main(void) { + c.post(&nested_cb); + c.run(); + assert(completed == max_completions); + return 0; +}