Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,8 @@ struct Option {
INDEX_COLUMNS,
NO_AUTO_INC,
NO_DESC_INDEX,
NO_TEMPORARY,
NO_PARTITION,
ONLY_TEMPORARY,
ONLY_PARTITION,
TEMPORARY_TO_NORMAL_RATIO,
INITIAL_RECORDS_IN_TABLE,
NUMBER_OF_SECONDS_WORKLOAD,
ALTER_TABLE_ENCRYPTION,
Expand Down Expand Up @@ -120,7 +117,7 @@ struct Option {
MYSQLD_SERVER_OPTION = 'z',
TRANSATION_PRB_K,
TRANSACTIONS_SIZE,
COMMMIT_TO_ROLLBACK_RATIO,
COMMIT_PROB,
SAVEPOINT_PRB_K,
CHECK_TABLE,
CHECK_TABLE_PRELOAD,
Expand All @@ -143,6 +140,12 @@ struct Option {
DROP_CREATE,
EXACT_INITIAL_RECORDS,
PREPARE,
NO_TEMPORARY,
NO_PARTITION,
NO_FK,
FK_PROB,
PARTITION_PROB,
TEMPORARY_PROB,
MAX
} option;
Option(Type t, Opt o, std::string n)
Expand Down
56 changes: 35 additions & 21 deletions src/help.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,13 @@ void add_options() {
opt->setArgs(no_argument);
opt->setBool(false);

/* No FK tables */
opt = newOption(Option::BOOL, Option::NO_FK, "no-fk-tables");
opt->help = "do not work on foriegn tables";
opt->setArgs(no_argument);
opt->setBool(false);


/* No Partition tables */
opt = newOption(Option::BOOL, Option::NO_PARTITION, "no-partition-tables");
opt->help = "do not work on partition tables";
Expand All @@ -241,12 +248,21 @@ void add_options() {
opt->setArgs(no_argument);
opt->setBool(false);

opt = newOption(Option::INT, Option::FK_PROB, "fk-prob");
opt->help = R"(
Probability of each normal table having the FK. Currently, FKs are only linked
to the primary key of the parent table. So, even with 100% probability, a table
will have an FK only if its parent has a primary key.
)";
opt->setInt(50);

opt = newOption(Option::INT, Option::PARTITION_PROB, "partition-prob");
opt->help = "Probability of parititon tables";
opt->setInt(10);

/* Ratio of temporary table to normal table */
opt = newOption(Option::INT, Option::TEMPORARY_TO_NORMAL_RATIO,
"ratio-normal-temp");
opt->help = "ratio of normal to temporary tables. for e.g. if ratio to "
"normal table to temporary is 10 . --tables 40. them only 4 "
"temorary table will be created per session";
opt = newOption(Option::INT, Option::TEMPORARY_PROB, "temporary-prob");
opt->help = "Probability of temporary tables";
opt->setInt(10);

/* Initial Records in table */
Expand All @@ -270,7 +286,7 @@ void add_options() {
opt->setInt(1000);

/* primary key probability */
opt = newOption(Option::INT, Option::PRIMARY_KEY, "primary-key-probability");
opt = newOption(Option::INT, Option::PRIMARY_KEY, "pk-prob");
opt->help = "Probability of adding primary key in a table";
opt->setInt(50);

Expand Down Expand Up @@ -677,7 +693,7 @@ void add_options() {
opt =
newOption(Option::BOOL, Option::LOG_QUERY_DURATION, "log-query-duration");
opt->help = "Log query duration in milliseconds";
opt->setBool(true);
opt->setBool(false);
opt->setArgs(no_argument);

/* log failed queries */
Expand Down Expand Up @@ -707,28 +723,26 @@ void add_options() {
opt->setArgs(no_argument);

/* transaction probability */
opt = newOption(Option::INT, Option::TRANSATION_PRB_K, "trx-prb-k");
opt = newOption(Option::INT, Option::TRANSATION_PRB_K, "trx-prob-k");
opt->help = "probability(out of 1000) of combining sql as single trx";
opt->setInt(10);
opt->setInt(1);

/* tranasaction size */
opt = newOption(Option::INT, Option::TRANSACTIONS_SIZE, "trx-size");
opt->help = "average size of each trx";
opt->setInt(100);

/* commit to rollback ratio */
opt = newOption(Option::INT, Option::COMMMIT_TO_ROLLBACK_RATIO,
"commit-rollback-ratio");
opt->help = "ratio of commit to rollback. e.g.\nif 5, then 5 "
"transactions will be committed and 1 will be rollback.\n"
"if 0 then all transactions will be rollback";
opt->setInt(5);
opt->setInt(10);

/* probability of executing commit */
opt = newOption(Option::INT, Option::COMMIT_PROB, "commit-prob");
opt->help = "probability of executing commit after a transaction. Else it "
"would be rollback ";
opt->setInt(95);

/* number of savepoints in trxs */
opt = newOption(Option::INT, Option::SAVEPOINT_PRB_K, "savepoint-prb-k");
opt->help = "probability of using savepoint in a transaction.\n Also 25% "
opt = newOption(Option::INT, Option::SAVEPOINT_PRB_K, "savepoint-prob-k");
opt->help = "probability of using savepoint in a transaction.\n Also 10% "
"such transaction will be rollback to some savepoint";
opt->setInt(50);
opt->setInt(10);

/* steps */
opt = newOption(Option::INT, Option::STEP, "step");
Expand Down
Loading