summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2025-10-29 11:50:51 -0400
committerDouglas Rumbaugh <dbr4@psu.edu>2025-10-29 11:50:51 -0400
commitfbe7dcdce1f7c81248c7086cac5d3f6a375b0c42 (patch)
treecfd9f89d77927afb85839b91c761d3c5fe37eee1 /include
parentcf5f3bbb0cb58430ed68ad3ebfcefc009e553d71 (diff)
downloaddynamic-extension-new-concurrency.tar.gz
Updates for dynamic rate limitingnew-concurrency
Diffstat (limited to 'include')
-rw-r--r--include/framework/DynamicExtension.h14
-rw-r--r--include/framework/structure/InternalLevel.h2
2 files changed, 15 insertions, 1 deletions
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 <atomic>
+#include <chrono>
#include <cstdio>
#include <gsl/gsl_rng.h>
#include <mutex>
@@ -544,7 +545,13 @@ private:
reconstruction_results<ShardType> flush_recon;
flush_recon.target_level = 0;
+ auto start = std::chrono::high_resolution_clock::now();
flush_recon.new_shard = std::make_shared<ShardType>(std::move(buffview));
+ auto stop = std::chrono::high_resolution_clock::now();
+ flush_recon.runtime =
+ std::chrono::duration_cast<std::chrono::nanoseconds>(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<shard_ptr> m_shards;
- const size_t m_window_size = 15;
+ const size_t m_window_size = 1;
std::deque<size_t> m_rt_window;
};