-
Notifications
You must be signed in to change notification settings - Fork 11
/
bench_ycsb.cpp
46 lines (35 loc) · 1.36 KB
/
bench_ycsb.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "benchmark/ycsb/Database.h"
#include "core/Coordinator.h"
#include "core/Macros.h"
DEFINE_int32(read_write_ratio, 80, "read write ratio");
DEFINE_int32(read_only_ratio, 0, "read only transaction ratio");
DEFINE_int32(cross_ratio, 0, "cross partition transaction ratio");
DEFINE_int32(keys, 200000, "keys in a partition.");
DEFINE_double(zipf, 0, "skew factor");
DEFINE_int32(nop_prob, 0, "prob of transactions having nop, out of 10000");
DEFINE_int64(n_nop, 0, "total number of nop");
// ./main --logtostderr=1 --id=1 --servers="127.0.0.1:10010;127.0.0.1:10011"
// cmake -DCMAKE_BUILD_TYPE=Release
int main(int argc, char *argv[]) {
google::InitGoogleLogging(argv[0]);
google::InstallFailureSignalHandler();
google::ParseCommandLineFlags(&argc, &argv, true);
star::ycsb::Context context;
SETUP_CONTEXT(context);
context.readWriteRatio = FLAGS_read_write_ratio;
context.readOnlyTransaction = FLAGS_read_only_ratio;
context.crossPartitionProbability = FLAGS_cross_ratio;
context.keysPerPartition = FLAGS_keys;
context.nop_prob = FLAGS_nop_prob;
context.n_nop = FLAGS_n_nop;
if (FLAGS_zipf > 0) {
context.isUniform = false;
star::Zipf::globalZipf().init(context.keysPerPartition, FLAGS_zipf);
}
star::ycsb::Database db;
db.initialize(context);
star::Coordinator c(FLAGS_id, db, context);
c.connectToPeers();
c.start();
return 0;
}