@ -10,11 +10,43 @@ var (
UserLoginCounter prometheus . Counter
UserRegisterCounter prometheus . Counter
//seg
SeqGetSuccessCounter prometheus . Counter
SeqGetFailedCounter prometheus . Counter
SeqSetSuccessCounter prometheus . Counter
SeqSetFailedCounter prometheus . Counter
//msg-db
MsgInsertRedisSuccessCounter prometheus . Counter
MsgInsertRedisFailedCounter prometheus . Counter
MsgInsertMongoSuccessCounter prometheus . Counter
MsgInsertMongoFailedCounter prometheus . Counter
MsgPullFromRedisSuccessCounter prometheus . Counter
MsgPullFromRedisFailedCounter prometheus . Counter
MsgPullFromMongoSuccessCounter prometheus . Counter
MsgPullFromMongoFailedCounter prometheus . Counter
//msg-ws
MsgRecvTotalCounter prometheus . Counter
GetNewestSeqTotalCounter prometheus . Counter
PullMsgBySeqListTotalCounter prometheus . Counter
SingleChatMsgRecvSuccessCounter prometheus . Counter
GroupChatMsgRecvSuccessCounter prometheus . Counter
WorkSuperGroupChatMsgRecvSuccessCounter prometheus . Counter
//msg-msg
SingleChatMsgProcessSuccessCounter prometheus . Counter
SingleChatMsgProcessFailedCounter prometheus . Counter
GroupChatMsgProcessSuccessCounter prometheus . Counter
GroupChatMsgProcessFailedCounter prometheus . Counter
WorkSuperGroupChatMsgProcessSuccessCounter prometheus . Counter
WorkSuperGroupChatMsgProcessFailedCounter prometheus . Counter
//msg-push
MsgOnlinePushSuccessCounter prometheus . Counter
MsgOfflinePushSuccessCounter prometheus . Counter
MsgOfflinePushFailedCounter prometheus . Counter
// api
ApiRequestCounter prometheus . Counter
ApiRequestSuccessCounter prometheus . Counter
@ -25,21 +57,22 @@ var (
GrpcRequestSuccessCounter prometheus . Counter
GrpcRequestFailedCounter prometheus . Counter
SendMsgCounter prometheus . Counter
MsgInsertRedisSuccessCounter prometheus . Counter
MsgInsertRedisFailedCounter prometheus . Counter
MsgInsertMongoSuccessCounter prometheus . Counter
MsgInsertMongoFailedCounter prometheus . Counter
SendMsgCounter prometheus . Counter
)
func NewUserLoginCounter ( ) {
if UserLoginCounter != nil {
return
}
UserLoginCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "user_login" ,
Help : "The number of user login" ,
} )
}
func NewUserRegisterCounter ( ) {
if UserRegisterCounter != nil {
return
}
UserRegisterCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "user_register" ,
Help : "The number of user register" ,
@ -47,12 +80,18 @@ func NewUserRegisterCounter() {
}
func NewSeqGetSuccessCounter ( ) {
if SeqGetSuccessCounter != nil {
return
}
SeqGetSuccessCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "seq_get_success" ,
Help : "The number of successful get seq" ,
} )
}
func NewSeqGetFailedCounter ( ) {
if SeqGetFailedCounter != nil {
return
}
SeqGetFailedCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "seq_get_failed" ,
Help : "The number of failed get seq" ,
@ -60,12 +99,18 @@ func NewSeqGetFailedCounter() {
}
func NewSeqSetSuccessCounter ( ) {
if SeqSetSuccessCounter != nil {
return
}
SeqSetSuccessCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "seq_set_success" ,
Help : "The number of successful set seq" ,
} )
}
func NewSeqSetFailedCounter ( ) {
if SeqSetFailedCounter != nil {
return
}
SeqSetFailedCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "seq_set_failed" ,
Help : "The number of failed set seq" ,
@ -73,6 +118,9 @@ func NewSeqSetFailedCounter() {
}
func NewApiRequestCounter ( ) {
if ApiRequestCounter != nil {
return
}
ApiRequestCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "api_request" ,
Help : "The number of api request" ,
@ -80,6 +128,9 @@ func NewApiRequestCounter() {
}
func NewApiRequestSuccessCounter ( ) {
if ApiRequestSuccessCounter != nil {
return
}
ApiRequestSuccessCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "api_request_success" ,
Help : "The number of api request success" ,
@ -87,6 +138,9 @@ func NewApiRequestSuccessCounter() {
}
func NewApiRequestFailedCounter ( ) {
if ApiRequestFailedCounter != nil {
return
}
ApiRequestFailedCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "api_request_failed" ,
Help : "The number of api request failed" ,
@ -94,6 +148,9 @@ func NewApiRequestFailedCounter() {
}
func NewGrpcRequestCounter ( ) {
if GrpcRequestCounter != nil {
return
}
GrpcRequestCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "grpc_request" ,
Help : "The number of api request" ,
@ -101,6 +158,9 @@ func NewGrpcRequestCounter() {
}
func NewGrpcRequestSuccessCounter ( ) {
if GrpcRequestSuccessCounter != nil {
return
}
GrpcRequestSuccessCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "grpc_request_success" ,
Help : "The number of grpc request success" ,
@ -108,6 +168,9 @@ func NewGrpcRequestSuccessCounter() {
}
func NewGrpcRequestFailedCounter ( ) {
if GrpcRequestFailedCounter != nil {
return
}
GrpcRequestFailedCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "grpc_request_failed" ,
Help : "The number of grpc request failed" ,
@ -115,6 +178,9 @@ func NewGrpcRequestFailedCounter() {
}
func NewSendMsgCount ( ) {
if SendMsgCounter != nil {
return
}
SendMsgCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "send_msg" ,
Help : "The number of send msg" ,
@ -122,6 +188,9 @@ func NewSendMsgCount() {
}
func NewMsgInsertRedisSuccessCounter ( ) {
if MsgInsertRedisSuccessCounter != nil {
return
}
MsgInsertRedisSuccessCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "msg_insert_redis_success" ,
Help : "The number of successful insert msg to redis" ,
@ -129,6 +198,9 @@ func NewMsgInsertRedisSuccessCounter() {
}
func NewMsgInsertRedisFailedCounter ( ) {
if MsgInsertRedisFailedCounter != nil {
return
}
MsgInsertRedisFailedCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "msg_insert_redis_failed" ,
Help : "The number of failed insert msg to redis" ,
@ -136,6 +208,9 @@ func NewMsgInsertRedisFailedCounter() {
}
func NewMsgInsertMongoSuccessCounter ( ) {
if MsgInsertMongoSuccessCounter != nil {
return
}
MsgInsertMongoSuccessCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "msg_insert_mongo_success" ,
Help : "The number of successful insert msg to mongo" ,
@ -143,8 +218,198 @@ func NewMsgInsertMongoSuccessCounter() {
}
func NewMsgInsertMongoFailedCounter ( ) {
if MsgInsertMongoFailedCounter != nil {
return
}
MsgInsertMongoFailedCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "msg_insert_mongo_failed" ,
Help : "The number of failed insert msg to mongo" ,
} )
}
func NewMsgPullFromRedisSuccessCounter ( ) {
if MsgPullFromRedisSuccessCounter != nil {
return
}
MsgPullFromRedisSuccessCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "msg_pull_from_redis_success" ,
Help : "The number of successful pull msg from redis" ,
} )
}
func NewMsgPullFromRedisFailedCounter ( ) {
if MsgPullFromRedisFailedCounter != nil {
return
}
MsgPullFromRedisFailedCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "msg_pull_from_redis_failed" ,
Help : "The number of failed pull msg from redis" ,
} )
}
func NewMsgPullFromMongoSuccessCounter ( ) {
if MsgPullFromMongoSuccessCounter != nil {
return
}
MsgPullFromMongoSuccessCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "msg_pull_from_mongo_success" ,
Help : "The number of successful pull msg from mongo" ,
} )
}
func NewMsgPullFromMongoFailedCounter ( ) {
if MsgPullFromMongoFailedCounter != nil {
return
}
MsgPullFromMongoFailedCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "msg_pull_from_mongo_failed" ,
Help : "The number of failed pull msg from mongo" ,
} )
}
func NewMsgRecvTotalCounter ( ) {
if MsgRecvTotalCounter != nil {
return
}
MsgRecvTotalCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "msg_recv_total" ,
Help : "The number of msg received" ,
} )
}
func NewGetNewestSeqTotalCounter ( ) {
if GetNewestSeqTotalCounter != nil {
return
}
GetNewestSeqTotalCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "get_newest_seq_total" ,
Help : "the number of get newest seq" ,
} )
}
func NewPullMsgBySeqListTotalCounter ( ) {
if PullMsgBySeqListTotalCounter != nil {
return
}
PullMsgBySeqListTotalCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "pull_msg_by_seq_list_total" ,
Help : "The number of pull msg by seq list" ,
} )
}
func NewSingleChatMsgRecvSuccessCounter ( ) {
if SingleChatMsgRecvSuccessCounter != nil {
return
}
SingleChatMsgRecvSuccessCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "single_chat_msg_recv_success" ,
Help : "The number of single chat msg successful received " ,
} )
}
func NewGroupChatMsgRecvSuccessCounter ( ) {
if GroupChatMsgRecvSuccessCounter != nil {
return
}
GroupChatMsgRecvSuccessCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "group_chat_msg_recv_success" ,
Help : "The number of group chat msg successful received" ,
} )
}
func NewWorkSuperGroupChatMsgRecvSuccessCounter ( ) {
if WorkSuperGroupChatMsgRecvSuccessCounter != nil {
return
}
WorkSuperGroupChatMsgRecvSuccessCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "work_super_group_chat_msg_recv_success" ,
Help : "The number of work/super group chat msg successful received" ,
} )
}
func NewSingleChatMsgProcessSuccessCounter ( ) {
if SingleChatMsgProcessSuccessCounter != nil {
return
}
SingleChatMsgProcessSuccessCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "single_chat_msg_process_success" ,
Help : "The number of single chat msg successful processed" ,
} )
}
func NewSingleChatMsgProcessFailedCounter ( ) {
if SingleChatMsgProcessFailedCounter != nil {
return
}
SingleChatMsgProcessFailedCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "single_chat_msg_process_failed" ,
Help : "The number of single chat msg failed processed" ,
} )
}
func NewGroupChatMsgProcessSuccessCounter ( ) {
if GroupChatMsgProcessSuccessCounter != nil {
return
}
GroupChatMsgProcessSuccessCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "group_chat_msg_process_success" ,
Help : "The number of group chat msg successful processed" ,
} )
}
func NewGroupChatMsgProcessFailedCounter ( ) {
if GroupChatMsgProcessFailedCounter != nil {
return
}
GroupChatMsgProcessFailedCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "group_chat_msg_process_failed" ,
Help : "The number of group chat msg failed processed" ,
} )
}
func NewWorkSuperGroupChatMsgProcessSuccessCounter ( ) {
if WorkSuperGroupChatMsgProcessSuccessCounter != nil {
return
}
WorkSuperGroupChatMsgProcessSuccessCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "work_super_group_chat_msg_process_success" ,
Help : "The number of work/super group chat msg successful processed" ,
} )
}
func NewWorkSuperGroupChatMsgProcessFailedCounter ( ) {
if WorkSuperGroupChatMsgProcessFailedCounter != nil {
return
}
WorkSuperGroupChatMsgProcessFailedCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "work_super_group_chat_msg_process_failed" ,
Help : "The number of work/super group chat msg failed processed" ,
} )
}
func NewMsgOnlinePushSuccessCounter ( ) {
if MsgOnlinePushSuccessCounter != nil {
return
}
MsgOnlinePushSuccessCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "msg_online_push_success" ,
Help : "The number of msg successful online pushed" ,
} )
}
func NewMsgOfflinePushSuccessCounter ( ) {
if MsgOfflinePushSuccessCounter != nil {
return
}
MsgOfflinePushSuccessCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "msg_offline_push_success" ,
Help : "The number of msg successful offline pushed" ,
} )
}
func NewMsgOfflinePushFailedCounter ( ) {
if MsgOfflinePushFailedCounter != nil {
return
}
MsgOfflinePushFailedCounter = promauto . NewCounter ( prometheus . CounterOpts {
Name : "msg_offline_push_failed" ,
Help : "The number of msg failed offline pushed" ,
} )
}