Skip to content

Small JMeter plugin to inject documents in Mongo.

License

Notifications You must be signed in to change notification settings

rmorgade/mloadgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mloadgen


Mloadgen is a Mongo Document injector for MongoDB. It let you insert documents in the specified collection.

Getting Started


MLoadGen had only a component which is a Java Request Sampler. It let you configure the connection to a mongo server define the collection and the document you wanto insert in.

Setup


Requirement

MLoadGen uses Java, hence on JMeter machine JRE 8 or superior:

Install openjdk on Debian, Ubuntu, etc.,

 sudo apt-get install openjdk-8-jdk

Install openjdk on Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.,

 su -c "yum install java-1.8.0-openjdk-devel"

For windows and mac and you can:

 brew tap adoptopenjdk/openjdk
 brew cask install adoptopenjdk8

Build Project

 mvn clean install

Once build is completed, copy target/mloadgen-&gtversion>.jar file to JMETER_HOME/lib/ext directory. You also need to replace the mongo library version shipped with JMeter to at least the same defined in the pom.xml. Nowadays Jmeter version 5.2 use the version 2.11.3, which is quite old for this plugin and if you try to connect the modern mongo cluster.

MLoadGenSampler

  • hostname : Mongodb server hort name or Master server in a Mongo Cluster.
  • port : Mongodb server port.
  • username : User name allowed to insert documents.
  • password : Password for the account.
  • dbname : Data base name where collection is.
  • collection : Collection where we want to insert documents.
  • document : Document in JSON format we want to insert.

Document will be converted into BSON Document and inserted in the collection. The collection name is validated, if it is not in the server, the collection will not be created. Just to avoid duplicated collections and missdirections.

MLoadGen Sampler

About

Small JMeter plugin to inject documents in Mongo.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages