Browse Source

fix helper/bench

pull/262/head
KuiLiao 4 years ago
parent
commit
e871c8a581
  1. 1
      helper/bench/Makefile
  2. 4
      helper/bench/prepare.sh
  3. 2
      helper/bench/svr/http.go

1
helper/bench/Makefile

@ -1,6 +1,7 @@
# All targets. # All targets.
default: bench default: bench
# configure these paths according to you system
bench: /usr/local/bin/go /etc/redis/redis.conf /usr/local/bin/docker-compose main.go bench: /usr/local/bin/go /etc/redis/redis.conf /usr/local/bin/docker-compose main.go
rm -f ../conf.sample.yml rm -f ../conf.sample.yml
go build -o bench go build -o bench

4
helper/bench/prepare.sh

@ -6,5 +6,5 @@ git clone https://github.com/dtm-labs/dtm.git && cd dtm && git checkout alpha &&
echo 'all prepared. you shoud run following commands to test in different terminal' echo 'all prepared. you shoud run following commands to test in different terminal'
echo echo
echo 'cd dtm && go run bench/main.go redis|boltdb|db' echo 'cd dtf && go run helper/bench/main.go redis|boltdb|db'
echo 'cd dtm && bench/run-redis|boltdb|mysql.sh' echo 'cd dtf/helper && bench/run-redis|boltdb|mysql.sh'

2
helper/bench/svr/http.go

@ -96,7 +96,7 @@ func PrepareBenchDB() {
func StartSvr() { func StartSvr() {
app := dtmutil.GetGinApp() app := dtmutil.GetGinApp()
benchAddRoute(app) benchAddRoute(app)
logger.Debugf("bench listening at %d", benchPort) logger.Infof("bench listening at %s", benchPort)
go func() { go func() {
_ = app.Run(fmt.Sprintf(":%s", benchPort)) _ = app.Run(fmt.Sprintf(":%s", benchPort))
}() }()

Loading…
Cancel
Save