Skip to content

Tutorials

JMeter ecosystem for your Performance test through docker-compose, monitor, and mock your services

If you'd like to carry out load tests in a simple way, benefit from a simplified configuration with a focus on writing your test plan and its test typology, have the opportunity to monitor through detailed dashboards, store your metrics, and also mock one or several services: you are at the right place!

With this kind of configuration you will be able to make shift-left performance testing as well!

docker-compose is a small library that allows you to run docker-compose This is useful to bootstrap test environments. Docker Compose offers a multitude of benefits which I'll detail below:

  • Simplified configuration: Docker Compose lets you define and manage all the services of a multi-container application in a single YAML file. This makes it easy to configure, start and stop all the containers in an application.
  • Automated deployment: With a single configuration file, you can automate the deployment of all the services required for your application, reducing manual errors and improving consistency between development, test and production environments.
  • Managing dependencies : Compose makes it easy to manage dependencies between services. You can define the startup order of containers and the links between them, ensuring that all services start up in the right order and are properly connected.
  • Portability: Once you've defined your Compose file, you can easily share it and run it on different machines. This ensures that developers and operational teams work in identical environments, reducing compatibility problems.
  • Service isolation: Docker Compose creates isolated networks for containers, ensuring that each service operates in a partitioned environment. This improves security and enables services to be tested without mutual interference.
  • Scalability: Compose makes it easy to scale services. You can quickly adjust the number of containers for a particular service by simply modifying the configuration file and redeploying.
  • Local development and easy testing: Developers can use Docker Compose to create local development environments that faithfully reproduce production environments. This enables problems to be detected and resolved early in the development cycle.
  • CI/CD integration: Docker Compose integrates well with continuous integration and deployment (CI/CD) pipelines. You can use Compose files to orchestrate automatic tests and deployments in your CI/CD workflows.
  • Simplified maintenance: With Docker Compose, updating configurations and services becomes simpler. You can update container images or modify configurations by modifying the Compose file and redeploying services.

Build your own JMeter Docker Image and execute your Performance Test

If you'd like to run load tests in a simple way, and possibly share them, while benefiting from a simplified configuration, with a focus on writing your test plan, and its test typology, this article is for you!

Docker offers virtualization services that simplify the replication of working environments.

Furthermore, each virtualized service is isolated from unrelated services on other containers or the host machine, ensuring portability across host machines and the network.

Using JMeter within a Docker container offers several advantages :

Portability :

Docker enables the creation of lightweight and portable containers that can run on any Docker-compatible system, whether it's Linux, macOS, or Windows. This simplifies the deployment and management of JMeter, avoiding compatibility issues related to different system configurations.

Isolation :

Docker containers provide an isolated environment for running applications, meaning JMeter's dependencies and runtime environment are encapsulated within the container. This reduces potential conflicts with other applications or system components.

Ease of deployment :

With Docker, distributing and deploying JMeter across multiple machines or environments is straightforward.

You can create a Docker image containing JMeter and distribute it to your team or various test environments, streamlining the deployment process.

Version management :

By using Docker, you can version your Docker images containing JMeter, facilitating the management of different versions of JMeter used in your tests. You can also share these images via public or private Docker registries

Use JMeter to create a website crawler

The idea behind this blog post originated when we updated our documentation after the release of our new UI. We had to identify all links used in the OctoPerf website and update them from https://doc.octoperf.com to https://api.octoperf.com/doc. With more than 250 blog posts at the time I'm writing this one, you can see how this could prove challenging. And of course the twist is that we also took this opportunity to reorganize the documentation so it's not as simple as a search and replace of the domain.

This got us thinking on ways to automate it, because a lot of third party links could also be broken and of course one of those ways is to use OctoPerf itself to execute JMeter tests that will report on all the broken links.

Troubleshoot your tests

Preparing resilient tests can be a challenging process when you do not know where to start. We will cover this in this guide, from the virtual user validation to smoke testing. And then analyzing the most common errors and how to fix them. Note that we also recommend reading this other guide, it can greatly help understand the analysis and report engine of OctoPerf.

As a final note before we start, as much as you might want to jump to the relevant section of this guide, I strongly recommend you take a few minutes to read the next section since proper test preparation is essential to a strong error analysis later.

Analyze your load tests

OctoPerf's report engine provides many graphs to sort and presents test metrics in a comprehensive way. We've tried to improve it over the years so that you can access critical information very quickly. But requirements vary from one project to the other.

In this post we will look at how you can configure the report to show your preferred metrics, and also all the shortcuts you can take to achieve this goal.

The best example is the Report summary, it allows you to navigate between all the items in a few clicks:

report-summary