No description
This repository has been archived on 2026-09-29. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Go 97.9%
  • Dockerfile 2.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2017-04-21 01:55:56 -06:00
.gitignore init 2017-04-03 00:19:17 -06:00
Dockerfile init 2017-04-03 00:19:17 -06:00
main.go use a cheaper bcrypt run for more requests/s 2017-04-12 02:15:40 -06:00
README.md update readme 2017-04-21 01:55:56 -06:00

Running locally

go run main.go

API?

This thing does just one thing.

Anything sent in the url is considered a "password" and is hashed with bcrypt. This is set to put some load on the box. Responses should take at least ~1s to generate.

Examples:

$ curl http://localhost:8080/hello
{"plain":"hello","hashed":"$2a$15$5mQzwyE40EQaHfBFKH5Ns.M.YDSdlYarXNZzKdW800mTnGzEn5iE."}

$ curl http://localhost:8080/
{"plain":"","hashed":"$2a$15$QuVNFv32QakKmeaYvxcRJ.hud4JE5DTGlUf.3XELEFooh63UBDXhG"}

$ curl http://localhost:8080/hello/i/am/a/password
{"plain":"hello/i/am/a/password","hashed":"$2a$15$8FEa7wkcEthIv1DdGjM8durXa2b9SrHMNy1FufCRWDZ1dHT5b3p5m"}

How to put load on it?

brew install vegeta

echo "GET http://localhost:8001/api/v1/proxy/namespaces/load-demo/services/load-demo-api/" | vegeta attack -duration=300s | tee results.bin | vegeta report

echo "GET http://localhost:8001/api/v1/proxy/namespaces/load-demo/services/load-demo-api/$(echo $RANDOM)" | vegeta attack -duration=600s -rate=5 | tee results.bin | vegeta report

How to ship a new release?

Publish code to github on master and docker hub's automated build service will publish a docker image @ jhgaylor/k8s-load-demo-api. The deployment pulls it from docker's public repository.

How to crank everything up?