Web delay simulation powered by go.
1.6K
Web delay simulation powered by go.
docker run -itd --name web-delay -p 8080:80 zhangsean/web-delay
docker logs -f web-delay
Simulate web request cost
http://localhost:8080/ to simulate a delay of random time from 0 to 1000 ms in every request.http://localhost:8080/?max=100 to simulate a delay of random time from 0 to 100 ms in every request.http://localhost:8080/?ms=10 to simulate a delay of 10 ms in every request.http://localhost:8080/?ms=10&text=word to simulate a delay of 10 ms and respond with the specific text word in every request.View request list
http://localhost:8080/requests to view all request list in processing.http://localhost:8080/requests?status=1 to view all done request list.http://localhost:8080/requests?status=2 to view all request list.cd ~/go/src
git clone https://github.com/zhangsean/web-delay.git
cd web-delay
go build
# Please make sure local port 80 is free.
./web-delay
# Show help
./web-delay -help
# Usage
Usage of ./web-delay:
-d Show debug log.
-p int
Local port to listen (default 80)
-v Show version.
Visit http://localhost/?ms=100 to simulate a delay of 100 ms in every request.
docker build -t image:tag .
docker run -itd --name web-delay -p 888:80 image:tag
Visit http://localhost:888/?ms=1000 to simulate a delay of 1000 ms in every request.
Content type
Image
Digest
Size
1.9 MB
Last updated
over 5 years ago
docker pull zhangsean/web-delay