-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
120 lines (106 loc) · 2.96 KB
/
Taskfile.yml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
version: '3'
tasks:
default:
cmds:
- task --list
shell:
desc: Login
aliases:
- s
cmds:
- docker compose exec redis {{.CLI_ARGS | default "/bin/bash"}}
cli:
desc: Login with CLI
aliases:
- cli
vars:
DATABASE: '{{.d | default "0"}}'
cmds:
- docker compose exec redis redis-cli -n {{.DATABASE}}
get:key:
desc: Get value for key
aliases:
- g:k
vars:
KEY: '{{.k}}'
DATABASE: '{{.d | default "0"}}'
cmds:
- docker compose exec redis redis-cli -n {{.DATABASE}} GET {{.KEY}}
get:keys:
desc: Show all keys
aliases:
- g:ks
cmds:
- docker compose exec redis redis-cli KEYS "*"
get:keys:db:
desc: Show keys for specific database
aliases:
- g:ks:db
vars:
DATABASE: '{{.d | default "0"}}'
cmds:
- docker compose exec redis redis-cli -n {{.DATABASE}} KEYS "*"
get:keys:db:pattern:
desc: Show keys by search
aliases:
- g:ks:db:p
summary: |
Supported glob-style patterns:
- h?llo matches hello, hallo and hxllo
- h*llo matches hllo and heeeello
- h[ae]llo matches hello and hallo, but not hillo
- h[^e]llo matches hallo, hbllo, ... but not hello
- h[a-b]llo matches hallo and hbllo
vars:
DATABASE: '{{.d | default "0"}}'
PATTERN: '{{.p | default "*"}}'
cmds:
- docker compose exec redis redis-cli -n {{.DATABASE}} KEYS "{{.PATTERN}}"
delete:keys:db:pattern:
desc: Delete by specified pattern; task delete:pattern db=4 p=*aniList_image*
aliases:
- d:ks:db:p
vars:
DATABASE: '{{.d | default "0"}}'
PATTERN: '{{.p}}'
cmds:
- docker compose exec redis redis-cli -n {{.DATABASE}} EVAL "for _,k in ipairs(redis.call('keys','{{.PATTERN}}')) do redis.call('del',k) end" 0
flush:
desc: Flush everything, for every database
aliases:
- f
cmds:
- docker compose exec redis redis-cli FLUSHALL ASYNC
flush:db:
desc: Flush specified database
aliases:
- f:db
vars:
DATABASE: '{{.d | default "0"}}'
cmds:
- docker compose exec redis redis-cli -n {{.DATABASE}} FLUSHDB ASYNC
benchmark:
desc: Benchmark redis; with password use `-a password` for CLI args.
aliases:
- b
vars:
TESTS: '{{.n | default "set,get"}}'
RANDOM_KEYS: '{{.r | default "100000"}}'
REQUEST_AMOUNT: '{{.n | default "1000000"}}'
KEY_SIZE: '{{.d | default "50"}}'
cmds:
- docker compose exec redis redis-benchmark -t {{.TESTS}} -r {{.RANDOM_KEYS}} -n {{.REQUEST_AMOUNT}} -d {{.KEY_SIZE}} {{.CLI_ARGS}}
benchmark:latency:
desc: Check latency
aliases:
- b:l
cmds:
- docker compose exec redis redis-cli --latency
benchmark:latency:system:
desc: Check (system) intrinsic latency
aliases:
- b:l:s
vars:
TIME: '{{.t | default "30"}}'
cmds:
- docker compose exec redis redis-cli --intrinsic-latency {{.TIME}}