diff options
Diffstat (limited to 'jstests/concurrency/fsm_workloads/count_indexed.js')
-rw-r--r-- | jstests/concurrency/fsm_workloads/count_indexed.js | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/jstests/concurrency/fsm_workloads/count_indexed.js b/jstests/concurrency/fsm_workloads/count_indexed.js index b9c09020042..77edf8da6ef 100644 --- a/jstests/concurrency/fsm_workloads/count_indexed.js +++ b/jstests/concurrency/fsm_workloads/count_indexed.js @@ -14,31 +14,26 @@ load('jstests/concurrency/fsm_libs/extend_workload.js'); // for extendWo load('jstests/concurrency/fsm_workloads/count.js'); // for $config load('jstests/concurrency/fsm_workload_helpers/drop_utils.js'); // for dropCollections -var $config = extendWorkload( - $config, - function($config, $super) { - $config.data.prefix = 'count_fsm'; - $config.data.shardKey = { - tid: 1, - i: 1 - }; +var $config = extendWorkload($config, function($config, $super) { + $config.data.prefix = 'count_fsm'; + $config.data.shardKey = {tid: 1, i: 1}; - $config.data.getCount = function getCount(db, predicate) { - var query = Object.extend({tid: this.tid}, predicate); - return db[this.threadCollName].find(query).hint({tid: 1, i: 1}).count(); - }; + $config.data.getCount = function getCount(db, predicate) { + var query = Object.extend({tid: this.tid}, predicate); + return db[this.threadCollName].find(query).hint({tid: 1, i: 1}).count(); + }; - $config.states.init = function init(db, collName) { - this.threadCollName = this.prefix + '_' + this.tid; - $super.states.init.apply(this, arguments); - assertAlways.commandWorked(db[this.threadCollName].ensureIndex({tid: 1, i: 1})); - }; + $config.states.init = function init(db, collName) { + this.threadCollName = this.prefix + '_' + this.tid; + $super.states.init.apply(this, arguments); + assertAlways.commandWorked(db[this.threadCollName].ensureIndex({tid: 1, i: 1})); + }; - $config.teardown = function teardown(db, collName) { - var pattern = new RegExp('^' + this.prefix + '_\\d+$'); - dropCollections(db, pattern); - $super.teardown.apply(this, arguments); - }; + $config.teardown = function teardown(db, collName) { + var pattern = new RegExp('^' + this.prefix + '_\\d+$'); + dropCollections(db, pattern); + $super.teardown.apply(this, arguments); + }; - return $config; - }); + return $config; +}); |