IT-Academy-BCN / ita-challenges-backend

Backend of ITA Challenges Project
MIT License
13 stars 12 forks source link

Testing JMeter: measure response times of MongoDB #464

Open jonatanvicente opened 3 months ago

jonatanvicente commented 3 months ago

We need measure the response time of MongoDB in tests executed by JMeter. You can use the MongoDB Source Config and MongoDB Script Sampler provided by the JMeter Plugins Manager.

Here's a step-by-step guide (AI based):

  1. Install the JMeter Plugins Manager if you haven't already. You can download it from the JMeter Plugins website and follow the installation instructions.

  2. Open JMeter and go to "Options" -> "Plugins Manager". In the "Available Plugins" tab, find and install "JMeter MongoDB Sampler".

  3. After installing the plugin, restart JMeter. You should now see MongoDB Source Config and MongoDB Script Sampler in the list of available samplers.

  4. Add a "Thread Group" to your Test Plan.

  5. Inside the Thread Group, add a "MongoDB Source Config". This is where you will configure the connection to your MongoDB instance. Fill in the necessary details such as database server, port, and database name.

  6. Add a "MongoDB Script Sampler" inside the Thread Group. This is where you will write your MongoDB script. You can write scripts to perform various operations like find, insert, update, etc.

  7. To measure the response time, add a "Summary Report" or "Aggregate Report" listener to your Test Plan. This will show you the average, median, min, and max response times for your MongoDB operations.

Msoler92 commented 3 months ago

Testeado en localhost, ejecutando tests con 1 y 10 queries por segundo durante 1000 segundos. Los tiempos de respuesta se mantienen por debajo de 10 de forma consistente con un único pico en la primera conexión.