上传代码优化
This commit is contained in:
parent
82f1f44917
commit
022c51d459
@ -1,26 +1,36 @@
|
||||
机器人总数: 1000
|
||||
成功数量: 1000
|
||||
失败数量: 0
|
||||
消息总吞吐量: 24187
|
||||
消息总吞吐量: 114094
|
||||
---消息压测详情----------------------------------------------------------------------------------------------------
|
||||
消息名:gm.cmd 请求次数:13706 耗时最小:0 ms 耗时最大:57866ms 平均耗时:160.28ms 中位耗时:18.00ms
|
||||
消息名:equipment.upgrade 请求次数:142 耗时最小:15 ms 耗时最大:16214ms 平均耗时:455.92ms 中位耗时:20.00ms
|
||||
消息名:wtask.accept 请求次数:1022 耗时最小:14 ms 耗时最大:47111ms 平均耗时:77.09ms 中位耗时:18.00ms
|
||||
消息名:hero.list 请求次数:979 耗时最小:14 ms 耗时最大:56824ms 平均耗时:441.82ms 中位耗时:19.00ms
|
||||
消息名:equipment.getlist 请求次数:979 耗时最小:12 ms 耗时最大:57799ms 平均耗时:294.41ms 中位耗时:18.00ms
|
||||
消息名:items.getlist 请求次数:979 耗时最小:13 ms 耗时最大:59418ms 平均耗时:290.49ms 中位耗时:18.00ms
|
||||
消息名:wtask.info 请求次数:979 耗时最小:14 ms 耗时最大:13520ms 平均耗时:125.14ms 中位耗时:19.00ms
|
||||
消息名:pagoda.getlist 请求次数:143 耗时最小:14 ms 耗时最大:56245ms 平均耗时:3448.13ms 中位耗时:20.00ms
|
||||
消息名:arena.matche 请求次数:1 耗时最小:18 ms 耗时最大:18 ms 平均耗时:18.00ms 中位耗时:18.00ms
|
||||
消息名:user.create 请求次数:1000 耗时最小:14 ms 耗时最大:13918ms 平均耗时:117.23ms 中位耗时:23.00ms
|
||||
消息名:shop.getlist 请求次数:143 耗时最小:14 ms 耗时最大:56492ms 平均耗时:4076.59ms 中位耗时:26.00ms
|
||||
消息名:hero.drawcard 请求次数:142 耗时最小:52 ms 耗时最大:60895ms 平均耗时:3408.51ms 中位耗时:572.00ms
|
||||
消息名:wtask.completecondi 请求次数:284 耗时最小:14 ms 耗时最大:3142 ms 平均耗时:31.56ms 中位耗时:19.00ms
|
||||
消息名:wtask.finish 请求次数:711 耗时最小:15 ms 耗时最大:1667 ms 平均耗时:39.04ms 中位耗时:20.00ms
|
||||
消息名:wtask.battlestart 请求次数:284 耗时最小:14 ms 耗时最大:1678 ms 平均耗时:112.29ms 中位耗时:19.00ms
|
||||
消息名:wtask.battlefinish 请求次数:284 耗时最小:22 ms 耗时最大:3460 ms 平均耗时:127.08ms 中位耗时:43.00ms
|
||||
消息名:user.login 请求次数:1000 耗时最小:18 ms 耗时最大:1645 ms 平均耗时:520.85ms 中位耗时:516.50ms
|
||||
消息名:hero.talentlist 请求次数:979 耗时最小:13 ms 耗时最大:56305ms 平均耗时:391.68ms 中位耗时:18.00ms
|
||||
消息名:arena.info 请求次数:146 耗时最小:13 ms 耗时最大:25784ms 平均耗时:695.86ms 中位耗时:19.00ms
|
||||
消息名:horoscope.info 请求次数:142 耗时最小:13 ms 耗时最大:59744ms 平均耗时:2767.27ms 中位耗时:19.00ms
|
||||
消息名:sys.funcgetlist 请求次数:142 耗时最小:14 ms 耗时最大:59843ms 平均耗时:3031.15ms 中位耗时:74.00ms
|
||||
消息名:arena.matche 请求次数:6387 耗时最小:18 ms 耗时最大:28927ms 平均耗时:346.08ms 中位耗时:60.00ms
|
||||
消息名:chat.send 请求次数:6358 耗时最小:12 ms 耗时最大:15020ms 平均耗时:34.16ms 中位耗时:18.00ms
|
||||
消息名:hero.talentlist 请求次数:965 耗时最小:13 ms 耗时最大:1843 ms 平均耗时:28.65ms 中位耗时:18.00ms
|
||||
消息名:wtask.info 请求次数:924 耗时最小:13 ms 耗时最大:1525 ms 平均耗时:32.66ms 中位耗时:18.00ms
|
||||
消息名:pagoda.challenge 请求次数:6275 耗时最小:14 ms 耗时最大:6789 ms 平均耗时:78.82ms 中位耗时:20.00ms
|
||||
消息名:gm.cmd 请求次数:12962 耗时最小:0 ms 耗时最大:6316 ms 平均耗时:33.59ms 中位耗时:19.00ms
|
||||
消息名:pagoda.getlist 请求次数:848 耗时最小:13 ms 耗时最大:14915ms 平均耗时:67.48ms 中位耗时:18.00ms
|
||||
消息名:horoscope.info 请求次数:842 耗时最小:13 ms 耗时最大:1263 ms 平均耗时:36.86ms 中位耗时:18.00ms
|
||||
消息名:sys.funcgetlist 请求次数:837 耗时最小:14 ms 耗时最大:8357 ms 平均耗时:82.51ms 中位耗时:19.00ms
|
||||
消息名:hero.drawcard 请求次数:6572 耗时最小:46 ms 耗时最大:29092ms 平均耗时:340.88ms 中位耗时:87.00ms
|
||||
消息名:user.login 请求次数:1000 耗时最小:22 ms 耗时最大:1837 ms 平均耗时:628.79ms 中位耗时:758.00ms
|
||||
消息名:wtask.accept 请求次数:3834 耗时最小:13 ms 耗时最大:7624 ms 平均耗时:36.42ms 中位耗时:18.00ms
|
||||
消息名:wtask.completecondi 请求次数:1133 耗时最小:14 ms 耗时最大:1685 ms 平均耗时:22.14ms 中位耗时:19.00ms
|
||||
消息名:wtask.finish 请求次数:2853 耗时最小:14 ms 耗时最大:10731ms 平均耗时:68.10ms 中位耗时:20.00ms
|
||||
消息名:equipment.getlist 请求次数:953 耗时最小:15 ms 耗时最大:7648 ms 平均耗时:329.07ms 中位耗时:55.00ms
|
||||
消息名:equipment.upgrade 请求次数:6459 耗时最小:14 ms 耗时最大:14672ms 平均耗时:64.88ms 中位耗时:20.00ms
|
||||
消息名:pagoda.challengeover 请求次数:6223 耗时最小:19 ms 耗时最大:7583 ms 平均耗时:81.33ms 中位耗时:39.00ms
|
||||
消息名:hero.list 请求次数:965 耗时最小:14 ms 耗时最大:3146 ms 平均耗时:91.92ms 中位耗时:20.00ms
|
||||
消息名:viking.challengeover 请求次数:6247 耗时最小:22 ms 耗时最大:7504 ms 平均耗时:103.11ms 中位耗时:45.00ms
|
||||
消息名:shop.buy 请求次数:6275 耗时最小:15 ms 耗时最大:14552ms 平均耗时:48.52ms 中位耗时:21.00ms
|
||||
消息名:user.create 请求次数:20 耗时最小:14 ms 耗时最大:151 ms 平均耗时:24.35ms 中位耗时:16.50ms
|
||||
消息名:viking.challenge 请求次数:6353 耗时最小:16 ms 耗时最大:5623 ms 平均耗时:54.49ms 中位耗时:22.00ms
|
||||
消息名:shop.getlist 请求次数:855 耗时最小:14 ms 耗时最大:1754 ms 平均耗时:43.19ms 中位耗时:18.00ms
|
||||
消息名:arena.challenge 请求次数:6223 耗时最小:15 ms 耗时最大:14836ms 平均耗时:135.79ms 中位耗时:23.00ms
|
||||
消息名:arena.challengereward 请求次数:5012 耗时最小:17 ms 耗时最大:22145ms 平均耗时:49.73ms 中位耗时:23.00ms
|
||||
消息名:viking.getlist 请求次数:6358 耗时最小:12 ms 耗时最大:3768 ms 平均耗时:38.24ms 中位耗时:18.00ms
|
||||
消息名:horoscope.upgrade 请求次数:6274 耗时最小:20 ms 耗时最大:15119ms 平均耗时:249.29ms 中位耗时:64.00ms
|
||||
消息名:items.getlist 请求次数:947 耗时最小:13 ms 耗时最大:5619 ms 平均耗时:51.52ms 中位耗时:19.00ms
|
||||
消息名:wtask.battlestart 请求次数:1137 耗时最小:14 ms 耗时最大:3647 ms 平均耗时:64.47ms 中位耗时:19.00ms
|
||||
消息名:wtask.battlefinish 请求次数:1136 耗时最小:19 ms 耗时最大:2141 ms 平均耗时:87.56ms 中位耗时:40.00ms
|
||||
消息名:arena.info 请求次数:867 耗时最小:14 ms 耗时最大:4277 ms 平均耗时:98.77ms 中位耗时:19.00ms
|
||||
|
@ -186,6 +186,7 @@ func (this *Robot) SendMessage(mtype, stype string, msg proto.Message) (resp pro
|
||||
message: fmt.Sprintf("%s.%s", mtype, stype),
|
||||
time: time.Since(stime).Milliseconds(),
|
||||
})
|
||||
time.Sleep(time.Millisecond * time.Duration(50+rand.Int31n(300)))
|
||||
} else {
|
||||
if err = this.WriteMsg(message); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
@ -245,6 +246,7 @@ func (this *Robot) SendTaskMessage(task, comdi int32, mtype, stype string, msg p
|
||||
message: fmt.Sprintf("%s.%s", mtype, stype),
|
||||
time: time.Since(stime).Milliseconds(),
|
||||
})
|
||||
time.Sleep(time.Millisecond * time.Duration(50+rand.Int31n(300)))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (err
|
||||
}
|
||||
|
||||
this.module.ModuleHero.CheckPeachReward(session, user.Ctime)
|
||||
this.module.RecoverUserPsStart(user.Uid)
|
||||
// this.module.RecoverUserPsStart(user.Uid)
|
||||
// 日常登录任务
|
||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype7, 1))
|
||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype230, 1, int32(configure.Now().Weekday())))
|
||||
|
@ -175,7 +175,7 @@ func (this *User) ResetSession() {
|
||||
|
||||
// 清除session
|
||||
func (this *User) CleanSession(uid, sessionid string) {
|
||||
this.stopTicker(uid)
|
||||
// this.stopTicker(uid)
|
||||
if !this.IsCross() {
|
||||
this.modelUser.updateOfflineTime(uid)
|
||||
}
|
||||
@ -966,7 +966,9 @@ func (this *User) stopTicker(uid string) {
|
||||
if t, ok := this.timerMap[uid]; ok {
|
||||
if t != nil {
|
||||
t.Stop()
|
||||
this.timerLock.Lock()
|
||||
delete(this.timerMap, uid)
|
||||
this.timerLock.Unlock()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user