Tutorial on building a JMeter+Grafana+influxdb visual performance monitoring platform in docker environment

Tutorial on building a JMeter+Grafana+influxdb visual performance monitoring platform in docker environment

background:

When using the jmeter stress testing interface, I found that its native monitoring was not very user-friendly. When I looked it up online, I found that the report produced by combining influxDB and grafana was very cool, and the monitoring results looked very comfortable and clear.

Preface:

InfluxDB: is an open source distributed time series database written in Go. The database is now mainly used to store large amounts of time-stamped data. The performance is good when the data volume is small, but when the data volume is larger, performance problems will appear. But it's enough to just collect the data from my several hours of testing. If the test data is several months, it is recommended to change to another database.

Time series database: processes data with time labels (which change in the order of time, i.e., time serialization). Data with time labels is also called time series data. Imagine it like a sql table where time is its primary key

Grafana: is an open source software with rich indicator dashboards and graphical editors, suitable for Graphite, Elasticsearch, OpenTSDB, Prometheus, and InfluxDB. To put it simply, it is an open source WEB visualization platform.

principle:

jmeter stress test generates test data --> then asynchronously sends the test data to influxDB for storage through the backend listener in jmeter --> grafana pulls the data from influxDB and displays the relevant data of the test results on the dashboard

Noun understanding in influxdb database

Nouns in influxDB Concepts in traditional databases
database database
measurement Tables in the database
points A row of data in the table

I deployed it on Ubuntu.

1. Install Docker

Since the docker version in the apt official library may be older, uninstall the possible old version first:

sudo apt-get remove docker docker-engine docker-ce docker.io

Update the apt package index:

sudo apt-get update

Install the following packages to enable apt to use the repository over HTTPS:

sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common

Add the official Docker GPG key:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Use the following command to set up the stable repository:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Update the apt package index again:

sudo apt-get update

Install the latest version of Docker CE:

sudo apt-get install -y docker-ce

Check whether Docker is installed:

docker --version

When the docker version is prompted, it means that docker has been installed successfully.

2. Install and configure influxDB

2.1 Install influxDB under Docker View and pull the image

##View the image docker search influx 
 
## Pull the image according to the image name docker pull tutum/influxdb

Run the image and generate a container

## -d runs the service in the background. The command exits but the program continues to run. docker run -d --name jmeter-influx -p 8086:8086 tutum/influxdb

--name jmeter-influx: specifies the name of the generated container as jmeter-influx. You can name it according to your own needs.

-p 8086:8086: specifies port mapping, host port: container port

tutum/influxdb: image name, you can name it according to your own situation

Check whether the container is generated successfully

## Check if the image is successfully installed docker images 
 
## Check whether the container is started successfully docker ps 
 
## View all started containers, including successful and failed docker ps -a 

The browser can access the address: http://xxx.x.xxx.xxx:8086/, the address is the server ip + mapped address

The page prompts 404, but it is not inaccessible.

2.2 Create a database

##Enter the Docker container of Influxdb docker exec -it container id /bin/bash 
 
##Open Influx 
influx 
 
##View the database and create the jmeter database show databases; 
create database jmeter; 
show databases; 
use jmeter; 
select * from jmeter; 
exit; 

3. Grafana installation and configuration

3.1 Install grafana in docker View and pull the image

##View the image docker search grafana 
 
## Pull the image according to the image name docker pull grafana/grafana

Run the image and generate a container

## Run the image and generate a container run -d --name my_grafana -p 3000:3000 grafana/grafana

3.2 Configuring influxDB in Grafana

The browser accesses the URL http://ip:port, and the login username and password are both admin

After successfully logging in, add a data source. Here we choose influxDB. I have successfully created a data source named influxDB_demo

Configure the jmeter database information of the influxDB we created earlier and test whether the connection is successful

At this point, the data source configuration is successful. I already have one, so I deleted this one.

