加特林模型3d

Gatling, Maven, and IntelliJ are all keywords we’ve seen on LinkedIn and various job descriptions and there are good tutorials out there which outline the prerequisites and how to install Gatling. I thought I would document what I have learned from online resources during my investigation into performance testing.

Gatling,Maven和IntelliJ都是我们在LinkedIn上看到的关键字以及各种职位描述,并且那里有不错的教程,概述了必备条件以及如何安装Gatling。 我认为我应该记录在性能测试调查期间从在线资源中学到的东西。

In this post, I will go through the steps required to set up a performance test suite using the tools Gatling, Apache Maven, and IntelliJ+Scala Plugin, along with how to install the required software.

在本文中,我将介绍使用Gatling,Apache Maven和IntelliJ + Scala插件工具来建立性能测试套件所需的步骤,以及如何安装所需的软件。

A bit about my system setup - OS: Windows 10, system type: x64, RAM: 16GB.

关于我的系统设置的一些信息-操作系统:Windows 10,系统类型:x64,内存:16GB。

STEP 1: Install Java 8 JDK

步骤1:安装Java 8 JDK

Why: because Gatling uses JAVA to run.

原因:因为加特林使用JAVA来运行。

Download the Java 8 JDK (64 bit) package from Oracle and run the program to kick off the installation process. Take note of where your JDK is being installed as we will need this later (usually C:\Program Files\ Java).

从Oracle下载Java 8 JDK(64位)软件包,然后运行该程序以开始安装过程。 请注意您的JDK的安装位置,因为稍后我们将需要它(通常是C:\ Program Files \ Java)。

Once completed edit your environment variables by: Start > type in environment variables > click ‘Edit the system environment variables’

完成后,通过以下方式编辑环境变量:开始>键入环境变量>单击“编辑系统环境变量”

Here you will need to add JAVA_HOME and add java bin to the PATH variable.

在这里,您需要添加JAVA_HOME并将Java bin添加到PATH变量。

Click new to add variable name as JAVA_HOME and variable value as the path where you installed Java (for me it was C:\Program Files\Java\jdk1.8.0_261).

单击“新建”以将变量名称添加为JAVA_HOME,并将变量值添加为Java安装路径(对我来说是C:\ Program Files \ Java \ jdk1.8.0_261)。

Find PATH in the list of system variables and edit PATH via Path > Edit. Add a new environment variable to path which directs to your Java bin folder (mine was C:\Program Files\Java\jdk1.8.0_261\bin).

在系统变量列表中找到PATH,然后通过路径>编辑来编辑PATH。 在指向您的Java bin文件夹的路径中添加一个新的环境变量(我的位置是C:\ Program Files \ Java \ jdk1.8.0_261 \ bin)。

Java bin location added to path environment variable.
Java bin位置已添加到路径环境变量。

You can verify Java was installed properly by opening cmd terminal and entering java -version . If it is installed incorrectly you will get an error.

您可以通过打开cmd终端并输入java -version来验证Java是否已正确安装。 如果安装不正确,则会出现错误。

Java successfully installed.
Java安装成功。

STEP 2: Install Apache Maven

步骤2:安装Apache Maven

Why: because we need a build tool to compile our simulations and Maven has an official Gatling plugin for this.

原因:因为我们需要构建工具来编译我们的仿真,所以Maven为此提供了一个官方的Gatling插件。

Download the Maven binary zip file from: https://maven.apache.org/download.cgi.

从以下网址下载Maven二进制zip文件: https : //maven.apache.org/download.cgi 。

Unzip this file in your C:\ drive or another suitable location.

将此文件解压缩到C:\驱动器或其他合适的位置。

Do our favourite thing and set the environment variables for MAVEN_HOME and the Maven bin path in PATH using the same procedure as the JAVA step.

做我们喜欢的事情,并使用与JAVA步骤相同的过程为MAVEN_HOME和PATH中的Maven bin路径设置环境变量。

MAVEN_HOME system variable set.
MAVEN_HOME系统变量集。
Maven bin variable added to PATH environment variable.
Maven bin变量已添加到PATH环境变量中。

You can verify Maven has been installed correctly by opening cmd terminal and entering: mvn -v.

您可以通过打开cmd终端并输入: mvn -v来验证Maven是否已正确安装。

Maven successfully installed.
Maven已成功安装。

STEP 3: Install Gatling

步骤3:安装加特林

Download the Gatling community version from https://gatling.io/open-source/.

