summaryrefslogtreecommitdiffstats
path: root/include/framework
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2025-04-30 13:06:56 -0400
committerDouglas Rumbaugh <dbr4@psu.edu>2025-04-30 13:06:56 -0400
commitaa15300f8302bf713d752a775f32060b59b8746f (patch)
tree7520c84f04da657cc67b3a03ad7ba0448e3ac86d /include/framework
parent81d3ef3cb4a00d566978ebca511fd947f3ef9b1b (diff)
downloaddynamic-extension-aa15300f8302bf713d752a775f32060b59b8746f.tar.gz
Stats tweaks and KNN benchmark
Diffstat (limited to 'include/framework')
-rw-r--r--include/framework/scheduling/FIFOScheduler.h1
-rw-r--r--include/framework/scheduling/SerialScheduler.h1
-rw-r--r--include/framework/scheduling/statistics.h11
3 files changed, 12 insertions, 1 deletions
diff --git a/include/framework/scheduling/FIFOScheduler.h b/include/framework/scheduling/FIFOScheduler.h
index 2f49b5f..8fbe07c 100644
--- a/include/framework/scheduling/FIFOScheduler.h
+++ b/include/framework/scheduling/FIFOScheduler.h
@@ -36,6 +36,7 @@ public:
m_thrd_cnt((thread_cnt) ? thread_cnt : DEFAULT_MAX_THREADS),
m_used_memory(0), m_used_thrds(0), m_shutdown(false) {
m_sched_thrd = std::thread(&FIFOScheduler::run, this);
+ m_counter.store(0);
m_thrd_pool.resize(m_thrd_cnt);
}
diff --git a/include/framework/scheduling/SerialScheduler.h b/include/framework/scheduling/SerialScheduler.h
index 7cd9cfc..b6ebe53 100644
--- a/include/framework/scheduling/SerialScheduler.h
+++ b/include/framework/scheduling/SerialScheduler.h
@@ -40,6 +40,7 @@ public:
void shutdown() { /* intentionally left blank */ }
void print_statistics() { m_stats.print_statistics(); }
+ void print_query_time_data() { m_stats.print_query_time_data(); }
private:
[[maybe_unused]] size_t m_memory_budget;
diff --git a/include/framework/scheduling/statistics.h b/include/framework/scheduling/statistics.h
index 304a0c4..34699f1 100644
--- a/include/framework/scheduling/statistics.h
+++ b/include/framework/scheduling/statistics.h
@@ -16,6 +16,7 @@
#include <atomic>
#include <cassert>
#include <chrono>
+#include <cstdint>
#include <cstdlib>
#include <mutex>
#include <unordered_map>
@@ -113,6 +114,9 @@ public:
int64_t query_cnt = 0;
+ size_t worst_query = 0;
+ size_t first_query = UINT64_MAX;
+
/* hard-coded for the moment to only consider queries */
for (auto &job : m_jobs) {
@@ -120,6 +124,10 @@ public:
continue;
}
+ if (job.first < first_query) {
+ first_query = job.first;
+ }
+
total_queue_time += job.second.time_in_queue();
total_runtime += job.second.runtime();
@@ -133,6 +141,7 @@ public:
if (job.second.runtime() > max_runtime) {
max_runtime = job.second.runtime();
+ worst_query = job.first;
}
if (job.second.runtime() < min_runtime) {
@@ -163,7 +172,7 @@ public:
int64_t runtime_stddev = std::sqrt(runtime_deviation_sum / query_cnt);
- fprintf(stdout, "Query Count: %ld\n", query_cnt);
+ fprintf(stdout, "Query Count: %ld\tWorst Query: %ld\tFirst Query: %ld\n", query_cnt, worst_query, first_query);
fprintf(stdout, "Average Query Scheduling Delay: %ld\t Min Scheduling Delay: %ld\t Max Scheduling Delay: %ld\tStandard Deviation: %ld\n", average_queue_time, min_queue_time, max_queue_time, queue_stddev);
fprintf(stdout, "Average Query Latency: %ld\t\t Min Query Latency: %ld\t Max Query Latency: %ld\tStandard Deviation: %ld\n", average_runtime, min_runtime, max_runtime, runtime_stddev);
}