-
Download JMeter (should be >= version 5.4.1).
-
Add the latest DocumentDbDriver
.jar
to/lib
folder of your JMeter installation.
If targeting a cluster that has not been used for JMeter testing before,
you will need to insert the relevant test data beforehand.
Use mongoimport
to insert the data from /testData
, using the name of each file as the collection name and “jmeter” as the database.
A potential enhancement could be to automate this.
-
Open the
DocumentDb_Test_Plan.jmx
file in JMeter. -
Start an SSH tunnel for the target cluster.
-
Click on the
DocumentDb Test Plan
element. Change user variablesCONNECTION_STRING
,USERNAME
, andPASSWORD
depending on SSH tunnel setup and target cluster. -
Run the test plan.
-
Start an SSH tunnel for target cluster.
-
Run the
DocumentDb_Test_Plan.jmx
file. Pass connection string (-JconnectionString
), username(-Jusername
), and password(-Jpassword
) as parameters. Connection string and username may be omitted as they have default values but password is required. Example:./jmeter.sh -n -t DocumentDb_Test_Plan.jmx -Jpassword=<password>
-
It may be useful to run the tests against another data source to confirm expected functionality. The user variables
CONNECTION_STRING
,USERNAME
, andPASSWORD
can be changed to be used with another driver. -
Dependencies of the other driver may need to be setup and/or added to the JMeter
/lib
folder. Refer to JMeter documentation and documentation of the specific database vendor for more information.
- Add test data as a
JSON
file under the/testData
folder. Use MongoDB Extended JSON syntax to explicitly specify types.
-
To add a query, you need to add a new row in
Test_Plan.csv
. -
Populate the
query
column with the query to be executed, theresult
column with the expected result set, and thetest_name
column with a descriptive name for the query. -
To keep results uniform across different data sources for easier comparisons:
-
Columns are ordered explicitly instead of using
SELECT *
so column order is deterministic. -
Rows are ordered explicitly with
ORDER BY
so row order is deterministic. -
Calculated fields are named explicitly with
AS
so they always use same name.
-