JMeter Configuring MongoDB

Source: Internet
Author: User
Tags mongodb server

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.