convert stress test into benchmark tests

This commit is contained in:
aler9 2021-01-06 23:24:05 +01:00
parent 0cf0cd9045
commit 6d98532f19
7 changed files with 17 additions and 9 deletions

View File

@ -13,7 +13,7 @@ help:
@echo " format format source files"
@echo " test run tests"
@echo " lint run linters"
@echo " stress NAME=n run stress environment"
@echo " bench NAME=n run bench environment"
@echo " run run app"
@echo " release build release assets"
@echo " dockerhub build and push docker hub images"
@ -60,8 +60,8 @@ lint:
$(GO_LINT_IMAGE) \
golangci-lint run -v
stress:
docker build -q . -f stress/$(NAME)/Dockerfile -t temp
bench:
docker build -q . -f bench/$(NAME)/Dockerfile -t temp
docker run --rm -it -p 9999:9999 temp
define DOCKERFILE_RUN

View File

@ -13,7 +13,7 @@ RUN go mod download
COPY . ./
RUN go build -o /rtsp-simple-server .
COPY stress/read/start.sh /
COPY bench/proxy/start.sh /
RUN chmod +x /start.sh
ENTRYPOINT [ "/start.sh" ]

View File

@ -34,4 +34,8 @@ for i in $(seq 1 $PROXY_COUNT); do
done
echo -e "$CONF" > /proxy.conf
/rtsp-simple-server /proxy.conf
/rtsp-simple-server /proxy.conf &
sleep 5
go tool pprof -text http://localhost:9999/debug/pprof/profile?seconds=15

View File

@ -13,7 +13,7 @@ RUN go mod download
COPY . ./
RUN go build -o /rtsp-simple-server .
COPY stress/publish/start.sh /
COPY bench/publish/start.sh /
RUN chmod +x /start.sh
ENTRYPOINT [ "/start.sh" ]

View File

@ -20,4 +20,6 @@ for i in $(seq 1 $PUBLISHER_COUNT); do
-rtsp_transport $PUBLISHER_PROTOCOL rtsp://localhost:8554/source$i &
done
wait
sleep 5
go tool pprof -text http://localhost:9999/debug/pprof/profile?seconds=15

View File

@ -13,7 +13,7 @@ RUN go mod download
COPY . ./
RUN go build -o /rtsp-simple-server .
COPY stress/proxy/start.sh /
COPY bench/read/start.sh /
RUN chmod +x /start.sh
ENTRYPOINT [ "/start.sh" ]

View File

@ -27,4 +27,6 @@ for i in $(seq 1 $READER_COUNT); do
-i rtsp://localhost:8554/source -c copy -f mpegts -y /dev/null &
done
wait
sleep 5
go tool pprof -text http://localhost:9999/debug/pprof/profile?seconds=15