{"id":332602,"date":"2022-04-29T15:00:34","date_gmt":"2022-04-29T15:00:34","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=332602"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=332602","title":{"rendered":"<span>Gatling. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 JDBC<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/v1\/uw\/x6\/v1uwx6up9tjkkk1gkgejdqr7deq.png\" width=\"auto\" height=\"auto\" data-src=\"https:\/\/habrastorage.org\/webt\/v1\/uw\/x6\/v1uwx6up9tjkkk1gkgejdqr7deq.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440\u0430, \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0432 \u043e\u0442\u0434\u0435\u043b\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0422\u0438\u043d\u044c\u043a\u043e\u0444\u0444. \u042d\u0442\u043e\u0442 \u0442\u0435\u043a\u0441\u0442 \u2014 \u0447\u0430\u0441\u0442\u044c \u0446\u0438\u043a\u043b\u0430 \u0441\u0442\u0430\u0442\u0435\u0439, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 Gatling. \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/tinkoff\/blog\/658479\/\"><u>\u043e \u0440\u0430\u0431\u043e\u0442\u0435 Gatling \u0441 HTTP.<\/u><\/a> \u0415\u0449\u0435 \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/tinkoff\/blog\/655341\/\"><u>\u0432\u0432\u043e\u0434\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e<\/u><\/a>, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Gatling \u0438 \u043a\u0430\u043a \u043c\u044b \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0440\u0430\u0431\u043e\u0442\u0435 Gatling \u0441 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c JDBC.<\/p>\n<blockquote>\n<p><strong>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440<\/strong><\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 JDBC \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e Gatling 3.6. \u0412 \u0432\u0435\u0440\u0441\u0438\u0438 3.7 \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043b\u0438 <a href=\"https:\/\/github.com\/gatling\/gatling\/issues\/4195\"><u>\u0431\u0430\u0433<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e JDBC-\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443.<\/p>\n<\/blockquote>\n<h2>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0432 Gatling \u0441 JDBC<\/h2>\n<p>JDBC (Java DataBase Connectivity) \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f Java-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u043d \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u0431\u0430\u0437\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0438\u0445 DSN (Data Source Name).<\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0422\u0438\u043d\u044c\u043a\u043e\u0444\u0444 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0430 <a href=\"https:\/\/github.com\/Tinkoff\/gatling-jdbc-plugin\"><u>\u043f\u043b\u0430\u0433\u0438\u043d.<\/u><\/a> \u0421 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445 Gatling \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043b\u044e\u0431\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438: \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0434\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u043a \u043d\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0430\u043c\u0443 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u0430\u043a \u0438 \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043d\u0435\u0439 \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u0434\u0430\u0447\u0435\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c.<\/p>\n<h3>\u0422\u0435\u0441\u0442\u043e\u0432\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0414\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Postgres 12 \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0430 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0435 Alpine. \u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/hub.docker.com\/_\/postgres\"><u>\u043d\u0430 Docker Hub.<\/u><\/a> \u0427\u0442\u043e\u0431\u044b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u0430\u0439\u043b <em>docker-compose.yml.<\/em><\/p>\n<pre><code class=\"yaml\">services:   postgres:         image: postgres:12-alpine     environment:       POSTGRES_DB: \"test_db\"       POSTGRES_PASSWORD: \"secret\"       POSTGRES_USER: postgres       POSTGRES_HOST_AUTH_METHOD: trust       ports:      - '5432:5432'<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b <em>docker-compose.yml<\/em> \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <em>docker-compose up<\/em>. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 Docker.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <em>jdbc:postgresql:\/\/localhost:5432\/test_db<\/em>. \u041a \u043d\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043b\u044e\u0431\u044b\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0434\u043b\u044f \u0432\u0430\u0441 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c.<\/p>\n<h3>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h3>\n<p>\u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043d\u0443\u043b\u044f, \u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"https:\/\/github.com\/Tinkoff\/gatling-template.g8\"><u>\u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d.<\/u><\/a> \u041e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/company\/tinkoff\/blog\/655341\/\"><u>\u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0446\u0438\u043a\u043b\u0430.<\/u><\/a> \u0421\u0442\u043e\u0438\u0442 \u0443\u0447\u0435\u0441\u0442\u044c, \u0447\u0442\u043e JDBC-\u043f\u043b\u0430\u0433\u0438\u043d \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 Gatling 3.7. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, <a href=\"https:\/\/github.com\/gatling\/gatling\/issues\/4195\"><u>\u0431\u0430\u0433<\/u><\/a> \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u0442 \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 3.8. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 IDE \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c IntelliJ IDEA. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430.\u00a0<\/p>\n<p><strong>\u0428\u0430\u0433 1. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/strong><\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 <em>project\/Dependencies.scala<\/em> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b Gatling <a href=\"https:\/\/github.com\/TinkoffCreditSystems\/gatling-jdbc-plugin\"><u>\u0441 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c JDBC<\/u><\/a> (\u043d\u0443\u0436\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/Tinkoff\/gatling-jdbc-plugin\/releases\"><u>\u043d\u0430 GitHub<\/u><\/a>) \u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 Postgres (<a href=\"https:\/\/jdbc.postgresql.org\/\"><u>\u0440\u0435\u043b\u0438\u0437\u044b<\/u><\/a>). \u0412\u043c\u0435\u0441\u0442\u043e Postgres \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u0440\u0430\u0439\u0432\u0435\u0440. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 Postgres \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0434\u043b\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<pre><code class=\"scala\">  lazy val jdbc_plugin: Seq[ModuleID] = Seq(     \"ru.tinkoff\" %% \"gatling-jdbc-plugin\"   ).map(_ % \"&lt;current version>\")    lazy val postgresJdbc: Seq[ModuleID] = Seq(     \"org.postgresql\" % \"postgresql\"   ).map(_ % \"&lt;current version>\")<\/code><\/pre>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 <em>build.sbt<\/em> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<pre><code class=\"scala\">libraryDependencies ++= jdbc_plugin, libraryDependencies ++= postgresJdbc,<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u043b\u0438\u0441\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c <em>Load sbt Changes<\/em> \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 IntelliJ IDEA.<\/p>\n<p><strong>\u0428\u0430\u0433 2. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/strong><\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 <em>src\/test\/resources\/simulation.conf<\/em> \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430. \u0412 \u043d\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<pre><code class=\"scala\">baseUrl: \"jdbc:postgresql:\/\/localhost:5432\/test_db\" dbUser: \"postgres\" dbPassword: \"secret\"<\/code><\/pre>\n<p><strong>\u0428\u0430\u0433 3. \u0417\u0430\u043f\u0440\u043e\u0441\u044b<\/strong><\/p>\n<p>\u0412 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <em>cases<\/em> \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 scala-\u043a\u043b\u0430\u0441\u0441, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u041d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e <em>JdbcActions<\/em>. \u0417\u0430\u0442\u0435\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 <em>test_table<\/em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u0434\u0432\u0430 \u043f\u043e\u043b\u044f: <em>id<\/em> \u0438 <em>name<\/em>.<\/p>\n<pre><code class=\"scala\">package ru.tinkoff.load.myJdbcSample.cases import io.gatling.core.Predef._ import ru.tinkoff.load.jdbc.Predef.jdbc import ru.tinkoff.load.jdbc.actions import ru.tinkoff.load.jdbc.actions.Columns  object JdbcActions {     val createTable: actions.RawSqlActionBuilder = jdbc(\"create table\")     .rawSql(       \"\"\"create table          |if not exists          |test_table(         |id SERIAL,          |name varchar(20))\"\"\"         .stripMargin) } <\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u043d\u0430\u0448\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443.\u00a0<\/p>\n<pre><code class=\"scala\">val insertData: actions.DBInsertActionBuilder = jdbc(\"insert\") .insertInto(\"test_table\", Columns(\"name\")) .values(\"name\" -> \"Some text\")<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0440\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0435\u0441\u0442\u044c \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0435, \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/github.com\/Tinkoff\/gatling-jdbc-plugin\"><u>\u0432 \u043d\u0430\u0448\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438.<\/u><\/a> \u0427\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0434\u0430\u0442\u0443, \u043d\u0435 \u043d\u0430\u0440\u0443\u0448\u0430\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u0421\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0435\u0439 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 <a href=\"https:\/\/gatling.io\/docs\/gatling\/reference\/current\/core\/session\/feeder\/\"><u>feeder<\/u><\/a>.<\/p>\n<p><strong>\u0428\u0430\u0433 4. Feeders<\/strong><\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e feeders \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/company\/tinkoff\/blog\/655341\/\"><u>\u0432\u043e \u0432\u0432\u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/u><\/a> \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b feeder \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c\u0438: \u043e\u0442 \u0444\u0430\u0439\u043b\u0430 \u0434\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c feeder, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443.<\/p>\n<p>\u0412 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <em>src\/test\/scala\/ru\/tinkoff\/load\/myJdbcSample<\/em> \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e feeders, \u0430 \u0432 \u043d\u0435\u0439 \u2014 object Feeders.<\/p>\n<pre><code class=\"scala\">package ru.tinkoff.load.myJdbcSample.feeders  import ru.tinkoff.gatling.feeders.RandomStringFeeder  object Feeders {     val myRandomStringFeeder = RandomStringFeeder(\"myString\", 10) }<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c feeder, \u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443.\u00a0<\/p>\n<pre><code class=\"scala\">val insertData: actions.DBInsertActionBuilder = jdbc(\"insert\") .insertInto(\"test_table\", Columns(\"name\")) .values(\"name\" -> \"${myString}\")<\/code><\/pre>\n<p><strong>\u0428\u0430\u0433 5. \u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0442\u0435\u0441\u0442\u0430<\/strong><\/p>\n<p>\u0412 CommonScenario \u043c\u0435\u043d\u044f\u0435\u043c \u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435.<\/p>\n<pre><code class=\"scala\">package ru.tinkoff.load.myJdbcSample.scenarios  import io.gatling.core.Predef._ import io.gatling.core.structure.ScenarioBuilder import ru.tinkoff.load.myJdbcSample.cases._ import ru.tinkoff.load.myJdbcSample.feeders.Feeders.myRandomStringFeeder  object CommonScenario {   def apply(): ScenarioBuilder = new CommonScenario().scn }  class CommonScenario {    val scn: ScenarioBuilder = scenario(\"Common Scenario\")     \/\/ \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 Feeder     .feed(myRandomStringFeeder)     \/\/ \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b     .exec(JdbcActions.createTable)   \/\/ \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443     .exec(JdbcActions.insertData) }<\/code><\/pre>\n<p><strong>\u0428\u0430\u0433 6. \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 JDBC-\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430<\/strong><\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 <em>myJdbcSample.scala<\/em> \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u0435\u0442\u043e\u0434 <em>getStringParam<\/em> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0448\u0430\u0433\u0435 \u0434\u0432\u0430, \u043f\u0440\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0442\u043b\u0430\u0434\u043a\u0435.<\/p>\n<pre><code class=\"scala\">package ru.tinkoff.load  import ru.tinkoff.gatling.config.SimulationConfig._ import ru.tinkoff.load.jdbc.Predef._ import ru.tinkoff.load.jdbc.protocol.JdbcProtocolBuilder  import scala.concurrent.duration.DurationInt  package object myJdbcSample {    val jdbcProtocol: JdbcProtocolBuilder = DB     .url(baseUrl)     .username(getStringParam(\"dbUser\"))     .password(getStringParam(\"dbPassword\"))     .connectionTimeout(2.minute) }<\/code><\/pre>\n<p><strong>\u0428\u0430\u0433 7. \u041d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b<\/strong><\/p>\n<p>\u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u0432 \u0444\u0430\u0439\u043b\u0435 Debug.scala.<\/p>\n<pre><code class=\"scala\">package ru.tinkoff.load.myJdbcSample  import io.gatling.core.Predef._ import ru.tinkoff.load.jdbc.Predef._ import ru.tinkoff.load.myJdbcSample.scenarios.CommonScenario  class Debug extends Simulation {    setUp(     \/\/ \u0412\u044b\u0437\u043e\u0432 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f     CommonScenario()       \/\/ \u041d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f 1 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c = 1 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f         .inject(atOnceUsers(1)),   ).protocols(     \/\/ \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b     jdbcProtocol,                )  }<\/code><\/pre>\n<p>\u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0432 MaxPerformance \u0438 Stability. \u041f\u043e\u043c\u0438\u043c\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0434\u043b\u044f MaxPerformance \u0438 Stability-\u0442\u0435\u0441\u0442\u043e\u0432. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437. \u041d\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u0440\u0430\u0437. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 <a href=\"https:\/\/gatling.io\/docs\/gatling\/reference\/current\/general\/simulation_setup\/#sequential-scenarios\"><u>andThen<\/u><\/a>. \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432.\u00a0<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0438\u0448\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 <em>CommonScenario.scala<\/em>: \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0443\u0434\u0430 \u0437\u0430\u043f\u0438\u0441\u0435\u0439.\u00a0<\/p>\n<pre><code class=\"scala\">  val createTableScn: ScenarioBuilder = scenario(\"create table\")     .exec(JdbcActions.createTable)    val insertInTable: ScenarioBuilder = scenario(\"insert\")     .feed(myRandomStringFeeder)     .exec(JdbcActions.insertData)<\/code><\/pre>\n<p>\u041e\u043f\u0438\u0448\u0435\u043c \u043f\u043e\u0434\u0430\u0447\u0443 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 <em>MaxPerformance.scala<\/em>.<\/p>\n<pre><code class=\"scala\">package ru.tinkoff.load.myJdbcSample  import io.gatling.core.Predef._ import ru.tinkoff.gatling.config.SimulationConfig._ import ru.tinkoff.gatling.influxdb.Annotations import ru.tinkoff.load.myJdbcSample.scenarios.CommonScenario import ru.tinkoff.load.jdbc.Predef._  class MaxPerformance extends Simulation with Annotations {    setUp(     new CommonScenario().createTableScn       .inject(atOnceUsers(1))       .andThen(         new CommonScenario().insertInTable.inject(           \/\/ \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u0441\u0442\u0443\u043f\u0435\u043d\u044c           incrementUsersPerSec((intensity \/ stagesNumber).toInt)             \/\/ \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0443\u043f\u0435\u043d\u0435\u0439             .times(stagesNumber)             \/\/ \u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u043a\u0438             .eachLevelLasting(stageDuration)             \/\/ \u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0433\u043e\u043d\u0430             .separatedByRampsLasting(rampDuration)             \/\/ \u041d\u0430\u0447\u0430\u043b\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441             .startingFrom(0),                                             ),       ),   ).protocols(jdbcProtocol)     \/\/ \u043e\u0431\u0449\u0430\u044f \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u0430     .maxDuration(testDuration) }<\/code><\/pre>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u0422\u0430\u043a\u0438\u0435 \u0436\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0434\u043b\u044f Stability-\u0442\u0435\u0441\u0442\u0430.<\/p>\n<p><strong>\u0428\u0430\u0433 8. \u0417\u0430\u043f\u0443\u0441\u043a Debug-\u0442\u0435\u0441\u0442\u0430<\/strong><\/p>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c GatlingRunner. \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u043f\u0430\u043b\u0430 \u0432 \u043d\u0430\u0448\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443.\u00a0<\/p>\n<pre><code class=\"scala\">package ru.tinkoff.load.myJdbcSample  import io.gatling.app.Gatling import io.gatling.core.config.GatlingPropertiesBuilder  object GatlingRunner {    def main(args: Array[String]): Unit = {      \/\/ this is where you specify the class you want to run     \/\/ \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0438\u043c\u044f \u0442\u0435\u0441\u0442\u0430 Debug, \u043b\u0438\u0431\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0439,     \/\/ \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, MaxPerformance     val simulationClass = classOf[Debug].getName       val props = new GatlingPropertiesBuilder     props.simulationClass(simulationClass)      Gatling.fromMap(props.build)   } }<\/code><\/pre>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0446\u0438\u043a\u043b\u0430 \u043e Gatling \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0448\u0435\u0433\u043e JDBC-\u043f\u043b\u0430\u0433\u0438\u043d\u0430. \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 Postgres, \u043d\u043e \u043f\u043b\u0430\u0433\u0438\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u043c\u0438\u043c\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u043b\u0430\u0433\u0438\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d, \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443 Gatling \u0441 gRPC, Kafka \u0438 AMQP.<\/p>\n<h2>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/h2>\n<ol>\n<li>\n<p><a href=\"https:\/\/github.com\/TinkoffCreditSystems\/gatling-jdbc-plugin\"><u>Gatling JDBC Plugin<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/gatling.io\/docs\/gatling\/reference\/current\/session\/feeder\/\"><u>Gatling Feeders<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/Tinkoff\/gatling-samples\/tree\/main\/gatling-http\"><u>\u041f\u0440\u043e\u0435\u043a\u0442 Gatling \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/u><\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/tinkoff\/blog\/663718\/\"> https:\/\/habr.com\/ru\/company\/tinkoff\/blog\/663718\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440\u0430, \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0432 \u043e\u0442\u0434\u0435\u043b\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0422\u0438\u043d\u044c\u043a\u043e\u0444\u0444. \u042d\u0442\u043e\u0442 \u0442\u0435\u043a\u0441\u0442 \u2014 \u0447\u0430\u0441\u0442\u044c \u0446\u0438\u043a\u043b\u0430 \u0441\u0442\u0430\u0442\u0435\u0439, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 Gatling. \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/tinkoff\/blog\/658479\/\"><u>\u043e \u0440\u0430\u0431\u043e\u0442\u0435 Gatling \u0441 HTTP.<\/u><\/a> \u0415\u0449\u0435 \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/tinkoff\/blog\/655341\/\"><u>\u0432\u0432\u043e\u0434\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e<\/u><\/a>, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Gatling \u0438 \u043a\u0430\u043a \u043c\u044b \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0440\u0430\u0431\u043e\u0442\u0435 Gatling \u0441 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c JDBC.<\/p>\n<blockquote>\n<p><strong>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440<\/strong><\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 JDBC \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e Gatling 3.6. \u0412 \u0432\u0435\u0440\u0441\u0438\u0438 3.7 \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043b\u0438 <a href=\"https:\/\/github.com\/gatling\/gatling\/issues\/4195\"><u>\u0431\u0430\u0433<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e JDBC-\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443.<\/p>\n<\/blockquote>\n<h2>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0432 Gatling \u0441 JDBC<\/h2>\n<p>JDBC (Java DataBase Connectivity) \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f Java-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u043d \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u0431\u0430\u0437\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0438\u0445 DSN (Data Source Name).<\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0422\u0438\u043d\u044c\u043a\u043e\u0444\u0444 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0430 <a href=\"https:\/\/github.com\/Tinkoff\/gatling-jdbc-plugin\"><u>\u043f\u043b\u0430\u0433\u0438\u043d.<\/u><\/a> \u0421 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445 Gatling \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043b\u044e\u0431\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438: \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0434\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u043a \u043d\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0430\u043c\u0443 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u0430\u043a \u0438 \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043d\u0435\u0439 \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u0434\u0430\u0447\u0435\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c.<\/p>\n<h3>\u0422\u0435\u0441\u0442\u043e\u0432\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0414\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Postgres 12 \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0430 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0435 Alpine. \u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/hub.docker.com\/_\/postgres\"><u>\u043d\u0430 Docker Hub.<\/u><\/a> \u0427\u0442\u043e\u0431\u044b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u0430\u0439\u043b <em>docker-compose.yml.<\/em><\/p>\n<pre><code class=\"yaml\">services:   postgres:         image: postgres:12-alpine     environment:       POSTGRES_DB: \"test_db\"       POSTGRES_PASSWORD: \"secret\"       POSTGRES_USER: postgres       POSTGRES_HOST_AUTH_METHOD: trust       ports:      - '5432:5432'<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b <em>docker-compose.yml<\/em> \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <em>docker-compose up<\/em>. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 Docker.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <em>jdbc:postgresql:\/\/localhost:5432\/test_db<\/em>. \u041a \u043d\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043b\u044e\u0431\u044b\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0434\u043b\u044f \u0432\u0430\u0441 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c.<\/p>\n<h3>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h3>\n<p>\u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043d\u0443\u043b\u044f, \u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"https:\/\/github.com\/Tinkoff\/gatling-template.g8\"><u>\u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d.<\/u><\/a> \u041e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/company\/tinkoff\/blog\/655341\/\"><u>\u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0446\u0438\u043a\u043b\u0430.<\/u><\/a> \u0421\u0442\u043e\u0438\u0442 \u0443\u0447\u0435\u0441\u0442\u044c, \u0447\u0442\u043e JDBC-\u043f\u043b\u0430\u0433\u0438\u043d \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 Gatling 3.7. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, <a href=\"https:\/\/github.com\/gatling\/gatling\/issues\/4195\"><u>\u0431\u0430\u0433<\/u><\/a> \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u0442 \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 3.8. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 IDE \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c IntelliJ IDEA. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430.\u00a0<\/p>\n<p><strong>\u0428\u0430\u0433 1. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/strong><\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 <em>project\/Dependencies.scala<\/em> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b Gatling <a href=\"https:\/\/github.com\/TinkoffCreditSystems\/gatling-jdbc-plugin\"><u>\u0441 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c JDBC<\/u><\/a> (\u043d\u0443\u0436\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/Tinkoff\/gatling-jdbc-plugin\/releases\"><u>\u043d\u0430 GitHub<\/u><\/a>) \u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 Postgres (<a href=\"https:\/\/jdbc.postgresql.org\/\"><u>\u0440\u0435\u043b\u0438\u0437\u044b<\/u><\/a>). \u0412\u043c\u0435\u0441\u0442\u043e Postgres \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u0440\u0430\u0439\u0432\u0435\u0440. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 Postgres \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0434\u043b\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<pre><code class=\"scala\">  lazy val jdbc_plugin: Seq[ModuleID] = Seq(     \"ru.tinkoff\" %% \"gatling-jdbc-plugin\"   ).map(_ % \"&lt;current version>\")    lazy val postgresJdbc: Seq[ModuleID] = Seq(     \"org.postgresql\" % \"postgresql\"   ).map(_ % \"&lt;current version>\")<\/code><\/pre>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 <em>build.sbt<\/em> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<pre><code class=\"scala\">libraryDependencies ++= jdbc_plugin, libraryDependencies ++= postgresJdbc,<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u043b\u0438\u0441\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c <em>Load sbt Changes<\/em> \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 IntelliJ IDEA.<\/p>\n<p><strong>\u0428\u0430\u0433 2. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/strong><\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 <em>src\/test\/resources\/simulation.conf<\/em> \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430. \u0412 \u043d\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<pre><code class=\"scala\">baseUrl: \"jdbc:postgresql:\/\/localhost:5432\/test_db\" dbUser: \"postgres\" dbPassword: \"secret\"<\/code><\/pre>\n<p><strong>\u0428\u0430\u0433 3. \u0417\u0430\u043f\u0440\u043e\u0441\u044b<\/strong><\/p>\n<p>\u0412 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <em>cases<\/em> \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 scala-\u043a\u043b\u0430\u0441\u0441, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u041d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e <em>JdbcActions<\/em>. \u0417\u0430\u0442\u0435\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 <em>test_table<\/em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u0434\u0432\u0430 \u043f\u043e\u043b\u044f: <em>id<\/em> \u0438 <em>name<\/em>.<\/p>\n<pre><code class=\"scala\">package ru.tinkoff.load.myJdbcSample.cases import io.gatling.core.Predef._ import ru.tinkoff.load.jdbc.Predef.jdbc import ru.tinkoff.load.jdbc.actions import ru.tinkoff.load.jdbc.actions.Columns  object JdbcActions {     val createTable: actions.RawSqlActionBuilder = jdbc(\"create table\")     .rawSql(       \"\"\"create table          |if not exists          |test_table(         |id SERIAL,          |name varchar(20))\"\"\"         .stripMargin) } <\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u043d\u0430\u0448\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443.\u00a0<\/p>\n<pre><code class=\"scala\">val insertData: actions.DBInsertActionBuilder = jdbc(\"insert\") .insertInto(\"test_table\", Columns(\"name\")) .values(\"name\" -> \"Some text\")<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0440\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0435\u0441\u0442\u044c \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0435, \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/github.com\/Tinkoff\/gatling-jdbc-plugin\"><u>\u0432 \u043d\u0430\u0448\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438.<\/u><\/a> \u0427\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0434\u0430\u0442\u0443, \u043d\u0435 \u043d\u0430\u0440\u0443\u0448\u0430\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u0421\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0435\u0439 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 <a href=\"https:\/\/gatling.io\/docs\/gatling\/reference\/current\/core\/session\/feeder\/\"><u>feeder<\/u><\/a>.<\/p>\n<p><strong>\u0428\u0430\u0433 4. Feeders<\/strong><\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e feeders \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/company\/tinkoff\/blog\/655341\/\"><u>\u0432\u043e \u0432\u0432\u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/u><\/a> \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b feeder \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c\u0438: \u043e\u0442 \u0444\u0430\u0439\u043b\u0430 \u0434\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c feeder, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443.<\/p>\n<p>\u0412 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <em>src\/test\/scala\/ru\/tinkoff\/load\/myJdbcSample<\/em> \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e feeders, \u0430 \u0432 \u043d\u0435\u0439 \u2014 object Feeders.<\/p>\n<pre><code class=\"scala\">package ru.tinkoff.load.myJdbcSample.feeders  import ru.tinkoff.gatling.feeders.RandomStringFeeder  object Feeders {     val myRandomStringFeeder = RandomStringFeeder(\"myString\", 10) }<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c feeder, \u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443.\u00a0<\/p>\n<pre><code class=\"scala\">val insertData: actions.DBInsertActionBuilder = jdbc(\"insert\") .insertInto(\"test_table\", Columns(\"name\")) .values(\"name\" -> \"${myString}\")<\/code><\/pre>\n<p><strong>\u0428\u0430\u0433 5. \u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0442\u0435\u0441\u0442\u0430<\/strong><\/p>\n<p>\u0412 CommonScenario \u043c\u0435\u043d\u044f\u0435\u043c \u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435.<\/p>\n<pre><code class=\"scala\">package ru.tinkoff.load.myJdbcSample.scenarios  import io.gatling.core.Predef._ import io.gatling.core.structure.ScenarioBuilder import ru.tinkoff.load.myJdbcSample.cases._ import ru.tinkoff.load.myJdbcSample.feeders.Feeders.myRandomStringFeeder  object CommonScenario {   def apply(): ScenarioBuilder = new CommonScenario().scn }  class CommonScenario {    val scn: ScenarioBuilder = scenario(\"Common Scenario\")     \/\/ \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 Feeder     .feed(myRandomStringFeeder)     \/\/ \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b     .exec(JdbcActions.createTable)   \/\/ \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443     .exec(JdbcActions.insertData) }<\/code><\/pre>\n<p><strong>\u0428\u0430\u0433 6. \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 JDBC-\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430<\/strong><\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 <em>myJdbcSample.scala<\/em> \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u0435\u0442\u043e\u0434 <em>getStringParam<\/em> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0448\u0430\u0433\u0435 \u0434\u0432\u0430, \u043f\u0440\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0442\u043b\u0430\u0434\u043a\u0435.<\/p>\n<pre><code class=\"scala\">package ru.tinkoff.load  import ru.tinkoff.gatling.config.SimulationConfig._ import ru.tinkoff.load.jdbc.Predef._ import ru.tinkoff.load.jdbc.protocol.JdbcProtocolBuilder  import scala.concurrent.duration.DurationInt  package object myJdbcSample {    val jdbcProtocol: JdbcProtocolBuilder = DB     .url(baseUrl)     .username(getStringParam(\"dbUser\"))     .password(getStringParam(\"dbPassword\"))     .connectionTimeout(2.minute) }<\/code><\/pre>\n<p><strong>\u0428\u0430\u0433 7. \u041d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b<\/strong><\/p>\n<p>\u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u0432 \u0444\u0430\u0439\u043b\u0435 Debug.scala.<\/p>\n<pre><code class=\"scala\">package ru.tinkoff.load.myJdbcSample  import io.gatling.core.Predef._ import ru.tinkoff.load.jdbc.Predef._ import ru.tinkoff.load.myJdbcSample.scenarios.CommonScenario  class Debug extends Simulation {    setUp(     \/\/ \u0412\u044b\u0437\u043e\u0432 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f     CommonScenario()       \/\/ \u041d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f 1 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c = 1 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f         .inject(atOnceUsers(1)),   ).protocols(     \/\/ \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b     jdbcProtocol,                )  }<\/code><\/pre>\n<p>\u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0432 MaxPerformance \u0438 Stability. \u041f\u043e\u043c\u0438\u043c\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0434\u043b\u044f MaxPerformance \u0438 Stability-\u0442\u0435\u0441\u0442\u043e\u0432. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437. \u041d\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u0440\u0430\u0437. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 <a href=\"https:\/\/gatling.io\/docs\/gatling\/reference\/current\/general\/simulation_setup\/#sequential-scenarios\"><u>andThen<\/u><\/a>. \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432.\u00a0<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0438\u0448\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 <em>CommonScenario.scala<\/em>: \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0443\u0434\u0430 \u0437\u0430\u043f\u0438\u0441\u0435\u0439.\u00a0<\/p>\n<pre><code class=\"scala\">  val createTableScn: ScenarioBuilder = scenario(\"create table\")     .exec(JdbcActions.createTable)    val insertInTable: ScenarioBuilder = scenario(\"insert\")     .feed(myRandomStringFeeder)     .exec(JdbcActions.insertData)<\/code><\/pre>\n<p>\u041e\u043f\u0438\u0448\u0435\u043c \u043f\u043e\u0434\u0430\u0447\u0443 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 <em>MaxPerformance.scala<\/em>.<\/p>\n<pre><code class=\"scala\">package ru.tinkoff.load.myJdbcSample  import io.gatling.core.Predef._ import ru.tinkoff.gatling.config.SimulationConfig._ import ru.tinkoff.gatling.influxdb.Annotations import ru.tinkoff.load.myJdbcSample.scenarios.CommonScenario import ru.tinkoff.load.jdbc.Predef._  class MaxPerformance extends Simulation with Annotations {    setUp(     new CommonScenario().createTableScn       .inject(atOnceUsers(1))       .andThen(         new CommonScenario().insertInTable.inject(           \/\/ \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u0441\u0442\u0443\u043f\u0435\u043d\u044c           incrementUsersPerSec((intensity \/ stagesNumber).toInt)             \/\/ \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0443\u043f\u0435\u043d\u0435\u0439             .times(stagesNumber)             \/\/ \u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u043a\u0438             .eachLevelLasting(stageDuration)             \/\/ \u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0433\u043e\u043d\u0430             .separatedByRampsLasting(rampDuration)             \/\/ \u041d\u0430\u0447\u0430\u043b\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441             .startingFrom(0),                                             ),       ),   ).protocols(jdbcProtocol)     \/\/ \u043e\u0431\u0449\u0430\u044f \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u0430     .maxDuration(testDuration) }<\/code><\/pre>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u0422\u0430\u043a\u0438\u0435 \u0436\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0434\u043b\u044f Stability-\u0442\u0435\u0441\u0442\u0430.<\/p>\n<p><strong>\u0428\u0430\u0433 8. \u0417\u0430\u043f\u0443\u0441\u043a Debug-\u0442\u0435\u0441\u0442\u0430<\/strong><\/p>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c GatlingRunner. \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u043f\u0430\u043b\u0430 \u0432 \u043d\u0430\u0448\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443.\u00a0<\/p>\n<pre><code class=\"scala\">package ru.tinkoff.load.myJdbcSample  import io.gatling.app.Gatling import io.gatling.core.config.GatlingPropertiesBuilder  object GatlingRunner {    def main(args: Array[String]): Unit = {      \/\/ this is where you specify the class you want to run     \/\/ \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0438\u043c\u044f \u0442\u0435\u0441\u0442\u0430 Debug, \u043b\u0438\u0431\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0439,    <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-332602","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/332602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=332602"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/332602\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=332602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=332602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=332602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}