Add metrics
This commit is contained in:
27
metrics/metrics.go
Normal file
27
metrics/metrics.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package metrics
|
||||
|
||||
import (
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||
)
|
||||
|
||||
type MumbleMetricsCollector struct {
|
||||
TalkSecondsTotal prometheus.Counter
|
||||
PTTTogglesTotal prometheus.Counter
|
||||
}
|
||||
|
||||
func NewMumbleMetricsCollector() *MumbleMetricsCollector {
|
||||
talkSecondsTotal := promauto.NewCounter(prometheus.CounterOpts{
|
||||
Name: "mumble_talk_seconds_total",
|
||||
Help: "The total number of seconds a user has been talking",
|
||||
})
|
||||
pttTogglesTotal := promauto.NewCounter(prometheus.CounterOpts{
|
||||
Name: "mumble_ptt_toggles_total",
|
||||
Help: "The total number of seconds a user has been talking",
|
||||
})
|
||||
|
||||
return &MumbleMetricsCollector{
|
||||
TalkSecondsTotal: talkSecondsTotal,
|
||||
PTTTogglesTotal: pttTogglesTotal,
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user