Мой load-test.yml, который мы используем для загрузки теста Nodejs проекта API. :
Nos:
- ['123','456']
environments:
development:
target: 'http:/api:4000'
phases:
- duration: 10
arrivalRate: 4 # ramp up to 40 RPS
processor: './load-test-helper.js'
http:
timeout: 15
#--------------------------------------Search SCENARIOS------------------------------------
scenarios:
- name: 'running search'
flow:
- log: 'Current environment is set to: {{ $environment }}'
- loop:
- get:
url: '/search/{{ $loopElement }}'
beforeRequest: 'setJSONBody'
afterResponse: 'processResponse'
over: Nos
#--------------------------------------Acct SCENARIOS------------------------------------
- name: ‘acct search'
flow:
- loop:
- get:
url: '/{{ $loopElement }}/connected-accts'
beforeRequest: 'setJSONBody'
afterResponse: 'processResponse'
over: Nos
Журналы консоли из моего сценария тестирования нагрузки артиллерии:
Report @ 12:29:45(-0700) 2020-03-19
Elapsed time: 10 seconds
Scenarios launched: 39
Scenarios completed: 18
Requests completed: 37
**RPS sent: 5.98**
Request latency:
min: 744.5
max: 1767
median: 863.9
p95: 1681
p99: 1767
Codes:
200: 37
Report @ 12:29:55(-0700) 2020-03-19
Elapsed time: 20 seconds
Scenarios launched: 1
Scenarios completed: 3
Requests completed: 5
RPS sent: 0.3
Request latency:
min: 767.6
max: 895.1
median: 874.6
p95: 895.1
p99: 895.1
Codes:
200: 5
Errors:
ESOCKETTIMEDOUT: 8
All virtual users finished
Summary report @ 12:30:00(-0700) 2020-03-19
Scenarios launched: 40
Scenarios completed: 21
Requests completed: 42
RPS sent: 2.46
Request latency:
min: 744.5
max: 1767
median: 867.3
p95: 1657.8
p99: 1767
Scenario counts:
acct search: 19 (47.5%)
running search: 21 (52.5%)
Codes:
200: 42
Errors:
ESOCKETTIMEDOUT: 19
Почему колеблется RPS? Измеряется ли количество полученных ответов? Я рассчитываю на стабильную загрузку 40 RPS и надеюсь, что средняя задержка составит 40RPS.