From be3bc4918a6c8c0be5bec4966c5112fed35ffe47 Mon Sep 17 00:00:00 2001 From: Susan LoVerso Date: Wed, 2 Dec 2015 15:30:19 -0500 Subject: WT-2257 Fixes when given multiple thread workload configs. --- bench/wtperf/config.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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)); -- cgit v1.2.1 From 7f5b70d1d739b25b014fc7246c9735be80114e8d Mon Sep 17 00:00:00 2001 From: Susan LoVerso Date: Thu, 3 Dec 2015 09:34:08 -0500 Subject: WT-2257 Add more text to multiple workload configs. --- bench/wtperf/wtperf_opt.i | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 " -- cgit v1.2.1 From 884c8e114c368d4e7751e5b5a5828270e0a2058a Mon Sep 17 00:00:00 2001 From: Susan LoVerso Date: Thu, 3 Dec 2015 09:37:27 -0500 Subject: WT-2257 Updated docs --- src/docs/wtperf.dox | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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', -- cgit v1.2.1