mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-14 05:56:00 +08:00
prome
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
// user rpc
|
||||
//auth rpc
|
||||
UserLoginCounter prometheus.Counter
|
||||
UserRegisterCounter prometheus.Counter
|
||||
|
||||
@@ -14,6 +14,18 @@ var (
|
||||
SeqGetFailedCounter prometheus.Counter
|
||||
SeqSetSuccessCounter prometheus.Counter
|
||||
SeqSetFailedCounter prometheus.Counter
|
||||
|
||||
// api
|
||||
ApiRequestCounter prometheus.Counter
|
||||
ApiRequestSuccessCounter prometheus.Counter
|
||||
ApiRequestFailedCounter prometheus.Counter
|
||||
|
||||
// grpc
|
||||
GrpcRequestCounter prometheus.Counter
|
||||
GrpcRequestSuccessCounter prometheus.Counter
|
||||
GrpcRequestFailedCounter prometheus.Counter
|
||||
|
||||
SendMsgCounter prometheus.Counter
|
||||
)
|
||||
|
||||
func NewUserLoginCounter() {
|
||||
@@ -23,6 +35,13 @@ func NewUserLoginCounter() {
|
||||
})
|
||||
}
|
||||
|
||||
func NewUserRegisterCounter() {
|
||||
UserRegisterCounter = promauto.NewCounter(prometheus.CounterOpts{
|
||||
Name: "user_register",
|
||||
Help: "The number of user register",
|
||||
})
|
||||
}
|
||||
|
||||
func NewSeqGetSuccessCounter() {
|
||||
SeqGetSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
||||
Name: "seq_get_success",
|
||||
@@ -48,3 +67,52 @@ func NewSeqSetFailedCounter() {
|
||||
Help: "The number of failed set seq",
|
||||
})
|
||||
}
|
||||
|
||||
func NewApiRequestCounter() {
|
||||
ApiRequestCounter = promauto.NewCounter(prometheus.CounterOpts{
|
||||
Name: "api_request",
|
||||
Help: "The number of api request",
|
||||
})
|
||||
}
|
||||
|
||||
func NewApiRequestSuccessCounter() {
|
||||
ApiRequestSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
||||
Name: "api_request_success",
|
||||
Help: "The number of api request success",
|
||||
})
|
||||
}
|
||||
|
||||
func NewApiRequestFailedCounter() {
|
||||
ApiRequestFailedCounter = promauto.NewCounter(prometheus.CounterOpts{
|
||||
Name: "api_request_failed",
|
||||
Help: "The number of api request failed",
|
||||
})
|
||||
}
|
||||
|
||||
func NewGrpcRequestCounter() {
|
||||
GrpcRequestCounter = promauto.NewCounter(prometheus.CounterOpts{
|
||||
Name: "grpc_request",
|
||||
Help: "The number of api request",
|
||||
})
|
||||
}
|
||||
|
||||
func NewGrpcRequestSuccessCounter() {
|
||||
GrpcRequestSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
||||
Name: "grpc_request_success",
|
||||
Help: "The number of grpc request success",
|
||||
})
|
||||
}
|
||||
|
||||
func NewGrpcRequestFailedCounter() {
|
||||
GrpcRequestFailedCounter = promauto.NewCounter(prometheus.CounterOpts{
|
||||
Name: "grpc_request_failed",
|
||||
Help: "The number of grpc request failed",
|
||||
})
|
||||
}
|
||||
|
||||
func NewSendMsgCount() {
|
||||
SendMsgCounter = promauto.NewCounter(prometheus.CounterOpts{
|
||||
Name: "send_msg",
|
||||
Help: "The number of send msg",
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user