summaryrefslogtreecommitdiffstats
path: root/benchmarks/include/file_util.h
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2025-05-29 12:42:42 -0400
committerDouglas Rumbaugh <dbr4@psu.edu>2025-05-29 12:42:42 -0400
commit484818ba5f755c98702b43c84892d7ab3ededa4e (patch)
treeddfd14210adb27b82dee79f5d00f5edc90b5e158 /benchmarks/include/file_util.h
parentfc87a983830b5fd727d7873ae609a038966163a0 (diff)
parentcd961cc231ca3073f03d82b99153a6d0f5a4c7f1 (diff)
downloaddynamic-extension-484818ba5f755c98702b43c84892d7ab3ededa4e.tar.gz
Merge branch 'new-concurrency' of github.com:dbrumbaugh/dynamic-extension-working into new-concurrency
Diffstat (limited to 'benchmarks/include/file_util.h')
-rw-r--r--benchmarks/include/file_util.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/benchmarks/include/file_util.h b/benchmarks/include/file_util.h
index 39b297b..2d340e6 100644
--- a/benchmarks/include/file_util.h
+++ b/benchmarks/include/file_util.h
@@ -87,6 +87,26 @@ static std::vector<QP> read_range_queries(std::string &fname,
}
template <typename QP>
+static std::vector<QP> generate_uniform_range_queries(size_t n, size_t key_limit, double selectivity) {
+ std::vector<QP> queries;
+
+ gsl_rng *rng = gsl_rng_alloc(gsl_rng_mt19937);
+ size_t query_size = key_limit * selectivity;
+
+ for (size_t i=0; i<n; i++) {
+ QP q;
+ q.lower_bound = gsl_rng_uniform_int(rng, key_limit - query_size);
+ q.upper_bound = q.lower_bound + query_size;
+
+ queries.push_back(q);
+ }
+
+ gsl_rng_free(rng);
+
+ return queries;
+}
+
+template <typename QP>
static std::vector<QP> read_sosd_point_lookups(std::string &fname, size_t n) {
std::vector<QP> queries;