Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增 媒体服务器缺失提醒 #2522

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions internal/selfdiagnosis/diagnoses.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
func NetworkDiagnosis(c *client.QQClient) {
log.Infof("开始诊断网络情况")
qualityInfo := c.ConnectionQualityTest()
log.Debugf("聊天服务器连接延迟: %vms", qualityInfo.ChatServerLatency)
log.Debugf("聊天服务器丢包率: %v%%", qualityInfo.ChatServerPacketLoss*10)
log.Debugf("长消息服务器连接延迟: %vms", qualityInfo.LongMessageServerLatency)
log.Debugf("长消息服务器响应延迟: %vms", qualityInfo.LongMessageServerResponseLatency)
log.Debugf("媒体服务器连接延迟: %vms", qualityInfo.SrvServerLatency)
log.Debugf("媒体服务器丢包率: %v%%", qualityInfo.SrvServerPacketLoss*10)
log.Infof("聊天服务器连接延迟: %vms", qualityInfo.ChatServerLatency)
log.Infof("聊天服务器丢包率: %v%%", qualityInfo.ChatServerPacketLoss*10)
log.Infof("长消息服务器连接延迟: %vms", qualityInfo.LongMessageServerLatency)
log.Infof("长消息服务器响应延迟: %vms", qualityInfo.LongMessageServerResponseLatency)
log.Infof("媒体服务器连接延迟: %vms", qualityInfo.SrvServerLatency)
log.Infof("媒体服务器丢包率: %v%%", qualityInfo.SrvServerPacketLoss*10)

const (
chatServerErrorMessage = "可能出现消息丢失/延迟或频繁掉线等情况, 请检查本地网络状态."
Expand Down Expand Up @@ -61,6 +61,8 @@ func NetworkDiagnosis(c *client.QQClient) {

if qualityInfo.SrvServerPacketLoss > 0 {
log.Warnf("警告: 本地连接媒体服务器丢包率为 %v%%, %v", qualityInfo.SrvServerPacketLoss*10, mediaServerErrorMessage)
} else if qualityInfo.SrvServerPacketLoss == -1 {
log.Warnf("警告: 没有找到可用的媒体服务器,%v", mediaServerErrorMessage)
}

if qualityInfo.ChatServerLatency > 1000 || qualityInfo.ChatServerPacketLoss > 0 || qualityInfo.LongMessageServerLatency > 1000 || qualityInfo.SrvServerLatency > 1000 || qualityInfo.SrvServerPacketLoss > 0 {
Expand Down