Browse Source

before opt redis

pull/127/head
yedf2 4 years ago
parent
commit
f66d099c68
  1. 2
      bench/run-dtm.sh
  2. 2
      bench/setup.sh
  3. 2
      dtmsvr/storage/redis/redis.go
  4. 2
      test/main_test.go

2
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"
ab -t 10 -c 30 "http://127.0.0.1:8083/api/busi_bench/benchEmptyUrl"

2
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

2
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

2
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

Loading…
Cancel
Save