2015-01-07 23:24:23 +01:00
|
|
|
'use strict';
|
|
|
|
|
2016-03-09 18:17:50 +01:00
|
|
|
load('jstests/concurrency/fsm_libs/extend_workload.js'); // for extendWorkload
|
|
|
|
load('jstests/concurrency/fsm_example.js'); // for $config
|
2014-11-19 17:54:45 +01:00
|
|
|
|
|
|
|
// extendWorkload takes a $config object and a callback, and returns an extended $config object.
|
2016-03-09 18:17:50 +01:00
|
|
|
var $config = extendWorkload($config,
|
|
|
|
function($config, $super) {
|
|
|
|
// In the callback, $super is the base workload definition we're
|
|
|
|
// extending,
|
|
|
|
// and $config is the extended workload definition we're creating.
|
2014-11-19 17:54:45 +01:00
|
|
|
|
2016-03-09 18:17:50 +01:00
|
|
|
// You can replace any properties on $config, including methods you
|
|
|
|
// want to override.
|
|
|
|
$config.setup = function(db, collName, cluster) {
|
|
|
|
// Overridden methods should usually call the corresponding
|
|
|
|
// method on $super.
|
|
|
|
$super.setup.apply(this, arguments);
|
2014-11-19 17:54:45 +01:00
|
|
|
|
2016-03-09 18:17:50 +01:00
|
|
|
db[collName].ensureIndex({exampleIndexedField: 1});
|
|
|
|
};
|
2014-11-19 17:54:45 +01:00
|
|
|
|
2016-03-09 18:17:50 +01:00
|
|
|
return $config;
|
|
|
|
});
|