书接上文:
通过 @harsayer小马哥的领路入门@Nuanyang2333 明远大神 的深夜介绍
机缘巧合下的我估计可能发现了 Jmeter 的更高级打开方式 BlazeMeter 和他的核心组件 taurus

读前准备 -- 会用到的英文单词 (百度翻译):

我的理解:

TaurusYML 结构 ---注解---
execution 执行配置部分
scenarios 场景配置部分
reporting 接口配置部分

安装以及 Docker 镜像的打开方式

入门简介

举三个栗子:

1.青铜栗子:

execution:
- concurrency: 100      #并发 100
  ramp-up: 1m              #斜坡上升1分钟
  hold-for: 5m               #坚持5分钟
  scenario: quick-test   #场景“quick-test”

scenarios:                 
  quick-test:               #场景名称
    requests:               #发起请求(大胆猜测默认是get请求)
    - http://blazedemo.com     #请求的地址

2.钻石栗子:

execution:
- iterations: 50
  concurrency: 10
  scenario: with_script

scenarios:
  with_script:
    script: my-existing.jmx

reporting:                                                                 
- module: passfail                                                     #报告样式:passfail版
  criteria:                                                                    #成功/失败标准
  - "avg-rt>150ms for 10s, continue as failed"           #断言部分1
  - "fail>50% for 10s, stop as failed"                          #断言部分2

3.王者栗子: 欢迎钻石级别以上玩家挑战

execution:
- concurrency: 250
  throughput: 500
  ramp-up: 3ms
  hold-for: 1h
  steps: 5
  scenario: blazemeter-recording

scenarios:
  blazemeter-recording:
    timeout: 5s
    retrieve-resources: false
    store-cache: false
    store-cookie: false
    default-address: http://blazedemo.com
    headers:
      User-Agent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36'
      Accept-Language: 'ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4'
      Accept-Encoding: 'gzip, deflate, sdch'
      Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp'
    requests:
    - /index.php
    - url: '/reserve.php'
      method: POST
      headers:
        Content-Type: application/x-www-form-urlencoded
      body:
        fromPort: Boston
        toPort: London
    - url: '/purchase.php'
      method: POST
      headers:
        Content-Type: application/x-www-form-urlencoded
      body:
        airline: United Airlines
        flight: '234'
        fromPort: Boston
        price: '432.98'
        toPort: London
    - url: '/confirmation.php'
      method: POST
      label: '/confirmation.php'
      headers:
        Content-Type: application/x-www-form-urlencoded
      body:
        address: test
        cardType: visa
        city: test
        creditCardNumber: test
        inputName: test
        nameOnCard: ettest
        rememberMe: 'on'
        state: test
        zipCode: test
    - /index.php
    - /vacation.html

排过的坑

modules:
  blazemeter:
    token: 6666666666666:bb6666666666089ad6ee934b9a5c6871c10   #在你的BlazeMeter
    #APIid:d9a0d1fa2d37848d3db05a4c  # APIid and API secret joined with ':'
    #API secret :bb9c42e0b28136198560111f1b8397a20d6277a8962a9fcbb089ad6ee934b9a5c6871c10
    test: Test1  # name for test to store reports
    project: MyProject # name for project to store test, can be numeric project ID
    public-report: false  # set to true to create a public link to the report

在运行 CLI 时 加上参数

./base-bzt-rc.yml

例如:

bzt xxx.yml ./base-bzt-rc.yml

(别问我如何知道的,你翻看几次文档和英文视频推敲下就知道了)

运行过成中 Taurus 会启动一个 python Gui 的仪表盘 监控脚本运行的情况(失败率、运行进度、失败原因、压力机性能参数、概况曲线图)

> 就这样,一份高大上(清晰明 liao)的测试报告就生成好了。





土味结尾:
" 一二三 ,木头人。"
" 你输了,因为你的心动了。"
或许,你该去试试这款新的工具了~


↙↙↙阅读原文可查看相关链接,并与作者交流