Skip to content

Commit

Permalink
fix: listener add empty implement avoid panic.
Browse files Browse the repository at this point in the history
Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
  • Loading branch information
FGadvancer committed Dec 13, 2023
1 parent e292958 commit a6902c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion msgtest/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"context"
"flag"
"fmt"
"github.com/OpenIMSDK/tools/log"
"github.com/openimsdk/openim-sdk-core/v3/msgtest/module"
"runtime"
Expand All @@ -28,6 +29,7 @@ var (
start int
end int
count int
sendInterval int

//recvMsgUserNum int // 消息接收者数, 抽样账号
isRegisterUser bool // 是否注册用户
Expand All @@ -39,6 +41,7 @@ func InitWithFlag() {
flag.IntVar(&end, "e", 0, "end user")
flag.Float64Var(&samplingRate, "f", 0.1, "sampling rate")
flag.IntVar(&count, "c", 1000, "number of messages per user")
flag.IntVar(&sendInterval, "i", 1000, "send message interval per user(milliseconds)")
flag.IntVar(&NotFriendMsgSenderNum, "n", 100, "not friend msg sender num")
flag.IntVar(&groupMsgSenderNum, "g", 100, "group msg sender num")
flag.IntVar(&msgSenderNumEvreyUser, "m", 100, "msg sender num evrey user")
Expand All @@ -57,6 +60,7 @@ func PrintQPS() {

func main() {
flag.Parse()
fmt.Print("start", totalOnlineUserNum, count, sendInterval)
ctx := context.Background()
p := module.NewPressureTester()
f, r, err := p.SelectSample(totalOnlineUserNum, 0.01)
Expand All @@ -81,7 +85,7 @@ func main() {
p.InitUserConns(f)
log.ZWarn(ctx, "all user init connect to server success,start send message", nil, "count", count)
time.Sleep(10 * time.Second)
p.SendSingleMessages(f, count, time.Millisecond*1)
p.SendSingleMessages(f, count, time.Millisecond*time.Duration(sendInterval))
log.ZWarn(ctx, "send over", nil, "num", p.GetSendNum())
//p.SendSingleMessagesTo(f, 20000, time.Millisecond*1)
//p.SendMessages("fastened_user_prefix_testv3new_0", "fastened_user_prefix_testv3new_1", 100000)
Expand Down

0 comments on commit a6902c5

Please sign in to comment.