diff options
| author | Douglas Rumbaugh <dbr4@psu.edu> | 2025-02-17 16:40:11 -0500 |
|---|---|---|
| committer | Douglas Rumbaugh <dbr4@psu.edu> | 2025-02-17 16:40:11 -0500 |
| commit | f1316e313de5c5286b279cec6ed320cba3eb506f (patch) | |
| tree | c1796e865548eca9bdbd0b7f4bd9fae864e41f71 /benchmarks/tail-latency/mixed_workload.cpp | |
| parent | a162dd2e3be16ff9cd56f80f09f83c4b4b7bc959 (diff) | |
| download | dynamic-extension-f1316e313de5c5286b279cec6ed320cba3eb506f.tar.gz | |
Average version of mixed-workload bench
Diffstat (limited to 'benchmarks/tail-latency/mixed_workload.cpp')
| -rw-r--r-- | benchmarks/tail-latency/mixed_workload.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/benchmarks/tail-latency/mixed_workload.cpp b/benchmarks/tail-latency/mixed_workload.cpp index 517ccd8..f4bfdda 100644 --- a/benchmarks/tail-latency/mixed_workload.cpp +++ b/benchmarks/tail-latency/mixed_workload.cpp @@ -43,7 +43,7 @@ size_t query_ratio = 3; std::atomic<size_t> total_res = 0; size_t reccnt = 0; -size_t thrd_cnt = 0; +size_t g_thrd_cnt = 0; void operation_thread(Ext *extension, std::vector<QP> *queries, std::vector<Rec> *records) { @@ -60,7 +60,7 @@ void operation_thread(Ext *extension, std::vector<QP> *queries, auto res = extension->query(std::move(q)).get(); TIMER_STOP(); - fprintf(stdout, "Q\t%ld\t%ld\n", thrd_cnt, TIMER_RESULT()); + fprintf(stdout, "Q\t%ld\t%ld\n", g_thrd_cnt, TIMER_RESULT()); total_res.fetch_add(res); @@ -78,7 +78,7 @@ void operation_thread(Ext *extension, std::vector<QP> *queries, } TIMER_STOP(); - fprintf(stdout, "I\t%ld\t%ld\n", thrd_cnt, TIMER_RESULT()); + fprintf(stdout, "I\t%ld\t%ld\n", g_thrd_cnt, TIMER_RESULT()); if (idx.load() == reccnt) { inserts_done.store(true); @@ -117,22 +117,22 @@ int main(int argc, char **argv) { reccnt = n; for (auto pol : policies) { - for (size_t i = 0; i < thread_counts.size(); i++) { + for (auto internal_thread_cnt : thread_counts) { auto policy = get_policy<Shard, Q>(sfs[0], buffer_size, pol, n); auto config = Conf(std::move(policy)); config.recon_enable_maint_on_flush = true; config.recon_maint_disabled = false; config.buffer_flush_trigger = 4000; - config.maximum_threads = thread_counts[i]; + config.maximum_threads = internal_thread_cnt; - thrd_cnt = thread_counts[i]; + g_thrd_cnt = internal_thread_cnt; auto extension = new Ext(std::move(config)); /* warmup structure w/ 10% of records */ size_t warmup = .1 * n; - for (size_t j = 0; j < warmup; j++) { - while (!extension->insert(data[j])) { + for (size_t k = 0; k < warmup; k++) { + while (!extension->insert(data[k])) { usleep(1); } } @@ -153,6 +153,8 @@ int main(int argc, char **argv) { } fprintf(stderr, "%ld\n", total_res.load()); + total_res.store(0); + inserts_done.store(false); delete extension; } } |