-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdelete_sequential_404s.yaml
72 lines (64 loc) · 1.77 KB
/
delete_sequential_404s.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Run this file with the test-server, then specify the PORT as a parameter to this try or run script.
# This file will delete sequentially until we get 50 (maxDelete404) 404s in a row. If we ever don't get a 404, it resets.
# Once we hit 50 in a row, it logs to `test_404s` logger which causes the test to exit with `kill: true`
vars:
port: "${PORT}"
ingestName: 'test:loadtest-'
maxDelete404: 50
maxSearchDelete404: 500
maxEmptySearch: 20
load_pattern:
- linear:
from: 100%
to: 100%
over: 15s
config:
client:
headers:
TestTime: '${epoch("ms")}'
Accept: application/json
providers:
createdId:
range:
start: 1
delete404s:
list:
values:
- 0 # Initial value to pre-populate a counter
repeat: false
loggers:
test:
to: stdout
test_404s:
limit: 1
to: stdout
pretty: false
kill: true
endpoints:
- method: DELETE
url: 'http://localhost:${port}?id=${ingestName}${start_pad(createdId, 6, "0")}?include-children=true'
tags:
status: ${response.status}
headers:
Delete404s: ${delete404s}
peak_load: 1hps
provides:
delete404s:
select: if(response.status == 404, delete404s + 1, 0)
send: force
logs:
test:
select:
id: '`${ingestName}${start_pad(createdId, 6, "0")}`'
delete404s: delete404s
test_404s:
select:
timestamp: epoch("ms")
id: '`${ingestName}${start_pad(createdId, 6, "0")}`'
request: request["start-line"]
response: response["start-line"]
status: response.status
delete404s: delete404s
maxDelete404: maxDelete404
where: response.status == 404 && delete404s >= maxDelete404
# where: response.status == 404