mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
prometheus for statistics
This commit is contained in:
parent
375fc0c89e
commit
6a6009827c
@ -28,12 +28,17 @@ func PrometheusHandler() gin.HandlerFunc {
|
||||
|
||||
func PromeInc(counter prometheus.Counter) {
|
||||
if config.Config.Prometheus.Enable {
|
||||
counter.Inc()
|
||||
if counter != nil {
|
||||
counter.Inc()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
func PromeAdd(counter prometheus.Counter, add int) {
|
||||
if config.Config.Prometheus.Enable {
|
||||
counter.Add(float64(add))
|
||||
if counter != nil {
|
||||
counter.Add(float64(add))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user