From 38693c342558628c75e0ab0d23c32a95a499ed8b Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Fri, 19 Jan 2024 15:58:04 -0500 Subject: Initial rough-out of internal statistics tracker Need to figure out the best way to do the detailed tracking in a concurrent manner. I was thinking just an event log, with parsing routines for extracting statistics. But that'll be pretty slow. --- include/framework/DynamicExtension.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'include/framework/DynamicExtension.h') diff --git a/include/framework/DynamicExtension.h b/include/framework/DynamicExtension.h index 7590de2..89ee30f 100644 --- a/include/framework/DynamicExtension.h +++ b/include/framework/DynamicExtension.h @@ -40,6 +40,10 @@ class DynamicExtension { typedef Epoch _Epoch; typedef BufferView BufView; + static constexpr size_t QUERY = 1; + static constexpr size_t RECONSTRUCTION = 2; + + public: DynamicExtension(size_t buffer_lwm, size_t buffer_hwm, size_t scale_factor, size_t memory_budget=0, size_t thread_cnt=16) @@ -226,6 +230,11 @@ public: return t; } + + void print_scheduler_statistics() { + m_sched.print_statistics(); + } + private: SCHED m_sched; @@ -271,7 +280,7 @@ private: */ epoch->start_job(); - m_sched.schedule_job(reconstruction, 0, args); + m_sched.schedule_job(reconstruction, 0, args, RECONSTRUCTION); /* wait for compaction completion */ wait.get(); @@ -511,7 +520,7 @@ private: args->compaction = false; /* NOTE: args is deleted by the reconstruction job, so shouldn't be freed here */ - m_sched.schedule_job(reconstruction, 0, args); + m_sched.schedule_job(reconstruction, 0, args, RECONSTRUCTION); } std::future> schedule_query(void *query_parms) { @@ -522,7 +531,7 @@ private: args->query_parms = query_parms; auto result = args->result_set.get_future(); - m_sched.schedule_job(async_query, 0, args); + m_sched.schedule_job(async_query, 0, args, QUERY); return result; } -- cgit v1.2.3