Class: MixedCRUDWorkload

MixedCRUDWorkload(dbName, collectionNames, nThreads, mongosHosts, retryableWrites, docSize, numberDoc, shardCollections, writeLoadOnly)

new MixedCRUDWorkload(dbName, collectionNames, nThreads, mongosHosts, retryableWrites, docSize, numberDoc, shardCollections, writeLoadOnly)

Creates a MixedCRUDWorkload that can execute workload on the multiple collections and in separate threads.

Parameters:
Name Type Description
dbName String

The database name.

collectionNames Array

The collection names.

nThreads Number

The number of threads to run. Must be a multiple of 4 x collectionNames.length [x mongosHosts.length].

mongosHosts Array

The mongoses hosts if the workload should connect through multiple mongoses.

retryableWrites Boolean

Whether to enable retryable writes. Defaults to false.

docSize Number

The size in bytes of the documents in the workload. Defaults to 100.

numberDoc Number

The number of documents to insert into the collection(s) during initialization. Defaults to 100,000.

shardCollections Boolean

Indicates if, when the target cluster is sharded, the collections should be sharded. Defaults to true.

writeLoadOnly Boolean

Indicates if only write load should be generated. Defaults to false.

Source:

Methods

initialize()

Initializes the collection(s) that are needed for the workload. Must be called before start().

Source:

start()

Starts the workload.

Source:

stop()

Stops the workload and returns a throughput object containing the throughput rates by operation (findOne, query, insert, update, delete) as well as the total.

Source:

(inner) startLoad(ns, nThreads, targetHost)

Starts a workload for one collection on one host.

Parameters:
Name Type Description
ns String

The namespace (i.e. ".").

nThreads Number

The number of threads to run. Must be a multiple of 4.

targetHost String

The host to connect to.

Source: