【问题标题】:How to make the performance trend visible/available with jenkins pipeline on Jenkins when using jmeter-maven-plugin for running the jmeter tests?使用 jmeter-maven-plugin 运行 jmeter 测试时,如何通过 Jenkins 上的 jenkins 管道使性能趋势可见/可用?
【发布时间】:2021-10-02 02:57:54
【问题描述】:

我正在尝试在 jenkins 管道中创建添加构建步骤以使性能报告可见,下面是代码 sn-p

但我的问题是插件生成的文件名不固定(yyyymmdd 是前置的)。例如:20210723-jmeter-resultFile.csv

有人可以推荐吗?

stage('Execute Jmeter') {
        post{
            always{
                dir("/target/jmeter/results/"){
                    sh 'pwd'
                      perfReport '20210723-jmeter-resultFile.csv'
                }
            
            }
        }
        }

【问题讨论】:

    标签: jenkins jmeter jenkins-pipeline jmeter-maven-plugin


    【解决方案1】:
    1. 您可以 remove this "prepended" timstamp 将下一行添加到您的 pom.xml 文件中:

      <configuration>
          <testResultsTimestamp>false</testResultsTimestamp>
      </configuration>
      
    2. 您可以在pipeline 中计算当前时间戳,如:

      def reportFileName = new Date().format('yyyyMMdd') + '-jmeter-resultFile.csv'
      
    3. 您可以使用Ant FileSet style 表达式指定结果文件的路径,例如:

      perfReport '**/*.csv'
      

    更多信息:How to Use the Jenkins Performance Plugin

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多