bench: add publish start bash script

This commit is contained in:
singchia
2024-02-24 22:59:05 +08:00
parent 1e67cef131
commit 717e398111
4 changed files with 25 additions and 2 deletions

View File

@@ -8,4 +8,7 @@ publish:
.PHONY: clean
clean:
make clean -C publish
make clean -C publish
bench:
make bench -C publish

View File

@@ -14,4 +14,7 @@ publish_edge: edge/*.go
publish_service: service/*.go
CGO_ENABLED=0 GOOS=$(GOHOSTOS) GOARCH=$(GOARCH) \
go build -trimpath -ldflags "-s -w" -o publish_service service/*.go
go build -trimpath -ldflags "-s -w" -o publish_service service/*.go
bench: publish_edge publish_service
chmod +x ./publish.sh && ./publish.sh

13
test/bench/publish/publish.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
# start service
sleep 2
nohup ./publish_service >/dev/null 2>&1 &
pid=$!
# start edge
sleep 2
./publish_edge
# kill service
kill -9 $pid