当前位置:网站首页>Jmeter+grafana+influxdb build a visual performance test monitoring platform
Jmeter+grafana+influxdb build a visual performance test monitoring platform
2022-06-24 16:56:00 【Tanyin】
【 The background that 】
Use jmeter When performing a performance test , The way the tool comes with to view the results is often not intuitive and clear , So we need to build a visual monitoring platform to monitor the results , Here we use three JMeter+Grafana+Influxdb To complete the platform construction
【 Realization principle 】
adopt influxdb Database storage jmeter Result , Re pass grafana collection influxdb Database data , Complete the display of monitoring platform
【 Platform building 】
Method 1 :Windows or macOS Build... In the environment
1.InfluxDB install
First of all to enter influxDB Download the installation package on the official website
https://portal.influxdata.com/downloads/
Windows You can use the following link to download directly
https://dl.influxdata.com/influxdb/releases/influxdb-1.7.9_windows_amd64.zip
Decompress after downloading , With Windows For example :
After entering the folder, you can see the following directory
Click on influxd.exe Start database , Start successfully as shown in the figure below
Click on influx.exe Get into influxdb client , After entering, create the name as “jmeter” The database of
2.grafana install
First of all to enter grafana Download the installation package on the official website
https://grafana.com/grafana/download
Select the corresponding system and download , With Windows For example :
After decompression, enter bin Directory clicking grafana-server.exe To start up grafana Program
After startup, open the browser for input http://localhost:3000 Get into grafana The login page
The default username and password are admin, After entering the home page, click Add database
choice influxdb database , Fill in the following information
Click on sava&test, Show data source is working Indicates that the database connection is successful
Import the downloaded dashboard
You can also go to grafana Find templates on the official website , Enter the required template in the import template Downlosds Just number
https://grafana.com/grafana/dashboards
Finally, as shown in the figure
3.jmeter To configure
1.jmeter in , add to “ Monitor -> Back end listener ”
Configure the back-end listener , The purpose is to jmeter The results are stored in influxdb database
Method 2 :Linux Build... In the environment
1.influxdb install
Use the command to install influxdb
wget https://dl.influxdata.com/influxdb/releases/influxdb-1.8.4_linux_amd64.tar.gz
decompression influxdb Compressed package
tar -zxvf influxdb-1.8.4_linux_amd64.tar.gz
Add environment variables
cd influxdb-1.8.4-1/usr/bin
sudo cp {influx,influxd} /usr/local/bin/start-up influxdb
influxd
start-up influxdb client , establish jmeter database
influx create databases jmeter
2.grafana install
Use the command to install
wget https://dl.grafana.com/oss/release/grafana-7.5.2.linux-amd64.tar.gz
Unzip the installation package
tar -zxvf grafana-7.5.2.linux-amd64.tar.gz
start-up grafana
cd grafana-7.5.2/bin ./grafana-server
visit grafana Webpage , Other operations are the same as method 1
http://ip:3000
3.jdk+jmeter install
install jmeter It needs to be installed before jdk, download jdk( You can use the following address to download , You can also download it from the official website , You need to log in to the official website oracle)https://www.jdkdownload.com/, I choose jdk-8u181-linux-x64.tar.gz Version download
decompression jdk
tar -zxvf jdk-8u181-linux-x64.tar.gz
Configure environment variables , Modify the configuration file vi /etc/profile, Add the following at the end of the text
JAVA_HOME=/usr/local/java/jdk1.8.0_181 CLASSPATH=$JAVA_HOME/lib/ PATH=$PATH:$JAVA_HOME/bin export PATH JAVA_HOME CLASSPATH
Enable environment variables
source /etc/profile
verification jdk Configuration is successful
java -version
Use the command to install jmeter
wget https://mirrors.bfsu.edu.cn/apache//jmeter/binaries/apache-jmeter-5.4.1.tgz
decompression jmeter
tar -zxf apache-jmeter-5.4.1.tgz
To configure jmeter environment variable ,vi /etc/profile, Add the following at the end of the text
export JMETER_HOME=/usr/local/apache-jmeter-5.4.1 export CLASSPATH=$JMETER_HOME/lib/ext/ApacheJMeter_core.jar:$JMETER_HOME/lib/jorphan.jar:$CLASSPATH export PATH=$JMETER_HOME/bin:$PATH
Enable environment variables
source /etc/profile
verification jmeter Configuration is successful
jmeter --version
take jmeter Upload the script to the current folder , Execute the following command to start jmeter
jmeter -n -t ***.jmx -l test.jtl Parameter description : -n Not GUI Pattern -> In Africa GUI Run in mode JMeter -t The test file -> To run JMeter Test script file -l Log files -> Documentation of results
Method 3 :docker Under the container
1.influxdb Install and run
docker run -itd --name influxdb -p 8086:8086 influxdb
Into the container
docker exec -it influxdb /bin/bash
Create database
influx create database jmeter show databases
2.grafana Install and run
docker run -itd --name grafana -p 3000:3000 grafana/grafana
Into the container
docker exec -it grafana /bin/bash
visit grafana Webpage , Other operations are the same as method 1
http://ip:3000
3.jmeter install
First you need to download jmeter
wget https://mirrors.bfsu.edu.cn/apache//jmeter/binaries/apache-jmeter-5.4.1.tgz
We use dockerfile install , The contents are as follows
FROM java:8
ENV http_proxy ""
ENV https_proxy ""
RUN mkdir /jmeterdocker
RUN mkdir -p /jmeterdocker/test
RUN mkdir -p /jmeterdocker/test/input/jmx
RUN mkdir -p /jmeterdocker/test/input/testdata
RUN mkdir -p /jmeterdocker/test/report/html
RUN mkdir -p /jmeterdocker/test/report/jtl
RUN mkdir -p /jmeterdocker/test/report/outputdata
RUN chmod -R 777 /jmeterdocker
ENV JMETER_VERSION=5.4.1
ENV JMETER_HOME=/jmeterdocker/apache-jmeter-${JMETER_VERSION}
ENV JMETER_PATH=${JMETER_HOME}/bin:${PATH}
ENV PATH=${JMETER_HOME}/bin:${PATH}
COPY apache-jmeter-${JMETER_VERSION}.tgz /jmeterdocker
RUN cd /jmeterdocker \
&& tar xvf apache-jmeter-${JMETER_VERSION}.tgz \
&& rm apache-jmeter-${JMETER_VERSION}.tgzstay dockerfile Execute the command under the file path
docker build -t jmeter .
establish jmeter Containers
docker run -itd --name=jmeter -v /tmp/jmeterspace/test/input/jmx:/jmeterdocker/test/input/jmx \
-v /tmp/jmeterspace/test/input/testdata:/jmeterdocker/test/input/testdata \
-v /tmp/jmeterspace/test/report/html:/jmeterdocker/test/report/html \
-v /tmp/jmeterspace/test/report/jtl:/jmeterdocker/test/report/jtl \
-v /tmp/jmeterspace/test/report/outputputdata:/jmeterdocker/test/report/outputdata \
-p 1099:1099 \
jmeter take jmeter The script is placed outside the container /tmp/jmeterspace/test/input/jmx Under the path
Into the container , Execute the following command
docker exec -it jmeter /bin/bash cd /jmeterdocker/test/input/jmx jmeter -n -t ***.jmx -l test.jtl Parameter description : -n Not GUI Pattern -> In Africa GUI Run in mode JMeter -t The test file -> To run JMeter Test script file -l Log files -> Documentation of results
The results are shown in the figure
【 summary 】
The above three methods can be completed JMeter+Grafana+Influxdb Platform building , Here, you can select the corresponding installation method according to your needs
边栏推荐
- The mystery of redis data migration capacity
- ## Kubernetes集群中流量暴露的几种方案 Kubernetes集群中流量暴露的几种方案
- Automatically refresh CDN cache in real time based on cos log
- Finite element simulation in design
- ClassNotFoundException v/s NoClassDefFoundError
- How to save data to the greatest extent after deleting LV by misoperation under AIX?
- Development of block hash game guessing system (mature code)
- Week7 weekly report
- 网站SEO排名越做越差是什么原因造成的?
- Factory mode
猜你喜欢

