Skip to content

Commit def9e02

Browse files
committed
edit readme and amend command descriptions
1 parent 4b1d87a commit def9e02

File tree

5 files changed

+31
-46
lines changed

5 files changed

+31
-46
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
## Communication
44

55
- Issues: [GitHub](https://github.com/authzed/thumper/issues)
6-
- Email: [Google Groups](https://groups.google.com/g/authzed-oss)
7-
- Discord: [Zanzibar Discord](https://discord.gg/jTysUaxXzM)
6+
- Discord: [Discord](https://discord.gg/jTysUaxXzM)
87

98
All communication must follow our [Code of Conduct].
109

README.md

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,43 @@
11
# Thumper
22

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.
54

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.
76

8-
Install thumper
7+
## Usage
98

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:
2610

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+
```
3617

37-
## Configuring
18+
1. Write your script in a YAML file (see [script format](#script-format) down below.)
3819

39-
### Changing the QPS
20+
1. If your script contains schema or relationship writes, run the migration step to set that data up first:
4021

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+
```
4225

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:
4427

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
4831
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+
```
5035

5136
### Script Format
5237

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).
5541

5642
#### Example
5743

cmd/thumper/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ func main() {
2323

2424
rootCmd := &cobra.Command{
2525
Use: "thumper",
26-
Short: "The Authzed Load Generator",
27-
Long: "An artificial load generator for managing health and performance of Authzed.",
26+
Short: "SpiceDB Traffic Generator",
27+
Long: "An artificial traffic generator and availability probe.",
2828
PersistentPreRunE: cmd.SyncFlagsCmdFunc,
2929
PreRunE: cmd.DefaultPreRunE("thumper"),
3030
SilenceUsage: true,

internal/cmd/migrate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818

1919
var MigrateCmd = &cobra.Command{
2020
Use: "migrate migration.yaml [migration2.yaml] [migration3.yaml]",
21-
Short: "run thumper migration scripts",
21+
Short: "run setup scripts",
2222
Example: `
2323
Run with a single script against a local SpiceDB:
2424
thumper migrate ./scripts/schema.yaml --token "testtesttesttest"

internal/cmd/run.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var (
3333
)
3434

3535
func RegisterRunFlags(cmd *cobra.Command) {
36-
cmd.Flags().Int("qps", 1, "QPS with which to call authzed")
36+
cmd.Flags().Int("qps", 1, "queries per second to generate")
3737
cmd.Flags().Duration("step-timeout", 500*time.Millisecond, "maximum time a single step is allowed to run")
3838
cmd.Flags().Bool("randomize-starting-step", false, "randomize the starting script step for each worker")
3939

@@ -43,7 +43,7 @@ func RegisterRunFlags(cmd *cobra.Command) {
4343

4444
var RunCmd = &cobra.Command{
4545
Use: "run script.yaml [script2.yaml] [script3.yaml]",
46-
Short: "run thumper load generator",
46+
Short: "run traffic generator",
4747
Example: `
4848
Run with a single script against a local SpiceDB:
4949
thumper run ./scripts/script.yaml --token "testtesttesttest"

0 commit comments

Comments
 (0)