Performance test study notes (20201124)

1. The setUp thread group uses JDBC to obtain data and generate a csv file. The
Insert picture description here
specific operations are as follows:

  • Select the setUp thread group, select the configuration element: JDBC Connection Configuration
    Insert picture description here
  • Enter the pool name, select the data source address, select the database and database table, enter the database account password

Insert picture description here

  • Add a thread group, select: JDBC Request sampler
    Insert picture description here
  • In the JDBC Request sampler, perform operations such as writing SQL scripts and transferring parameters. Note: The pool name must be written and consistent with the pool name in the JDBC configuration component

Insert picture description here

  • Add listener: save response to file

Insert picture description here
Insert picture description here
Save response to file: directly save the response of the previous request to the file.
File name prefix: fill in your file name or path.
To check: don't add number to prefix
don't add content type suffix
multiple executions, Overwrite, not append
Insert picture description here

2. Get the table and save the table data to your own database. The
specific operations are as follows:

  • Select the setUp thread group, select the configuration element: JDBC Connection Configuration, select a local database: sqlite, select the JDBC Request sampler to create the table
    Insert picture description here
  • Add a thread group, select: JDBC Request sampler, write sql script, transfer parameters and other operations in the JDBC Request sampler, note: the pool name must be written and consistent with the pool name in the JDBC configuration component
    Insert picture description here
  • Add logic controller-loop controller, add configuration element-counter, add a JDBC Request sampler, write sql to the created table
    Insert picture description here
    Insert picture description here
  • Execute script

Insert picture description here
Cross-thread group, set attributes, fixed name,
set attributes, name dynamic change fixed prefix_${_counter()}

Jmeter (websocket) script production

The websocket protocol is a new network protocol based on TCP, which implements full-duplex communication between the client and the server, that is, allows the server to actively send information to the client
vs HTTP protocol

  • HTTP protocol three-way handshake, four-way handshake, low data transmission rate
  • The HTTP protocol occupies the number of connections, which is more complicated when the server actively delivers
  • ws corresponds to HTTP, wss corresponds to HTTPS

* ===== jmeter plug *
jmeter-plugins-Manager-1.4.jar jmeter into the lib \ ext
restart jmeter
Options> plugin manager
of a page: already installed plug-ins
2nd: You can install plug-ins for
the first Three: plug-ins that need to be upgraded In the
second one, search for websocket, select websocket samlers by peter doornbosch and
click the lower right corner, download and install
Insert picture description here
each person’s network situation is different, some people may fail, find it in the lab-ext folder : Jmeter-websocket-samplers-1.2.8.jar package, which means the installation is successful.
Insert picture description here
According to the network disk until, check the latest IP, start: ./stwebsocketserver.sh
Insert picture description here

Jmeter (MQ) script production

  • SQM
  • MQ (message queue) message queue is a typical data structure with first-out cash. It is generally used to solve the problems of application decoupling, asynchronous messaging, traffic peaking, etc., to achieve high performance, high availability, scalability and eventual consistency. Architecture
  • MQ typical products: RabbitMQ, ActiveMQ, Kafka, RocketMQ, ZeroMQ
  • Publish, subscribe,
    Insert picture description here
    stop service: systemctl stop emqx
    Insert picture description here
    MQ script development
  • Sampler
  • MQTT Publisher
  • MQTT Subscriber
    Insert picture description here

Dubbo
is installed under lib-ext: jmeter-plugins-dubbo-2.7.3-jar-with-dependencies.jar package, and then restart jmeter

Insert picture description here

Guess you like

Origin blog.csdn.net/mbrs_311723/article/details/112843474