在Azure DevOps中的构建管道中运行分布式JMeter测试

9
我需要在Azure中使用JMeter进行分布式负载测试。
我不知道如何继续执行以下操作:
  • 使用类似于此的方法
  • 使用JMeter核心分布式测试,我需要设置一个主节点和从节点,但我不知道如何在管道中执行此操作,因为我需要启动多个虚拟机。

请注意,文本中的HTML标签已被保留。

1
你找到解决方案了吗?我在负载测试和Azure DevOps方面也遇到了同样的问题和疑问。 - pieter.lowie
你好,Azure管道中使用的好替代方案是什么? - variable
2个回答

1

在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脚本在流水线中启动/销毁新的虚拟机。

0
你是否了解基于云的Apache JMeter负载测试任务
# 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创建虚拟机,然后下载JMeter安装程序并根据您的测试方案进行配置


5
谢谢回答。是的,我知道这一点,但它已经被弃用了,所以我正在寻找更现代化的方法来实现它。 - Yution Lio
你好,Azure管道中使用的好替代方案是什么? - variable

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接