|
1 | 1 | # Thumper
|
2 | 2 |
|
3 |
| -Thumper is a traffic generator for SpiceDB and Authzed. |
4 |
| -It will issue CheckPermission, Read/Write Relationships, ExpandPermissionTree and LookupResources to a SpiceDB or Authzed endpoint, and exposes Prometheus metrics about those operations. |
| 3 | +Thumper can be used as an artificial traffic generator or/and as an availability probe for [SpiceDB](https://github.com/authzed/spicedb) instances. |
5 | 4 |
|
6 |
| -## Setting up |
| 5 | +It can issue CheckPermission and CheckBulkPermission requests, Read/Write Relationships, ExpandPermissionTree and LookupResources. It also can expose Prometheus metrics about those operations. |
7 | 6 |
|
8 |
| -Install thumper |
| 7 | +## Usage |
9 | 8 |
|
10 |
| -```sh |
11 |
| -git clone https://github.com/authzed/thumper.git |
12 |
| -cd thumper |
13 |
| -go build -o thumper ./cmd/thumper |
14 |
| -sudo mv thumper /usr/local/bin/ # Optional if you want to move thumper into $PATH |
15 |
| -``` |
16 |
| - |
17 |
| -Run the migration script required by your thumper scripts against your permission system. |
18 |
| - |
19 |
| -```sh |
20 |
| -thumper migrate --endpoint grpc.authzed.com:443 --token t_some_token ./scripts/schema.yaml |
21 |
| -``` |
22 |
| - |
23 |
| -## Running |
24 |
| - |
25 |
| -### Running against an Authzed instance |
| 9 | +1. Install thumper: |
26 | 10 |
|
27 |
| -```sh |
28 |
| -thumper run --endpoint grpc.authzed.com:443 --token t_some_token ./scripts/example.yaml |
29 |
| -``` |
30 |
| - |
31 |
| -### Running against a local SpiceDB |
32 |
| - |
33 |
| -```sh |
34 |
| -thumper run --token presharedkeyhere --insecure ./scripts/example.yaml |
35 |
| -``` |
| 11 | + ```sh |
| 12 | + git clone https://github.com/authzed/thumper.git |
| 13 | + cd thumper |
| 14 | + go build -o thumper ./cmd/thumper |
| 15 | + sudo mv thumper /usr/local/bin/ # Optional if you want to move thumper into $PATH |
| 16 | + ``` |
36 | 17 |
|
37 |
| -## Configuring |
| 18 | +1. Write your script in a YAML file (see [script format](#script-format) down below.) |
38 | 19 |
|
39 |
| -### Changing the QPS |
| 20 | +1. If your script contains schema or relationship writes, run the migration step to set that data up first: |
40 | 21 |
|
41 |
| -By default, Thumper will run a single goroutine, which will issues calls once per second, at rates configured in [thumperrunner/definitions.go](internal/thumperrunner/definitions.go). |
| 22 | + ```sh |
| 23 | + thumper migrate --endpoint grpc.authzed.com:443 --token t_some_token ./scripts/schema.yaml |
| 24 | + ``` |
42 | 25 |
|
43 |
| -To increase the number of calls issued, the `THUMPER_QPS` environment variable or `--qps` flag can be used: |
| 26 | +1. Run your script as in the following examples: |
44 | 27 |
|
45 |
| -```sh |
46 |
| -thumper run --token presharedkeyhere --qps 5 |
47 |
| -``` |
| 28 | + ```sh |
| 29 | + # 5 requests per second against Authzed's hosted SpiceDB with a secure connection: |
| 30 | + thumper run --qps 5 --endpoint grpc.authzed.com:443 --token t_some_token ./scripts/example.yaml |
48 | 31 |
|
49 |
| -The above will spawn 5 goroutines, which will each issue calls once per second. |
| 32 | + # 1 request per second against local SpiceDB with an insecure connection: |
| 33 | + thumper run --token presharedkeyhere --insecure ./scripts/example.yaml |
| 34 | + ``` |
50 | 35 |
|
51 | 36 | ### Script Format
|
52 | 37 |
|
53 |
| -Thumper config files are yaml files with go template preprocessing supported. |
54 |
| -The final yaml generated by the templates must validate with the schema in `schema.yaml`. |
| 38 | +Thumper config files are YAML files. These files support Go template preprocessing supported. |
| 39 | + |
| 40 | +The final YAML generated by the templates must validate with the schema in [schema.yaml](schema.yaml). |
55 | 41 |
|
56 | 42 | #### Example
|
57 | 43 |
|
|
0 commit comments