mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Merge branch 'v2.3.0release' of github.com:OpenIMSDK/Open-IM-Server into v2.3.0release
This commit is contained in:
commit
266a2b4c76
@ -148,7 +148,11 @@ func syncPeerUserConversation(conversation *pbConversation.Conversation, operati
|
|||||||
}
|
}
|
||||||
err = rocksCache.DelConversationFromCache(conversation.UserID, utils.GetConversationIDBySessionType(conversation.OwnerUserID, constant.SingleChatType))
|
err = rocksCache.DelConversationFromCache(conversation.UserID, utils.GetConversationIDBySessionType(conversation.OwnerUserID, constant.SingleChatType))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(operationID, utils.GetSelfFuncName(), "DelConversationFromCache failed", err.Error())
|
log.NewError(operationID, utils.GetSelfFuncName(), "DelConversationFromCache failed", err.Error(), conversation.OwnerUserID, conversation.ConversationID)
|
||||||
|
}
|
||||||
|
err = rocksCache.DelConversationFromCache(conversation.OwnerUserID, conversation.ConversationID)
|
||||||
|
if err != nil {
|
||||||
|
log.NewError(operationID, utils.GetSelfFuncName(), "DelConversationFromCache failed", err.Error(), conversation.OwnerUserID, conversation.ConversationID)
|
||||||
}
|
}
|
||||||
chat.ConversationSetPrivateNotification(operationID, conversation.OwnerUserID, conversation.UserID, conversation.IsPrivateChat)
|
chat.ConversationSetPrivateNotification(operationID, conversation.OwnerUserID, conversation.UserID, conversation.IsPrivateChat)
|
||||||
return nil
|
return nil
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
package prometheus
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
|
||||||
"github.com/prometheus/client_golang/prometheus/promauto"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
// user rpc
|
|
||||||
UserLoginCounter prometheus.Counter
|
|
||||||
UserRegisterCounter prometheus.Counter
|
|
||||||
)
|
|
||||||
|
|
||||||
func NewUserLoginCounter() {
|
|
||||||
UserLoginCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
||||||
Name: "user_login",
|
|
||||||
Help: "The number of user login",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewUserRegisterCounter() {
|
|
||||||
UserRegisterCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
||||||
Name: "user_register",
|
|
||||||
Help: "The number of user register",
|
|
||||||
})
|
|
||||||
}
|
|
50
pkg/common/prometheus/gather.go
Normal file
50
pkg/common/prometheus/gather.go
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
package prometheus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
// user rpc
|
||||||
|
UserLoginCounter prometheus.Counter
|
||||||
|
UserRegisterCounter prometheus.Counter
|
||||||
|
|
||||||
|
SeqGetSuccessCounter prometheus.Counter
|
||||||
|
SeqGetFailedCounter prometheus.Counter
|
||||||
|
SeqSetSuccessCounter prometheus.Counter
|
||||||
|
SeqSetFailedCounter prometheus.Counter
|
||||||
|
)
|
||||||
|
|
||||||
|
func NewUserLoginCounter() {
|
||||||
|
UserLoginCounter = promauto.NewCounter(prometheus.CounterOpts{
|
||||||
|
Name: "user_login",
|
||||||
|
Help: "The number of user login",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewSeqGetSuccessCounter() {
|
||||||
|
SeqGetSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
||||||
|
Name: "seq_get_success",
|
||||||
|
Help: "The number of successful get seq",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
func NewSeqGetFailedCounter() {
|
||||||
|
SeqGetFailedCounter = promauto.NewCounter(prometheus.CounterOpts{
|
||||||
|
Name: "seq_get_failed",
|
||||||
|
Help: "The number of failed get seq",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewSeqSetSuccessCounter() {
|
||||||
|
SeqSetSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
||||||
|
Name: "seq_set_success",
|
||||||
|
Help: "The number of successful set seq",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
func NewSeqSetFailedCounter() {
|
||||||
|
SeqSetFailedCounter = promauto.NewCounter(prometheus.CounterOpts{
|
||||||
|
Name: "seq_set_failed",
|
||||||
|
Help: "The number of failed set seq",
|
||||||
|
})
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user