You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
570 B
27 lines
570 B
2 years ago
|
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",
|
||
|
})
|
||
|
}
|