Applet wxss

Daily algorithm & interview questions, 28 days of special training in large factories - the 15th day (string)

A survey of training on graphs: taxonomy, methods, and Applications
![[leetcode108] convert an ordered array into a binary search tree (medium order traversal)](/img/e1/0fac59a531040d74fd7531e2840eb5.jpg)
[leetcode108] convert an ordered array into a binary search tree (medium order traversal)

MySQL learning -- table structure of SQL test questions

A survey on dynamic neural networks for natural language processing, University of California

A survey on model compression for natural language processing (NLP model compression overview)
![[go] concurrent programming channel](/img/6a/d62678467bbc6dfb6a50ae42bacc96.jpg)
[go] concurrent programming channel
随机推荐
Solution to the problem that kibana's map cannot render longitude and latitude coordinate data
Saying "Dharma" Today: the little "secret" of paramter and localparam
未来银行需要用明天的思维,来思考今天架构
During JMeter pressure measurement, time_ The number of requests does not go up due to many waits. The problem is solved
重新定义存储架构,华为用了不止5颗“芯”
构建跨公链平台解决DApp开发问题
Teach you to write a classic dodge game
How to customize the log output format of zap?
What is a reptile
The RTSP video structured intelligent analysis platform easynvr stops calling the PTZ interface through the onvif protocol to troubleshoot the pending status
Popular explanation [redirection] and its practice
Learn typescript with VAM (phase 1)
How FEA and FEM work together
TRTC web end imitation Tencent conference microphone mute detection
API documents are simple and beautiful. It only needs three steps to open
Prometheus deployment
Abstract factory pattern
If only 2 people are recruited, can the enterprise do a good job in content risk control?
IBM:以现代化架构支撑AI与多云时代的企业数字化重塑
A set of very good H3C and Tianrongxin Internet cutover scheme templates, with word document download