从https://gatling.io/open-source/下载Gatling社区版本。

Unzip the file to C drive, this matters greatly when using windows as if it is unzipped to program files there tends to be permission and path issues (warning from Gatling themselves https://gatling.io/docs/current/installation/).

将文件解压缩到C驱动器,这在使用Windows时非常重要,就像将其解压缩到程序文件时一样,这往往会存在权限和路径问题(请警告Gatling自己https://gatling.io/docs/current/installation/ )。

Once unzipped, edit the environment variables one last and final time to add GATLING_HOME and PATH.

解压缩后,最后一次也是最后一次编辑环境变量,以添加GATLING_HOME和PATH。

Setting GATLING_HOME environment variable.
设置GATLING_HOME环境变量。
Adding Gatling bin variable to Path.
将加特林bin变量添加到Path。

STEP 4: Install IntelliJ with Scala Plugin

步骤4:使用scala插件安装IntelliJ

Why: IntelliJ is an IDE that can be used to view a Gatling project, it has an in built terminal where for test execution.

原因:IntelliJ是可用于查看Gatling项目的IDE,它具有内置的终端,可用于执行测试。

Download IntelliJ Community and follow the setup process: https://www.jetbrains.com/idea/download/#section=windows.

下载IntelliJ社区并遵循设置过程: https : //www.jetbrains.com/idea/download/#section=windows 。

When IntelliJ is first opened after install, the user is prompted to set display settings and given the opportunity to disable default plugins. After this the user is prompted to install any featured plugins, from the list choose to install Scala as this will be the language used to write Gatling tests.

安装后首次打开IntelliJ时,将提示用户设置显示设置,并有机会禁用默认插件。 之后,提示用户安装所有特色插件,从列表中选择安装Scala,因为这将是编写加特林测试的语言。

Install Scala plugin for IntelliJ.
为IntelliJ安装Scala插件。

IntelliJ Community is then ready for use.

IntelliJ社区就可以使用了。

STEP 5: Create a performance test project

步骤5:创建一个性能测试项目

Create a base project using maven gatling archetype. This will download the gatling dependencies required and create a project template. Using cmd terminal navigate to the folder you would like your project to be created in and use the following command.

使用Maven Gatling原型创建基础项目。 这将下载所需的加特林依赖关系并创建项目模板。 使用cmd终端导航到要在其中创建项目的文件夹,然后使用以下命令。

mvn archetype:generate -DarchetypeGroupId=io.gatling.highcharts -DarchetypeArtifactId=gatling-highcharts-maven-archetype

Following this you will be asked to define group id, artifact id, version, these variables will allow you to set your project name, source folder name, and version. This will create a project folder which you can open in IntelliJ. In my example I set group id as postcodes-performance-tests, artifact id as test, and left the version blank.

之后,将要求您定义组ID,工件ID,版本,这些变量将允许您设置项目名称,源文件夹名称和版本。 这将创建一个项目文件夹,您可以在IntelliJ中打开它。 在我的示例中,我将组标识设置为邮政编码性能测试,将工件标识设置为测试,并将版本留空。

Project setup in IntelliJ.
IntelliJ中的项目设置。

The src folder that is created should be set to sources root so IntelliJ knows to compile this code.

应该将创建的src文件夹设置为源root,以便IntelliJ知道要编译此代码。

src file set as sources root.
src文件设置为源根目录。

The src folder is spilt into two directories, resources and scala. Resources will contain your request bodies (in bodies folder) and any test data you may need (in data folder). There is also a Gatling.conf file, it is possible to edit Gatling.conf to customise your settings, but leaving it commented out means we will use the gatling-defaults.conf which is not editable. The scala folder is where the simulation information will be stored, you can set this up in a way that is suitable for you but I found it useful to follow this tutorial for a concise framework setup: https://devqa.io/gatling-maven-performance-test-framework/.

src文件夹会溅入两个目录,资源和scala。 资源将包含您的请求正文(在body文件夹中)和您可能需要的任何测试数据(在data文件夹中)。 还有一个Gatling.conf文件,可以编辑Gatling.conf以自定义您的设置,但是将其注释掉意味着我们将使用不可编辑的gatling-defaults.conf。 scala文件夹是存储模拟信息的位置,您可以通过适合自己的方式进行设置,但是我发现遵循本教程进行简洁的框架设置很有用: https : //devqa.io/gatling- Maven性能测试框架/ 。

Project setup.
项目设置。

POM.xml will be used to set up your compile configuration.

POM.xml将用于设置编译配置。

Auto-generated POM.xml file.
自动生成的POM.xml文件。

STEP 6: Writing the first test

步骤6:编写第一个测试

For this tutorial I will be using the open source Postcodes API: https://postcodes.io/ and get postcodes as my test endpoint: api.postcodes.io/postcodes which uses a post method.

在本教程中,我将使用开源Postcodes API: https ://postcodes.io/,并将邮政编码作为我的测试端点:api.postcodes.io/postcodes,它使用了post方法。

First step is to create the test request, for this I created a JSON file within my test/resources/bodies directory.

第一步是创建测试请求,为此,我在test / resources / bodies目录中创建了一个JSON文件。

JSON request body.
JSON请求正文。

Next, we need to set up our config, requests, test scenarios, and simulations.

接下来,我们需要设置配置,请求,测试方案和模拟。

Config: within the test/scala/config folder create a Configuration scala class here you can set the base URL and the variables for users and ramp up (default to 1 but can be specified during execution using the users or ramp up flag) for your tests. You can also include other configuration parameters such as throughput.

Config :在test / scala / config文件夹中创建一个Configuration scala类,您可以在此处为用户设置基本URL和变量并进行加速(默认为1,但可以在执行过程中使用users或ramping标志指定)。测试。 您还可以包括其他配置参数,例如吞吐量。

Example configuration file.
示例配置文件。

Requests: Within the test/scala/requests folder create individual request Scala classes for your endpoints under test, for example here I used the GetPostcodes endpoint and I set the application type, request body type and I specified where the JSON request is kept within my project. I also verify that a 200 response is return to ensure the happy path is tested. These requests will be called upon within our scenario classes.

请求:在test / scala / requests文件夹中,为要测试的端点创建单独的请求Scala类,例如,在这里,我使用了GetPostcodes端点,并设置了应用程序类型,请求主体类型,并指定了将JSON请求保存在我的位置项目。 我还验证是否返回了200响应,以确保对快乐路径进行了测试。 这些请求将在我们的场景类中调用。

Example request class.
示例请求类。

Scenarios: Within the test/scala/scenarios folder create individual scenario Scala classes for your endpoints under test, for example here I set the scenario for the GetPostcodes endpoint and I executed the GetPostcodes request stored within test/scala/requests folder.

方案:在test / scala / scenarios文件夹中,为要测试的端点创建单独的方案Scala类,例如,在这里,我为GetPostcodes端点设置方案,并执行了存储在test / scala / requests文件夹中的GetPostcodes请求。

Example scenario class.
示例方案类。

Simulations: Within the test/scala/simulations folder create individual simulation Scala scripts which is where you define your simulation parameters. In this case, I executed the scenario for GetPostcodes using the ramp up and users I have defined in my configuration file.

模拟:在test / scala / simulations文件夹中,创建单独的模拟Scala脚本,您可以在其中定义模拟参数。 在这种情况下,我使用在配置文件中定义的提升和用户执行了GetPostcodes方案。

Example simulation script.
模拟脚本示例。

The final item to define is the POM.xml, here we will specify which simulations to run using the <configuration> tag.

最后要定义的项目是POM.xml,在这里我们将使用<configuration>标签指定要运行的模拟。

Configuration setup for GetPostcodes Simulation.
GetPostcodes仿真的配置设置。

STEP 7: Test execution

步骤7:测试执行

The tests can be run using the IntelliJ in built terminal or cmd line using the command: mvn clean gatling:test

可以使用以下命令在内置终端或cmd行中使用IntelliJ运行测试: mvn clean gatling:test

Test execution.
测试执行。

The project will build and any simulations specified in POM.xml will be executed with the default settings with a report file output.

将生成项目,并使用默认设置执行POM.xml中指定的任何模拟,并输出报告文件。

Successful test execution.
成功执行测试。
Example HTML report.
HTML报告示例。

If the test was not successful due to build errors, you will get a build error failure with error messages — google group and stack overflow are good places to search for resolution to any errors you may encounter.

如果由于构建错误而导致测试失败,您将收到包含错误消息的构建错误失败消息-Google组和堆栈溢出是寻求解决可能遇到的任何错误的好地方。

If the test was not successful due to test failure, a report will still be generated with failure reason.

如果由于测试失败而导致测试失败,则仍将生成带有失败原因的报告。

If you would like to specify users or ramp up time use the flags -Dusers=<numberofusers> and -Drampup=<rampuptimeinsecs>.

如果要指定用户或加速时间,请使用标志-Dusers=<numberofusers>-Drampup=<rampuptimeinsecs>

mvn clean gatling:test -Dusers=100 -Drampup=10

Hopefully, you have found this tutorial helpful. Please leave a comment if you have any questions or requests for follow up information. Also, please check out the following links which I found useful during my research.

希望您发现本教程对您有所帮助。 如果您有任何疑问或要求后续信息,请发表评论。 另外,请查看以下在我的研究中发现有用的链接。

Gatling docs: https://gatling.io/docs/current/quickstart/

加特林文档: https : //gatling.io/docs/current/quickstart/

Maven docs: https://maven.apache.org/guides/index.html

Maven文档: https : //maven.apache.org/guides/index.html

Why Gatling: https://www.blazemeter.com/blog/eight-reasons-you-should-use-gatling-for-your-load-testing?utm_source=blog&utm_medium=BM_blog&utm_campaign=how-to-install-gatling-on-windows

为什么加特林: https : //www.blazemeter.com/blog/eight-reasons-you-should-use-gatling-for-your-load-testing ? utm_source = blog & utm_medium = BM_blog & utm_campaign = how-to-install-gatling-on -视窗

How to install Gatling on windows: https://www.blazemeter.com/blog/how-to-install-gatling-on-windows

如何在Windows上安装加特林: https : //www.blazemeter.com/blog/how-to-install-gatling-on-windows

How to set up a Gatling test framework: https://devqa.io/gatling-maven-performance-test-framework/

如何建立Gatling测试框架: https : //devqa.io/gatling-maven-performance-test-framework/

翻译自: https://medium.com/swlh/a-beginners-guide-to-performance-testing-with-gatling-225ef2c20cda

加特林模型3d


http://www.taodudu.cc/news/show-8200130.html

相关文章:

  • P5249 [LnOI2019]加特林轮盘赌
  • 加特林大战僵尸(极限思想)
  • [LnOI2019]加特林轮盘赌
  • 加特林大战僵尸
  • 洛谷5249加特林轮盘赌
  • 加特林大战僵尸(时间的比较问题)
  • Facebook Libra深度分析报告 | TokenInsight
  • JDMAIL金笛新型反垃圾网关系统技术简介
  • 躲过子弹风水技巧
  • 中国优质耐火材料行业市场供需与战略研究报告
  • hdu 1113 Word Amalgamation
  • SpringBoot学习笔记(三) Initializr方式建立工程,resources文件夹
  • 器Resco发布移动应用程序动态CRM客户需要所有与它想现在谁
  • xUtils 获取网络数据 + RecycleView 显示数据+ F resco 加载图片 + ButterKnife 初始化控件
  • 手机游戏 resco bubbles 个人记录 score
  • WindowsPhone第三方控件-Resco MobileForms Toolkit 2012
  • FDM推导笔记-2
  • FDM推导笔记-4
  • FDM推导笔记-3
  • 通信原理板块——频分复用(FDM)
  • 干货分享:FDM 3D打印纤维增强复合材料的进一步发展
  • 【计算机网络】名词解释(二)|物理层
  • 2012第三届蓝桥杯软件大赛Java语言本科组初赛试题
  • 计算机组成联合右移,新计算机组成原理试题.doc
  • 华为OD机试 - 叠放书籍(Python) | 机试题算法思路 【2023】
  • 蓝桥杯 试题 算法训练 审美课(C语言)
  • 试题 算法训练 审美课
  • 华为OD机试 - 对称美学,对称字符串 | 备考思路,刷题要点,答疑 【新解法】
  • 华为OD机试 - 对称美学(Java JS Python)
  • 华为OD机试题【对称美学,对称字符串】用 Java 解 | 含解题说明

加特林模型3d_带有加特林的性能测试初学者指南相关推荐

  1. BIM模型文件下载——带有机电设备的机房模型

    [资源介绍] 资源名称:带有机电设备的机房模型 资源分类:BIM模型.Revit模型 其他简介:BIM模型文件下载--带有机电设备的机房模型 [资源下载] 链接:https://pan.baidu.c ...

  2. Unity增强现实初学者指南视频教程 A Beginner’s Guide to Augmented Reality with Unity

    Unity增强现实初学者指南视频教程 A Beginner's Guide to Augmented Reality with Unity MP4 |视频:h264,1280×720 (部分1920X ...

  3. NHibernate初学者指南(15):使用LINQ to NHibernate提供程序查询数据

    在前面的<NHibernate初学者指南(8):增删查改>一文中简单的提到了查询一个实体的Get<T>和Load<T>方法以及查询实体列表的Query<T&g ...

  4. 使用 OpenAI API 构建 Next.js 应用程序的初学者指南

    欢迎阅读我们的初学者指南,了解如何使用 OpenAI API 构建 Next.js 应用程序.在本教程中,我们将引导您完成利用 OpenAI API 的功能创建功能强大且智能的 Next.js 应用程 ...

  5. RAC 和 Oracle Clusterware 最佳实践和初学者指南 (Solaris) (文档 ID 1526517.1)

      RAC 和 Oracle Clusterware 最佳实践和初学者指南 (Solaris) (文档 ID 1526517.1) 转到底部 文档内容 用途   适用范围   详细信息   RAC 和 ...

  6. 《C语言编程初学者指南》一1.5 使用程序语句

    本节书摘来自异步社区<C语言编程初学者指南>一书中的第1章,第1.5节,作者[美]Keith Davenport(达文波特) , M1ichael Vine(维恩),更多章节内容可以访问云 ...

  7. python编程电子书下载-python编程初学者指南

    python编程初学者指南全书共12章,内容浅显易懂,书中的每一个章节都会用一个完整的游戏来演示其中的关键知识点,最后都会对该章的知识点进行小结,还会给出一些小练习让你试试身手.东坡小编为大家分享py ...

  8. python编程初学者指南pdf-Python物理建模初学者指南

    Python物理建模初学者指南 下载 mobi epub pdf ☆☆☆☆☆ [美] Jesse,M.Kinder,Philip,Nelson 著,盖磊 译 下载链接在页面底部 发表于2020-10- ...

  9. python编程入门指南上下百度云-Python编程初学者指南 PDF扫描版[87MB]

    Python编程初学者指南 内容简介: 如果你刚刚接触Python编程,而且正在寻找一本实用的教程,那么这本书为你量身打造.通过阅读本书,你不仅会学到很多实用的Python编程知识,还将懂得如何在实际 ...

  10. 《Python编程初学者指南》——1.2 Python简介

    本节书摘来自异步社区<Python编程初学者指南>一书中的第1章,第1.2节,作者[美]Michael Dawson,王金兰 译,更多章节内容可以访问云栖社区"异步社区" ...

最新文章

  1. MLIR(Multi-Level Intermediate Representation Compiler)架构 Infrastructure
  2. 漫画:如何给女朋友解释什么是删库跑路?
  3. [转载zz] Python3 输入和输出之序列化与反序列化
  4. Android网络传输中必用的两个加密算法:MD5 和 RSA (附java完成测试代码)
  5. Qt 通过鼠标移动窗口
  6. 【源码学习之spark core 1.6.1 各种部署模式所使用的的TaskSceduler及SchedulerBackend】...
  7. linux中使用xshell远程连接
  8. mac memcached_Mac OS X上的Java Memcached
  9. 【计算机思维】面向人的开发 站在巨人的肩膀上
  10. led伏安特性实验误差分析_高中物理 | 电学实验满分知识点总结+拓展+例题精讲,罕见的好资料,收藏不亏!...
  11. identifier is too long 异常处理
  12. 单体测试书的检查要点
  13. include 头文件循环引用问题
  14. 安装VTN协调器操作步骤
  15. 如何更改HomePod使用的Apple ID?
  16. 大学计算机课程进制的转换教程,交大计算机课程(1):各种进制转换
  17. spyder报错汇总
  18. GEEer成长日记十二:Modis_LST地表温度产品时间序列分析
  19. 内存泄漏问题该如何解决-面试学习笔记
  20. 输入框限制输入表情的方法

热门文章

  1. 河南中原工学院计算机专业录取分数线,2018年中原工学院艺术类本科专业录取分数线...
  2. linux图形界面基本知识(X11、WM、gnome、KDE等的关系)
  3. 发作性睡病是什么原因引起的?
  4. 学习python爬虫需要掌握哪些库?
  5. Error response from daemon: Cannot restart container XXX: driver failed programming external conn
  6. 微信开发公众号--基础
  7. java面向对象前的基础知识
  8. 【转载】从零开始学习「张氏相机标定法」
  9. 【写作能力】001-写作能力是人人需要的底层能力
  10. 企业社会责任:竞争和互补框架的核心Corporate social responsibility: The centerpiece of competing and complementary fra