diff options
author | sueloverso <sue@mongodb.com> | 2015-12-03 09:46:27 -0500 |
---|---|---|
committer | sueloverso <sue@mongodb.com> | 2015-12-03 09:46:27 -0500 |
commit | 2df5658da316d60fcfeec0e94467af48d63cb885 (patch) | |
tree | e3fb04e2325a3f8d9d8d917ef851d730a3444ac8 | |
parent | c1013cee062e74b8c3844489563373907264360c (diff) | |
parent | 884c8e114c368d4e7751e5b5a5828270e0a2058a (diff) | |
download | mongo-2df5658da316d60fcfeec0e94467af48d63cb885.tar.gz |
Merge pull request #2356 from wiredtiger/wtperf-2257
WT-2257 Fixes when given multiple thread workload configs.
-rw-r--r-- | bench/wtperf/config.c | 10 | ||||
-rw-r--r-- | bench/wtperf/wtperf_opt.i | 4 | ||||
-rw-r--r-- | src/docs/wtperf.dox | 5 |
3 files changed, 15 insertions, 4 deletions
diff --git a/bench/wtperf/config.c b/bench/wtperf/config.c index 6b0ce47ef3f..a0ff5c6699d 100644 --- a/bench/wtperf/config.c +++ b/bench/wtperf/config.c @@ -181,6 +181,16 @@ config_threads(CONFIG *cfg, const char *config, size_t len) int ret; group = scan = NULL; + if (cfg->workload != NULL) { + /* + * This call overrides an earlier call. Free and + * reset everything. + */ + free(cfg->workload); + cfg->workload = NULL; + cfg->workload_cnt = 0; + cfg->workers_cnt = 0; + } /* Allocate the workload array. */ if ((cfg->workload = calloc(WORKLOAD_MAX, sizeof(WORKLOAD))) == NULL) return (enomem(cfg)); diff --git a/bench/wtperf/wtperf_opt.i b/bench/wtperf/wtperf_opt.i index be3ba462e0c..3b57db36f8c 100644 --- a/bench/wtperf/wtperf_opt.i +++ b/bench/wtperf/wtperf_opt.i @@ -164,8 +164,8 @@ DEF_OPT_AS_STRING(threads, "", "workload configuration: each 'count' " "'update' entries are the ratios of insert, read and update operations " "done by each worker thread; If a throttle value is provided each thread " "will do a maximum of that number of operations per second; multiple " - "workload configurations may be " - "specified; for example, a more complex threads configuration might be " + "workload configurations may be specified per threads configuration; " + "for example, a more complex threads configuration might be " "'threads=((count=2,reads=1)(count=8,reads=1,inserts=2,updates=1))' " "which would create 2 threads doing nothing but reads and 8 threads " "each doing 50% inserts and 25% reads and updates. Allowed configuration " diff --git a/src/docs/wtperf.dox b/src/docs/wtperf.dox index fb46a91a62c..867d882e0d8 100644 --- a/src/docs/wtperf.dox +++ b/src/docs/wtperf.dox @@ -230,8 +230,9 @@ threads, and the 'insert', 'read' and 'update' entries are the ratios of insert, read and update operations done by each worker thread; If a throttle value is provided each thread will do a maximum of that number of operations per second; multiple workload configurations may -be specified; for example, a more complex threads configuration might -be 'threads=((count=2,reads=1)(count=8,reads=1,inserts=2,updates=1))' +be specified per threads configuration; for example, a more complex +threads configuration might be +'threads=((count=2,reads=1)(count=8,reads=1,inserts=2,updates=1))' which would create 2 threads doing nothing but reads and 8 threads each doing 50% inserts and 25% reads and updates. Allowed configuration values are 'count', 'throttle', 'reads', 'inserts', |