1, start JMeter, right-click Add-config file->mongodb Source config.
Note: JMeter 3.0 or later removes this configuration item and can be copied from a lower version.
2. Setting MongoDB profile Properties
Server address list:192.168.2.101 (MongoDB server addresses),
MongoDB source:db, (MongoDB data source name, which is called later in this configuration)
3, the thread group right-click Add-sampler-jsr223 Sampler
Set the JSR223 Sampler property:
Language: Select Java, need Mongo-java-driver-2.*.* driver, put in JMeter installation directory \lib below
Script: (Scripting reference: Https://www.blazemeter.com/blog/how-load-test-mongodb-jmeter)
Import Com.mongodb.db;import org.apache.jmeter.protocol.mongodb.config.mongodbholder;db DB = Mongodbholder.getdbfromsource ("Previously configured data source name", "MongoDB database");
4, the thread group right-click Add-sampler-mongodb Script
Set the MongoDB Script property
MongoDB Source:db (refer to the name set in MongoDB Source config)
Database Name:mongodb DB Name
Username/password: Database Connection account number and password
Script:mongodb Script
5. Right button-listener-view result tree
You can test MongoDB.
JMeter Configuring MongoDB