3.3 Grafana creates a dashboard using a template

After configuring the influxdb data source, you can get the test data. Now you need to display the acquired data, which is also the role of grafana graphics.

Download the dashboard template corresponding to jmeter from the official website

Download address: https://grafana.com/grafana/dashboards

Select influxDB from the left and right Data Sources, then search for jmeter by name to see the required plugin.

Import template in grafana

+ sign --> import --> upload JSON file --> select the downloaded jmeter plug-in and configure the relevant information

name: The name of the dashboard, you can define it yourself

Folder: Folder directory, that is, the directory where this dashboard is saved; the default is OK

DB name: the influxdb data source configured earlier

Measurement name: influxDB database name

Backend send interval: interval time

After configuring the information, click [import] to see the dashboard page.

4. Jmeter configuration and stress testing an interface

Configure a backend listener in an interface of a jmeter test

Configure this listener

Backend Listener implementation: The backend listener implementation selects the one with influxdb

influxdbUrl: Change the IP, port, and database name to the IP and port of influxdb, as well as the name of the corresponding database.

After running this interface in jmeter, check the data in the corresponding dashboard in grafana

This is the end of this article about the tutorial on building a JMeter+Grafana+influxdb visual performance monitoring platform in a docker environment. For more information about building a visual performance monitoring platform in docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed explanation of performance monitoring of MySQL server using Prometheus and Grafana
  • Detailed tutorial on grafana installation and usage
  • Use Grafana to display monitoring charts of Docker containers and set email alert rules (illustration)
  • Detailed explanation of the tutorial on monitoring Springboot applications using Prometheus+Grafana
  • Use Grafana+Prometheus to monitor MySQL service performance
  • Detailed explanation of the process of building Prometheus+Grafana based on docker
  • Summary of influx+grafana custom python data collection and some pitfalls
  • Detailed steps for SpringBoot+Prometheus+Grafana to implement application monitoring and alarm
  • How to install grafana and add influxdb monitoring under Linux
  • Analyze the method of prometheus+grafana monitoring nginx
  • Prometheus monitors MySQL using grafana display
  • How to monitor Docker using Grafana on Ubuntu
  • Detailed tutorial on building a JMeter+Grafana+Influxdb monitoring platform with Docker
  • Deploy grafana+prometheus configuration using docker
  • ELK and Grafana jointly create visual monitoring to analyze nginx logs
  • It doesn’t matter if you forget your Grafana password. 2 ways to reset your Grafana admin password

<<:  CSS to achieve Tik Tok subscription button animation effect

>>:  Examples of adding, modifying, deleting and clearing values ​​in MySQL database

Recommend

Implementation of VUE infinite level tree data structure display

Table of contents Component recursive call Using ...

Detailed explanation of concat related functions in MySQL

1. concat() function Function: Concatenate multip...

Detailed explanation of Apache website service configuration based on Linux

As an open source software, Apache is one of the ...

How to display small icons in the browser title bar of HTML webpage

Just like this effect, the method is also very si...

In-depth analysis of the slow query problem of MySQL Sending data

Through an example, I shared with you the solutio...

How to modify mysql to allow remote connections

Regarding the issue of MySQL remote connection, w...

Web data storage: Cookie, UserData, SessionStorage, WebSqlDatabase

Cookie It is a standard way to save the state of ...

MySQL index failure principle

Table of contents 1. Reasons for index failure 2....

MySQL 8.0.18 installation tutorial under Windows (illustration)

Download Download address: https://dev.mysql.com/...

A brief understanding of MySQL SELECT execution order

The complete syntax of the SELECT statement is: (...

Solution to the problem of repeated triggering of functions in Vue project watch

Table of contents Problem description: Solution 1...

How to restore a database and a table from a MySQL full database backup

In the official MySQL dump tool, how can I restor...

Independent implementation of nginx container configuration file

Create a container [root@server1 ~]# docker run -...