Debian Codegraph @

cmd/atomdns/handlers/drunk/README.md

raw
1 # Name
2
3 _drunk_ - test client behavior
4
5 # Description
6
7 _drunk_ sits in between a handler that answers a query and the client, any response can be delayed, dropped or truncated.
8
9 # Syntax
10
11 ```txt
12 drunk {
13 drop [/N]
14 truncate [/M]
15 delay [/L [DURATION]]
16 }
17 ```
18
19 - `drop`: drop every /**N** query, the default is one in four (/4).
20 - `truncate`: truncate every /**M** query, the default is /4.
21 - `delay`: delay every /**L** query for **DURATION**, the default for is /2 and the default for **DURATION** is 100ms.
22
23 # Examples
24
25 Drop every 1 in 3 queries to `example.org`:
26
27 ```conffile
28 example.org {
29 drunk {
30 drop /3
31 }
32 whoami
33 }
34 ```
35
36 Or even shorter if the defaults suit you. Note this only drops queries, it does not delay them.
37
38 ```conffile
39 example.org {
40 drunk
41 whoami
42 }
43 ```
44
45 Delay 1 in 3 queries for 50ms
46
47 ```conffile
48 example.org {
49 drunk {
50 delay /3 50ms
51 }
52 whoami
53 }
54 ```
55
56 Delay 1 in 3 and truncate 1 in 5.
57
58 ```conffile
59 example.org {
60 drunk {
61 delay /3 5ms
62 truncate /5
63 }
64 whoami
65 }
66 ```