From fbe7dcdce1f7c81248c7086cac5d3f6a375b0c42 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Wed, 29 Oct 2025 11:50:51 -0400 Subject: Updates for dynamic rate limiting --- include/framework/DynamicExtension.h | 14 ++++++++++++++ include/framework/structure/InternalLevel.h | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'include/framework') diff --git a/include/framework/DynamicExtension.h b/include/framework/DynamicExtension.h index 63264a0..c062d4a 100644 --- a/include/framework/DynamicExtension.h +++ b/include/framework/DynamicExtension.h @@ -10,6 +10,7 @@ #pragma once #include +#include #include #include #include @@ -544,7 +545,13 @@ private: reconstruction_results flush_recon; flush_recon.target_level = 0; + auto start = std::chrono::high_resolution_clock::now(); flush_recon.new_shard = std::make_shared(std::move(buffview)); + auto stop = std::chrono::high_resolution_clock::now(); + flush_recon.runtime = + std::chrono::duration_cast(stop - start) + .count(); + flush_recon.reccnt = flush_recon.new_shard->get_record_count(); reconstructions.push_back(flush_recon); @@ -637,6 +644,13 @@ private: /* apply our updates to the copied structure (adding/removing shards) */ for (auto recon : reconstructions) { + if (recon.target_level != 0) { + #ifdef DE_PRINT_MODEL_OUTPUT + fprintf(stdout, "M\t%ld\t%ld\t%ld\t%ld\n", recon.target_level, + args->predicted_runtime, recon.runtime, recon.reccnt); + #endif + } + auto grow = args->version->get_mutable_structure()->apply_reconstruction( recon, args->version->get_id()); if (grow) { diff --git a/include/framework/structure/InternalLevel.h b/include/framework/structure/InternalLevel.h index cf2b16a..88b3fef 100644 --- a/include/framework/structure/InternalLevel.h +++ b/include/framework/structure/InternalLevel.h @@ -262,7 +262,7 @@ private: ssize_t m_level_no; std::vector m_shards; - const size_t m_window_size = 15; + const size_t m_window_size = 1; std::deque m_rt_window; }; -- cgit v1.2.3