{"id":353705,"date":"2024-05-20T22:33:23","date_gmt":"2024-05-20T22:33:23","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=353705"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=353705","title":{"rendered":"<span>\u041d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 API \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f UI<\/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<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u041d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 JMeter-Java-Dsl<strong> <\/strong>\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043d\u0430\u0448 \u043f\u0435\u0440\u0432\u044b\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u0434\u043b\u044f API \u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/2a5\/e09\/e29\/2a5e09e29ebe0cdedda144680dc5506c.jpeg\" width=\"1920\" height=\"1386\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2a5\/e09\/e29\/2a5e09e29ebe0cdedda144680dc5506c.jpeg\" data-blurred=\"true\"\/><\/figure>\n<p>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f <a href=\"https:\/\/abstracta.github.io\/jmeter-java-dsl\/guide\/\" rel=\"noopener noreferrer nofollow\">JMeter Guide<\/a> \u0438 <a href=\"https:\/\/github.com\/igor-QA\/utilities-monitor\" rel=\"noopener noreferrer nofollow\">GitHub<\/a> \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043a\u043e\u0434\u0430 \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p><strong>\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/strong><\/p>\n<p><em>\u0411\u044b\u043b\u0430 \u0438\u0434\u0435\u044f \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f API, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 \u042f\u041f Java \u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 Gatling \u0438 JMeter \u0438 \u0432\u043e\u0442 \u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u043a\u0430\u043a \u0432\u0441\u0451 \u0431\u044b\u043b\u043e \u0438 \u0447\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/em><\/p>\n<p><em>\u0426\u0435\u043b\u044c\u044e \u0434\u043b\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u044b\u043b\u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043e <\/em><strong><em>\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u0430\u0437\u0430 \u0438 \u0432\u043e\u0434\u044b, \u0433\u0434\u0435 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e API <\/em><\/strong><em>(\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u2014 <\/em><a href=\"https:\/\/github.com\/igor-QA\/utilitiesMonitor\" rel=\"noopener noreferrer nofollow\"><em>\u00a0utilitiesMonitor<\/em><\/a><em>).<\/em><strong><em> <\/em><\/strong><em>\u041f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Spring-Boot \u0434\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043c\u0443\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u0443\u0433. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 REST:<\/em><\/p>\n<p><em>1. \u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:<\/em><\/p>\n<pre><code class=\"java\">POST \/measurements      {         \"userId\":1,         \"gas\":45.4,          \"coldWater\":45.2,         \"hotWater\":557     }<\/code><\/pre>\n<p><em>2. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u0441\u0442\u043e\u0440\u0438\u0439 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:<\/em><\/p>\n<pre><code class=\"java\">GET \/users\/{userId}\/measurements<\/code><\/pre>\n<p><em>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u044e, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e userId (\u043f\u043e POST \u0437\u0430\u043f\u0440\u043e\u0441\u0443) \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 userId \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 GET.\u00a0 \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u0434\u0430\u0442\u0435 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f.<\/em><\/p>\n<p><strong>\u0418\u0442\u0430\u043a, \u043f\u043e\u0435\u0445\u0430\u043b\u0438<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442 \u043f\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435, \u043f\u043e\u0439\u0434\u0451\u043c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e (\u0432\u043e\u0442 \u043e\u043d\u0430<a href=\"https:\/\/abstracta.github.io\/jmeter-java-dsl\/guide\/\" rel=\"noopener noreferrer nofollow\"> <em>\u2014<\/em> JMeter Guide<\/a>), \u043d\u043e \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0436\u0438\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0448\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b.<\/p>\n<p>\u0427\u0442\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e:<br \/>>>\u00a0 IDE, Java \u0438 \u0441\u0431\u043e\u0440\u0449\u0438\u043a, \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e IntelliJ IDEA,\u00a0 Java17 \u0438 Maven,<br \/>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442 (\u043e\u0442\u043f\u0443\u0441\u0442\u0438\u043c \u0434\u0435\u0442\u0430\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 ) \u0438 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0435\u0449\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c Jmeter-Java-Dsl\u00a0 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u0435\u0440\u0441\u0438\u044f 1.19<\/p>\n<pre><code class=\"java\">      &lt;dependency>           &lt;groupId>us.abstracta.jmeter&lt;\/groupId>           &lt;artifactId>jmeter-java-dsl&lt;\/artifactId>           &lt;version>1.19&lt;\/version>           &lt;scope>test&lt;\/scope>       &lt;\/dependency><\/code><\/pre>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c JUnit 5 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 AssertJ \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439.<\/p>\n<pre><code class=\"java\">      &lt;dependency>           &lt;groupId>org.junit.jupiter&lt;\/groupId>           &lt;artifactId>junit-jupiter&lt;\/artifactId>           &lt;version>RELEASE&lt;\/version>           &lt;scope>test&lt;\/scope>       &lt;\/dependency>       &lt;dependency>           &lt;groupId>org.assertj&lt;\/groupId>           &lt;artifactId>assertj-core&lt;\/artifactId>           &lt;version>RELEASE&lt;\/version>           &lt;scope>test&lt;\/scope>       &lt;\/dependency><\/code><\/pre>\n<p>\u0430 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 JavaFaker.<\/p>\n<pre><code class=\"java\">      &lt;dependency>       &lt;groupId>com.github.javafaker&lt;\/groupId>       &lt;artifactId>javafaker&lt;\/artifactId>       &lt;version>1.0.2&lt;\/version>       &lt;\/dependency><\/code><\/pre>\n<blockquote>\n<p>*\u043f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0442\u0430\u043a \u0438 \u043d\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0445 \u0434\u043b\u044f \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432.<\/p>\n<\/blockquote>\n<p><strong>\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u041f\u043b\u0430\u043d <\/strong><\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c Java class \u0438 \u0434\u0430\u0434\u0438\u043c \u0435\u043c\u0443 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: PerformanceTest , \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0448 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043b\u0430\u043d \u0434\u043b\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f API. \u0412 \u0446\u0435\u043b\u043e\u043c, JMeter-Java-Dsl \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u043e\u0449\u043d\u044b\u0439 \u0438 \u0433\u0438\u0431\u043a\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043b\u0430\u043d\u043e\u0432 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c, \u0434\u0430\u043b\u044c\u0448\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435, \u0427\u0442\u043e ? \u0413\u0434\u0435 ? \u041a\u043e\u0433\u0434\u0430 ?<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/143\/e8b\/014\/143e8b0143b41f37564125f49781aca4.jpeg\" width=\"1332\" height=\"888\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/143\/e8b\/014\/143e8b0143b41f37564125f49781aca4.jpeg\" data-blurred=\"true\"\/><\/figure>\n<p>\u041d\u0430\u0448 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043b\u0430\u043d \u043d\u0430\u0447\u043d\u0451\u043c \u0441 <code>threadGroup<\/code>, \u0433\u0434\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432, \u043f\u0443\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 5 (\u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439) \u0438 10 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f, \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 THREADS \u0438 ITERATIONS, \u0430 \u0432 <code>httpSampler<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0430 \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e Post \u0437\u0430\u043f\u0440\u043e\u0441, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c &#171;\u0442\u0435\u043b\u043e&#187;, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u044b\u043b \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435, \u043d\u043e \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 userId, gas, coldWater, hotWater (\u0438\u0437 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430) \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435. \u042d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0434\u043e\u0441\u0442\u0438\u0447\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <code>csvDataSet<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u043c\u0435\u044f csv \u0444\u0430\u0439\u043b, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u044d\u0442\u043e\u043c\u0443:<\/p>\n<pre><code>USERID,GAS,COLDWATER,HOTWATER 1,11.1,42.1,111 10,11.2,42.3,112<\/code><\/pre>\n<p>\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043d\u0430\u0448 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043b\u0430\u043d <code>csvDataSet(\"path to csv\")<\/code>, \u0430 \u0443\u0436\u0435 \u0432 &#171;\u0442\u0435\u043b\u0435&#187; \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435\u00a0 ${USERID}, ${GAS}, ${COLDWATER}, ${HOTWATER}. <\/p>\n<p>\u0414\u043b\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u0421\u0447\u0451\u0442\u0447\u0438\u043a (Counter), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f<br \/>\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445.<a href=\"https:\/\/abstracta.github.io\/jmeter-java-dsl\/guide\/#csv-as-input-data-for-requests\" rel=\"noopener noreferrer nofollow\"> \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c<\/a><\/p>\n<p>\u041d\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438 \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0448\u0430\u0433\u0435 \u0432\u00a0 <code>.post(s -> buildRequestBody()<\/code> \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 &#171;\u0442\u0435\u043b\u0435&#187; \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c jsr223preProcessor, <a href=\"https:\/\/abstracta.github.io\/jmeter-java-dsl\/guide\/#provide-request-parameters-programmatically-per-request\" rel=\"noopener noreferrer nofollow\">\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e jsr223preProcessor<\/a>. \u0421\u0430\u043c\u044b\u0439 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0439 \u0438 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 <em>\u2014 <\/em>\u0447\u0435\u0440\u0435\u0437 \u043b\u044f\u043c\u0431\u0434\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"java\">TestPlanStats stats = testPlan(             threadGroup(THREADS, ITERATIONS,                     httpSampler(\"http:\/\/localhost:8080\/measurements\")                             .method(HTTPConstants.POST)                             .post(s -> buildRequestBody(), ContentType.APPLICATION_JSON)<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 &#171;\u043f\u0440\u043e\u0432\u0430\u043b\u0438\u043c\u0441\u044f&#187; \u0432 \u043c\u0435\u0442\u043e\u0434 <code>buildRequestBody()<\/code><strong> <\/strong>\u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c &#171;\u0442\u0435\u043b\u043e&#187; \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430, \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c JSONObject, \u043d\u043e \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u044b\u043b \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c JavaFaker \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 json. <a href=\"https:\/\/github.com\/DiUS\/java-faker\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f JavaFaker<\/a>.<\/p>\n<p>\u0422\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442:<\/p>\n<pre><code class=\"java\">public static String buildRequestBody() {         JSONObject jsonObject = new JSONObject();         jsonObject.put(\"userId\", getRandomInteger());         jsonObject.put(\"gas\", getRandomDouble());         jsonObject.put(\"coldWater\", getRandomDouble());         jsonObject.put(\"hotWater\", getRandomDouble());         return jsonObject.toJSONString();     }<\/code><\/pre>\n<p>\u041d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u0435 <code>POST\/measurements<\/code> \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437\u0432\u043b\u0435\u0447\u044c. \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c userId \u0438\u0437 \u043e\u0442\u0432\u0435\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>jsonExtractor<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>httpSampler<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e userId \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u0430\u0434\u0438\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439: \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e, \u043d\u0430\u0437\u043e\u0432\u0451\u043c userIdVariable \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 userId. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <code>jsonExtractor<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 JMeter JSON JMESpath Extractor \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, JMESpath \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044f\u0437\u044b\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. <a href=\"https:\/\/abstracta.github.io\/jmeter-java-dsl\/guide\/#json-extraction\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c<\/a>.<br \/>\u041d\u0435\u043b\u0438\u0448\u043d\u0438\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u0447\u0435\u0440\u0435\u0437 <code>jsonAssertion<\/code>, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u0435 <strong>dateTime<\/strong>,<a href=\"https:\/\/abstracta.github.io\/jmeter-java-dsl\/guide\/#check-for-expected-json\" rel=\"noopener noreferrer nofollow\"> \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f\u0445 \u0442\u0443\u0442<\/a>. \u0423\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <code>jsonAssertion<\/code>, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 json, \u0434\u0430 \u044d\u0442\u043e \u0438 \u0442\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f. \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f, \u043d\u0443\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>httpSampler<\/code> \u0438 \u0438\u0434\u0451\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u043e \u043d\u0430\u0448\u0435\u043c\u0443 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c\u0443 \u043f\u043b\u0430\u043d\u0443.\u00a0<\/p>\n<pre><code class=\"java\">.children(jsonExtractor(\"userIdVariable\", \"userId\")) .children(jsonAssertion(\"dateTime\"))<\/code><\/pre>\n<p>\u0418\u0442\u0430\u043a, \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437\u0432\u043b\u0435\u043a\u043b\u0438, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 <code>GET \/users\/{userId}\/measurements<\/code>, \u043a\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 userId, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043c\u043e\u0436\u043d\u043e \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>${variableName}<\/code>, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e <code>${userIdVariable}<\/code> \u0438 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0440\u0430\u043d\u0435\u0435 \u0447\u0435\u0440\u0435\u0437 <code>jsonAssertion<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u0447\u0442\u043e \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u0443 \u043d\u0430\u0441 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 userId, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n<pre><code class=\"java\">httpSampler(\"http:\/\/localhost:8080\/users\/${userIdVariable}\/measurements\")                                 .method(HTTPConstants.GET)                                 .contentType(ContentType.APPLICATION_JSON)                                 .children(jsonAssertion(\"[*].userId\"))<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u0440\u0438\u043a \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0432 influxDbListener \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0432 Grafana, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0443 \u043d\u0430\u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e.<\/p>\n<pre><code class=\"java\">influxDbListener(\"http:\/\/localhost:8086\/write?db=jmeter\")                         .measurement(\"jmeter\")                         .application(\"jmeter\")                         .token(\"Token from influxDb\")<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e<a href=\"https:\/\/abstracta.github.io\/jmeter-java-dsl\/guide\/#influxdb\" rel=\"noopener noreferrer nofollow\"> \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043e \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u0445 \u0437\u0434\u0435\u0441\u044c<\/a>. \u0410 \u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f AssertJ, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0442\u0435\u0441\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e, \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 99-\u0439 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0438\u043b\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c \u0438\u043b\u0438 \u0440\u0430\u0432\u0435\u043d 5 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u043c.<\/p>\n<pre><code class=\"java\">assertThat(stats.overall().sampleTimePercentile99()).isLessThan(Duration.ofSeconds(5));<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c:<\/p>\n<pre><code class=\"java\">import org.apache.http.entity.ContentType; import org.apache.jmeter.protocol.http.util.HTTPConstants; import org.junit.jupiter.api.Test; import us.abstracta.jmeter.javadsl.core.TestPlanStats;  import java.io.IOException; import java.time.Duration;  import static com.ipavlov.jmeter.generator.RequestBodyGenerator.buildRequestBody; import static org.assertj.core.api.Assertions.assertThat; import static us.abstracta.jmeter.javadsl.JmeterDsl.*;  public class PerformanceTest {      private static final Integer THREADS = 5;     private static final Integer ITERATIONS = 10;      @Test     public void saveAndGetMeasurementsLoadTest() throws IOException {         TestPlanStats stats = testPlan(                 threadGroup(THREADS, ITERATIONS,                                                      httpSampler(\"http:\/\/localhost:8080\/measurements\")                                 .method(HTTPConstants.POST)                                 .post(s -> buildRequestBody(), ContentType.APPLICATION_JSON)                                 .children(jsonExtractor(\"userIdVariable\", \"userId\"))                                 .children(jsonAssertion(\"dateTime\")),                          httpSampler(\"http:\/\/localhost:8080\/users\/${userIdVariable}\/measurements\")                                 .method(HTTPConstants.GET)                                 .contentType(ContentType.APPLICATION_JSON)                                 .children(jsonAssertion(\"[*].userId\"))                  ), influxDbListener(\"http:\/\/localhost:8086\/write?db=jmeter\")                         .measurement(\"jmeter\")                         .application(\"jmeter\")                         .token(\"TOKEN from influxDb\")         ).run();          assertThat(stats.overall().sampleTimePercentile99()).isLessThan(Duration.ofSeconds(5));     } }<\/code><\/pre>\n<p><strong>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/strong><\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043b\u0430\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c, \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u0434 \u043d\u0430\u0448\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445, \u0430 JMeter-Java-Dsl \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435, \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0438 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u043b\u0430\u043d\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0434\u043b\u044f git \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u0432 CI\/CD, \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0432 \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p><em>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u043b\u0441\u044f, \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u043b \u044f, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043b\u0443\u0447\u0448\u0438\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438 \u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u044b, \u043d\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u0435 \u043c\u0438\u043c\u043e, \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c.<\/em><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/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\/articles\/758194\/\"> https:\/\/habr.com\/ru\/articles\/758194\/<\/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<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u041d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 JMeter-Java-Dsl<strong> <\/strong>\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043d\u0430\u0448 \u043f\u0435\u0440\u0432\u044b\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u0434\u043b\u044f API \u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f <a href=\"https:\/\/abstracta.github.io\/jmeter-java-dsl\/guide\/\" rel=\"noopener noreferrer nofollow\">JMeter Guide<\/a> \u0438 <a href=\"https:\/\/github.com\/igor-QA\/utilities-monitor\" rel=\"noopener noreferrer nofollow\">GitHub<\/a> \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043a\u043e\u0434\u0430 \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p><strong>\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/strong><\/p>\n<p><em>\u0411\u044b\u043b\u0430 \u0438\u0434\u0435\u044f \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f API, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 \u042f\u041f Java \u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 Gatling \u0438 JMeter \u0438 \u0432\u043e\u0442 \u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u043a\u0430\u043a \u0432\u0441\u0451 \u0431\u044b\u043b\u043e \u0438 \u0447\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/em><\/p>\n<p><em>\u0426\u0435\u043b\u044c\u044e \u0434\u043b\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u044b\u043b\u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043e <\/em><strong><em>\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u0430\u0437\u0430 \u0438 \u0432\u043e\u0434\u044b, \u0433\u0434\u0435 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e API <\/em><\/strong><em>(\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u2014 <\/em><a href=\"https:\/\/github.com\/igor-QA\/utilitiesMonitor\" rel=\"noopener noreferrer nofollow\"><em>\u00a0utilitiesMonitor<\/em><\/a><em>).<\/em><strong><em> <\/em><\/strong><em>\u041f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Spring-Boot \u0434\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043c\u0443\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u0443\u0433. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 REST:<\/em><\/p>\n<p><em>1. \u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:<\/em><\/p>\n<pre><code class=\"java\">POST \/measurements      {         \"userId\":1,         \"gas\":45.4,          \"coldWater\":45.2,         \"hotWater\":557     }<\/code><\/pre>\n<p><em>2. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u0441\u0442\u043e\u0440\u0438\u0439 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:<\/em><\/p>\n<pre><code class=\"java\">GET \/users\/{userId}\/measurements<\/code><\/pre>\n<p><em>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u044e, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e userId (\u043f\u043e POST \u0437\u0430\u043f\u0440\u043e\u0441\u0443) \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 userId \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 GET.\u00a0 \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u0434\u0430\u0442\u0435 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f.<\/em><\/p>\n<p><strong>\u0418\u0442\u0430\u043a, \u043f\u043e\u0435\u0445\u0430\u043b\u0438<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442 \u043f\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435, \u043f\u043e\u0439\u0434\u0451\u043c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e (\u0432\u043e\u0442 \u043e\u043d\u0430<a href=\"https:\/\/abstracta.github.io\/jmeter-java-dsl\/guide\/\" rel=\"noopener noreferrer nofollow\"> <em>\u2014<\/em> JMeter Guide<\/a>), \u043d\u043e \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0436\u0438\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0448\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b.<\/p>\n<p>\u0427\u0442\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e:<br \/>>>\u00a0 IDE, Java \u0438 \u0441\u0431\u043e\u0440\u0449\u0438\u043a, \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e IntelliJ IDEA,\u00a0 Java17 \u0438 Maven,<br \/>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442 (\u043e\u0442\u043f\u0443\u0441\u0442\u0438\u043c \u0434\u0435\u0442\u0430\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 ) \u0438 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0435\u0449\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c Jmeter-Java-Dsl\u00a0 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u0435\u0440\u0441\u0438\u044f 1.19<\/p>\n<pre><code class=\"java\">      &lt;dependency>           &lt;groupId>us.abstracta.jmeter&lt;\/groupId>           &lt;artifactId>jmeter-java-dsl&lt;\/artifactId>           &lt;version>1.19&lt;\/version>           &lt;scope>test&lt;\/scope>       &lt;\/dependency><\/code><\/pre>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c JUnit 5 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 AssertJ \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439.<\/p>\n<pre><code class=\"java\">      &lt;dependency>           &lt;groupId>org.junit.jupiter&lt;\/groupId>           &lt;artifactId>junit-jupiter&lt;\/artifactId>           &lt;version>RELEASE&lt;\/version>           &lt;scope>test&lt;\/scope>       &lt;\/dependency>       &lt;dependency>           &lt;groupId>org.assertj&lt;\/groupId>           &lt;artifactId>assertj-core&lt;\/artifactId>           &lt;version>RELEASE&lt;\/version>           &lt;scope>test&lt;\/scope>       &lt;\/dependency><\/code><\/pre>\n<p>\u0430 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 JavaFaker.<\/p>\n<pre><code class=\"java\">      &lt;dependency>       &lt;groupId>com.github.javafaker&lt;\/groupId>       &lt;artifactId>javafaker&lt;\/artifactId>       &lt;version>1.0.2&lt;\/version>       &lt;\/dependency><\/code><\/pre>\n<blockquote>\n<p>*\u043f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0442\u0430\u043a \u0438 \u043d\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0445 \u0434\u043b\u044f \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432.<\/p>\n<\/blockquote>\n<p><strong>\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u041f\u043b\u0430\u043d <\/strong><\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c Java class \u0438 \u0434\u0430\u0434\u0438\u043c \u0435\u043c\u0443 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: PerformanceTest , \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0448 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043b\u0430\u043d \u0434\u043b\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f API. \u0412 \u0446\u0435\u043b\u043e\u043c, JMeter-Java-Dsl \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u043e\u0449\u043d\u044b\u0439 \u0438 \u0433\u0438\u0431\u043a\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043b\u0430\u043d\u043e\u0432 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c, \u0434\u0430\u043b\u044c\u0448\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435, \u0427\u0442\u043e ? \u0413\u0434\u0435 ? \u041a\u043e\u0433\u0434\u0430 ?<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041d\u0430\u0448 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043b\u0430\u043d \u043d\u0430\u0447\u043d\u0451\u043c \u0441 <code>threadGroup<\/code>, \u0433\u0434\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432, \u043f\u0443\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 5 (\u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439) \u0438 10 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f, \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 THREADS \u0438 ITERATIONS, \u0430 \u0432 <code>httpSampler<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0430 \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e Post \u0437\u0430\u043f\u0440\u043e\u0441, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c &#171;\u0442\u0435\u043b\u043e&#187;, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u044b\u043b \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435, \u043d\u043e \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 userId, gas, coldWater, hotWater (\u0438\u0437 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430) \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435. \u042d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0434\u043e\u0441\u0442\u0438\u0447\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <code>csvDataSet<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u043c\u0435\u044f csv \u0444\u0430\u0439\u043b, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u044d\u0442\u043e\u043c\u0443:<\/p>\n<pre><code>USERID,GAS,COLDWATER,HOTWATER 1,11.1,42.1,111 10,11.2,42.3,112<\/code><\/pre>\n<p>\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043d\u0430\u0448 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043b\u0430\u043d <code>csvDataSet(\"path to csv\")<\/code>, \u0430 \u0443\u0436\u0435 \u0432 &#171;\u0442\u0435\u043b\u0435&#187; \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435\u00a0 ${USERID}, ${GAS}, ${COLDWATER}, ${HOTWATER}. <\/p>\n<p>\u0414\u043b\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u0421\u0447\u0451\u0442\u0447\u0438\u043a (Counter), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f<br \/>\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445.<a href=\"https:\/\/abstracta.github.io\/jmeter-java-dsl\/guide\/#csv-as-input-data-for-requests\" rel=\"noopener noreferrer nofollow\"> \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c<\/a><\/p>\n<p>\u041d\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438 \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0448\u0430\u0433\u0435 \u0432\u00a0 <code>.post(s -> buildRequestBody()<\/code> \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 &#171;\u0442\u0435\u043b\u0435&#187; \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c jsr223preProcessor, <a href=\"https:\/\/abstracta.github.io\/jmeter-java-dsl\/guide\/#provide-request-parameters-programmatically-per-request\" rel=\"noopener noreferrer nofollow\">\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e jsr223preProcessor<\/a>. \u0421\u0430\u043c\u044b\u0439 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0439 \u0438 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 <em>\u2014 <\/em>\u0447\u0435\u0440\u0435\u0437 \u043b\u044f\u043c\u0431\u0434\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"java\">TestPlanStats stats = testPlan(             threadGroup(THREADS, ITERATIONS,                     httpSampler(\"http:\/\/localhost:8080\/measurements\")                             .method(HTTPConstants.POST)                             .post(s -> buildRequestBody(), ContentType.APPLICATION_JSON)<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 &#171;\u043f\u0440\u043e\u0432\u0430\u043b\u0438\u043c\u0441\u044f&#187; \u0432 \u043c\u0435\u0442\u043e\u0434 <code>buildRequestBody()<\/code><strong> <\/strong>\u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c &#171;\u0442\u0435\u043b\u043e&#187; \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430, \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c JSONObject, \u043d\u043e \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u044b\u043b \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c JavaFaker \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 json. <a href=\"https:\/\/github.com\/DiUS\/java-faker\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f JavaFaker<\/a>.<\/p>\n<p>\u0422\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442:<\/p>\n<pre><code class=\"java\">public static String buildRequestBody() {         JSONObject jsonObject = new JSONObject();         jsonObject.put(\"userId\", getRandomInteger());         jsonObject.put(\"gas\", getRandomDouble());         jsonObject.put(\"coldWater\", getRandomDouble());         jsonObject.put(\"hotWater\", getRandomDouble());         return jsonObject.toJSONString();     }<\/code><\/pre>\n<p>\u041d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u0435 <code>POST\/measurements<\/code> \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437\u0432\u043b\u0435\u0447\u044c. \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c userId \u0438\u0437 \u043e\u0442\u0432\u0435\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>jsonExtractor<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>httpSampler<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e userId \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u0430\u0434\u0438\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439: \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e, \u043d\u0430\u0437\u043e\u0432\u0451\u043c userIdVariable \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 userId. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <code>jsonExtractor<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 JMeter JSON JMESpath Extractor \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, JMESpath \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044f\u0437\u044b\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. <a href=\"https:\/\/abstracta.github.io\/jmeter-java-dsl\/guide\/#json-extraction\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c<\/a>.<br \/>\u041d\u0435\u043b\u0438\u0448\u043d\u0438\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u0447\u0435\u0440\u0435\u0437 <code>jsonAssertion<\/code>, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u0435 <strong>dateTime<\/strong>,<a href=\"https:\/\/abstracta.github.io\/jmeter-java-dsl\/guide\/#check-for-expected-json\" rel=\"noopener noreferrer nofollow\"> \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f\u0445 \u0442\u0443\u0442<\/a>. \u0423\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <code>jsonAssertion<\/code>, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 json, \u0434\u0430 \u044d\u0442\u043e \u0438 \u0442\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f. \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f, \u043d\u0443\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>httpSampler<\/code> \u0438 \u0438\u0434\u0451\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u043e \u043d\u0430\u0448\u0435\u043c\u0443 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c\u0443 \u043f\u043b\u0430\u043d\u0443.\u00a0<\/p>\n<pre><code class=\"java\">.children(jsonExtractor(\"userIdVariable\", \"userId\")) .children(jsonAssertion(\"dateTime\"))<\/code><\/pre>\n<p>\u0418\u0442\u0430\u043a, \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437\u0432\u043b\u0435\u043a\u043b\u0438, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 <code>GET \/users\/{userId}\/measurements<\/code>, \u043a\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 userId, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043c\u043e\u0436\u043d\u043e \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>${variableName}<\/code>, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e <code>${userIdVariable}<\/code> \u0438 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0440\u0430\u043d\u0435\u0435 \u0447\u0435\u0440\u0435\u0437 <code>jsonAssertion<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u0447\u0442\u043e \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u0443 \u043d\u0430\u0441 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 userId, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n<pre><code class=\"java\">httpSampler(\"http:\/\/localhost:8080\/users\/${userIdVariable}\/measurements\")                                 .method(HTTPConstants.GET)                                 .contentType(ContentType.APPLICATION_JSON)                                 .children(jsonAssertion(\"[*].userId\"))<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u0440\u0438\u043a \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0432 influxDbListener \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0432 Grafana, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0443 \u043d\u0430\u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e.<\/p>\n<pre><code class=\"java\">influxDbListener(\"http:\/\/localhost:8086\/write?db=jmeter\")                         .measurement(\"jmeter\")                         .application(\"jmeter\")                         .token(\"Token from influxDb\")<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e<a href=\"https:\/\/abstracta.github.io\/jmeter-java-dsl\/guide\/#influxdb\" rel=\"noopener noreferrer nofollow\"> \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043e \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u0445 \u0437\u0434\u0435\u0441\u044c<\/a>. \u0410 \u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f AssertJ, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0442\u0435\u0441\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e, \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 99-\u0439 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0438\u043b\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c \u0438\u043b\u0438 \u0440\u0430\u0432\u0435\u043d 5 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u043c.<\/p>\n<pre><code class=\"java\">assertThat(stats.overall().sampleTimePercentile99()).isLessThan(Duration.ofSeconds(5));<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c:<\/p>\n<pre><code class=\"java\">import org.apache.http.entity.ContentType; import org.apache.jmeter.protocol.http.util.HTTPConstants; import org.junit.jupiter.api.Test; import us.abstracta.jmeter.javadsl.core.TestPlanStats;  import java.io.IOException; import java.time.Duration;  import static com.ipavlov.jmeter.generator.RequestBodyGenerator.buildRequestBody; import static org.assertj.core.api.Assertions.assertThat; import static us.abstracta.jmeter.javadsl.JmeterDsl.*;  public class PerformanceTest {      private static final Integer THREADS = 5;     private static final Integer ITERATIONS = 10;      @Test     public void saveAndGetMeasurementsLoadTest() throws IOException {         TestPlanStats stats = testPlan(                 threadGroup(THREADS, ITERATIONS,                                                      httpSampler(\"http:\/\/localhost:8080\/measurements\")                                 .method(HTTPConstants.POST)                                 .post(s -> buildRequestBody(), ContentType.APPLICATION_JSON)                                 .children(jsonExtractor(\"userIdVariable\", \"userId\"))                                 .children(jsonAssertion(\"dateTime\")),                          httpSampler(\"http:\/\/localhost:8080\/users\/${userIdVariable}\/measurements\")                                 .method(HTTPConstants.GET)                                 .contentType(ContentType.APPLICATION_JSON)                                 .children(jsonAssertion(\"[*].userId\"))                  ), influxDbListener(\"http:\/\/localhost:8086\/write?db=jmeter\")                         .measurement(\"jmeter\")                         .application(\"jmeter\")                         .token(\"TOKEN <\/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-353705","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/353705","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=353705"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/353705\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=353705"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=353705"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=353705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}