Skip to content

Instantly share code, notes, and snippets.

@calam1
Created August 16, 2022 15:24
Show Gist options
  • Save calam1/7eece3d877b8631f1b4ad0d44d8fa8cd to your computer and use it in GitHub Desktop.
Save calam1/7eece3d877b8631f1b4ad0d44d8fa8cd to your computer and use it in GitHub Desktop.
# we run with api-key 123abc and we are limited to 5 (which is what the auth svc returned to us via the header)
❯❯❯ hey -c 1 -n 100 -H "x-api-key:123abc" http://localhost:30000/index on branch: main
...
Status code distribution:
[200] 5 responses
[429] 95 responses
# we run the same command again and as expected all 409s
❯❯❯ hey -c 1 -n 100 -H "x-api-key:123abc" http://localhost:30000/index on branch: main
...
Status code distribution:
[429] 100 responses
# we run with api-key 456def and we are limited to 10 (which is what the auth svc returned to us via the header) although abc123 used all their requests, def456 still had requests available
❯❯❯ hey -c 1 -n 100 -H "x-api-key:456def" http://localhost:30000/index on branch: main
...
Status code distribution:
[200] 10 responses
[429] 90 responses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment