Skip to content

Commit

Permalink
ycsb: add option to change epoch duration
Browse files Browse the repository at this point in the history
  • Loading branch information
ban-nobuhiro committed Nov 14, 2024
1 parent 7c015d1 commit 992da32
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion bench/ycsb/ycsb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ DEFINE_uint64(thread, 1, "# worker threads."); // NOLINT
DEFINE_string(transaction_type, "short", "type of transaction."); // NOLINT
DEFINE_uint64(val_length, 4, "# length of value(payload)."); // NOLINT
DEFINE_uint64(random_seed, 0, "random seed.");
DEFINE_uint64(epoch_time, 0, "epoch duration in us");

static bool isReady(const std::vector<char>& readys); // NOLINT
static void waitForReady(const std::vector<char>& readys);
Expand Down Expand Up @@ -204,6 +205,12 @@ static void load_flags() {
printf("FLAGS_random_seed : (unset)\n"); // NOLINT
}

if (!gflags::GetCommandLineFlagInfoOrDie("epoch_time").is_default) {
printf("FLAGS_epoch_time : %zu\n", FLAGS_epoch_time); // NOLINT
} else {
printf("FLAGS_epoch_time : (unset)\n"); // NOLINT
}

printf("Fin load_flags()\n"); // NOLINT
}

Expand All @@ -215,7 +222,12 @@ int main(int argc, char* argv[]) try { // NOLINT
FLAGS_stderrthreshold = 0; // to display info log
load_flags();

init(); // NOLINT
database_options opt{};
if (!gflags::GetCommandLineFlagInfoOrDie("epoch_time").is_default) {
opt.set_epoch_time(FLAGS_epoch_time);
}

init(opt); // NOLINT
LOG(INFO) << "start build_db";
build_db(FLAGS_record, FLAGS_key_length, FLAGS_val_length, FLAGS_thread);
LOG(INFO) << "start invoke_leader";
Expand Down

0 comments on commit 992da32

Please sign in to comment.