From f66d099c68149e103891f224ea63162e9928fb95 Mon Sep 17 00:00:00 2001 From: yedf2 <120050102@qq.com> Date: Sat, 25 Dec 2021 17:57:08 +0800 Subject: [PATCH] before opt redis --- bench/run-dtm.sh | 2 +- bench/setup.sh | 2 +- dtmsvr/storage/redis/redis.go | 2 +- test/main_test.go | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bench/run-dtm.sh b/bench/run-dtm.sh index 0566f25..0c6376b 100755 --- a/bench/run-dtm.sh +++ b/bench/run-dtm.sh @@ -18,4 +18,4 @@ curl "http://127.0.0.1:8083/api/busi_bench/reloadData?m=raw_empty" && ab -t $TIM # curl "http://127.0.0.1:8083/api/busi_bench/reloadData?m=dtm_tx" && curl "http://127.0.0.1:8083/api/busi_bench/bench" # curl "http://127.0.0.1:8083/api/busi_bench/reloadData?m=dtm_barrier" && curl "http://127.0.0.1:8083/api/busi_bench/bench" -ab -t $TIME -c $CONCURRENT "http://127.0.0.1:8083/api/busi_bench/benchEmptyUrl" \ No newline at end of file +ab -t 10 -c 30 "http://127.0.0.1:8083/api/busi_bench/benchEmptyUrl" diff --git a/bench/setup.sh b/bench/setup.sh index fe47bd0..b10125e 100755 --- a/bench/setup.sh +++ b/bench/setup.sh @@ -12,4 +12,4 @@ chmod +x /usr/local/bin/docker-compose # install go wget https://golang.org/dl/go1.17.1.linux-amd64.tar.gz -rm -rf /usr/local/go && tar -C /usr/local -xzf go1.17.1.linux-amd64.tar.gz && cp -f /usr/local/bin/go /usr/local/go/bin/go +rm -rf /usr/local/go && tar -C /usr/local -xzf go1.17.1.linux-amd64.tar.gz && cp -f /usr/local/go/bin/go /usr/local/bin/go diff --git a/dtmsvr/storage/redis/redis.go b/dtmsvr/storage/redis/redis.go index 8dca435..919963f 100644 --- a/dtmsvr/storage/redis/redis.go +++ b/dtmsvr/storage/redis/redis.go @@ -167,7 +167,7 @@ func (s *RedisStore) LockGlobalSaveBranches(gid string, status string, branches AppendObject(&storage.TransGlobalStore{Gid: gid, Status: status}). AppendRaw(branchStart). AppendBranches(branches) - _, err := callLua(args, ` + _, err := callLua(args, `-- LockGlobalSaveBranches local gs = cjson.decode(ARGV[3]) local g = redis.call('GET', KEYS[1]) if (g == false) then diff --git a/test/main_test.go b/test/main_test.go index 5aa62d5..95c5836 100644 --- a/test/main_test.go +++ b/test/main_test.go @@ -13,6 +13,7 @@ import ( "github.com/dtm-labs/dtm/common" "github.com/dtm-labs/dtm/dtmcli" + "github.com/dtm-labs/dtm/dtmcli/logger" "github.com/dtm-labs/dtm/dtmsvr" "github.com/dtm-labs/dtm/examples" "github.com/gin-gonic/gin" @@ -26,6 +27,7 @@ func exitIf(code int) { func TestMain(m *testing.M) { common.MustLoadConfig() + logger.InitLog(config.LogLevel) dtmcli.SetCurrentDBType(common.Config.ExamplesDB.Driver) dtmsvr.TransProcessedTestChan = make(chan string, 1) dtmsvr.NowForwardDuration = 0 * time.Second