This commit is contained in:
wangchuxiao 2022-09-09 17:17:10 +08:00
parent 189d5aed69
commit 692cebe659
2 changed files with 3 additions and 1 deletions

View File

@ -42,6 +42,7 @@ func Init() {
w = new(sync.Mutex) w = new(sync.Mutex)
persistentCH.Init() // ws2mschat save mysql persistentCH.Init() // ws2mschat save mysql
historyCH.Init(cmdCh) // historyCH.Init(cmdCh) //
historyMongoCH.Init()
onlineTopicStatus = OnlineTopicVacancy onlineTopicStatus = OnlineTopicVacancy
//offlineHistoryCH.Init(cmdCh) //offlineHistoryCH.Init(cmdCh)
statistics.NewStatistics(&singleMsgSuccessCount, config.Config.ModuleName.MsgTransferName, fmt.Sprintf("%d second singleMsgCount insert to mongo", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval) statistics.NewStatistics(&singleMsgSuccessCount, config.Config.ModuleName.MsgTransferName, fmt.Sprintf("%d second singleMsgCount insert to mongo", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval)

View File

@ -79,8 +79,9 @@ func (pc *PersistentConsumerHandler) handleChatWs2Mysql(cMsg *sarama.ConsumerMes
return return
} }
msgInsertMysqlProcessed.Inc() msgInsertMysqlProcessed.Inc()
msgInsertMysqlProcessed.Add(1)
if config.Config.Prometheus.Enable { if config.Config.Prometheus.Enable {
log.NewDebug(msgFromMQ.OperationID, utils.GetSelfFuncName(), "inc msgInsertMysqlProcessed") log.NewDebug(msgFromMQ.OperationID, utils.GetSelfFuncName(), "inc msgInsertMysqlProcessed", msgInsertMysqlProcessed.Desc())
msgInsertMysqlProcessed.Inc() msgInsertMysqlProcessed.Inc()
} }
} }