Skip to content

Commit 8ed94cc

Browse files
elad-ashushachar
authored andcommitted
Fix Random issues (#19)
The reason for the problem is that the call for setting object was done after the use of the configurable vaiable. The fix was to move it earlier.
1 parent fb6888d commit 8ed94cc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

memtier_benchmark.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,9 @@ int main(int argc, char *argv[])
10571057
usage();
10581058
}
10591059
}
1060+
if (!cfg.data_import) {
1061+
obj_gen->set_random_data(cfg.random_data);
1062+
}
10601063

10611064
if (cfg.select_db > 0 && strcmp(cfg.protocol, "redis")) {
10621065
fprintf(stderr, "error: select-db can only be used with redis protocol.\n");
@@ -1091,10 +1094,6 @@ int main(int argc, char *argv[])
10911094
fprintf(stderr, "error: data-size, data-size-list or data-size-range must be specified.\n");
10921095
usage();
10931096
}
1094-
1095-
if (!cfg.data_import) {
1096-
obj_gen->set_random_data(cfg.random_data);
1097-
}
10981097

10991098
if (!cfg.data_import || cfg.generate_keys) {
11001099
obj_gen->set_key_prefix(cfg.key_prefix);

0 commit comments

Comments
 (0)