【问题标题】:Running distributed JMeter test on Azure DevOps within build pipeline在构建管道中在 Azure DevOps 上运行分布式 JMeter 测试
【发布时间】:2019-08-14 13:47:46
【问题描述】:

我需要在 Azure 中使用 JMeter 进行分布式负载测试。

我不知道该怎么做:

  • 使用类似于one 的方法
  • 使用 JMeter 核心分布式测试,我需要设置 1 个主节点和从节点,但我不知道如何在管道中执行此操作,因为我需要启动多个虚拟机

【问题讨论】:

  • 您找到解决方案了吗?我在负载测试和 azure devops 方面遇到了同样的问题。
  • 您好,在 Azure 管道中使用什么好的替代方法?

标签: azure jmeter azure-devops performance-testing jmeter-plugins


【解决方案1】:

你知道Cloud-based Apache JMeter Load Test task

# Cloud-based Apache JMeter Load Test
# Runs the Apache JMeter load test in cloud
- task: ApacheJMeterLoadTest@1
  inputs:
    #connectedServiceName: # Optional
    testDrop: 
    loadTest: 'jmeter.jmx' 
    agentCount: '2' 
    #runDuration: '60' # Options: 60, 120, 180, 240, 300
    #geoLocation: 'Default' # Optional. Options: default, australia East, australia Southeast, brazil South, central India, central US, east Asia, east US 2, east US, japan East, japan West, north Central US, north Europe, south Central US, south India, southeast Asia, west Europe, west US
    #machineType: '0' # Optional. Options: 0, 2

如果您想手动完成所有操作,您可以使用 Azure CLIREST API 创建 VM,完成后您可以下载 JMeter 安装和 configure it according to your test scenario

【讨论】:

  • 感谢您的回答。是的,我知道它,但它已被弃用,所以我正在寻找一种更新的方法来做到这一点。
  • 您好,在 Azure 管道中使用什么好的替代方法?
【解决方案2】:

在 Azure 管道中使用 JMeter 的最佳方法之一是将性能测试用例配置为 maven 项目。因此,您不需要使用已弃用的基于云的 Apache JMeter 负载测试任务。

有一个现有的插件可以帮助您:

<plugins>
                <plugin>
                    <groupId>com.lazerycode.jmeter</groupId>
                    <artifactId>jmeter-maven-plugin</artifactId>
                    <version>2.9.0</version>
                    <executions>
                        <execution>
                            <id>jmeter-tests</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>jmeter</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <resultsFileFormat>xml</resultsFileFormat>
                        <propertiesUser>
                            <hostname>${test.hostname}</hostname>
                            <env>${test.env}</env>
                        </propertiesUser>
                    </configuration>
                </plugin>
            </plugins>

更多信息在这里:

  1. https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Basic-Configuration
  2. https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Remote-Server-Configuration

我已经使用这个插件一年了,它得到了惊人的支持。

我正在使用 Terraform 使用 shell 脚本启动/销毁管道中的新 VM 机器。

【讨论】:

    猜你喜欢
    • 2020-01-29
    • 2020-01-08
    • 1970-01-01
    • 2020-12-24
    • 2019-05-01
    • 1970-01-01
    • 2020-01-14
    • 2023-03-09
    • 2021-01-21
    相关资源
    最近更新 更多