mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-07 02:26:00 +08:00
prometheus for statistics
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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",
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user