28 lines
761 B
Go
28 lines
761 B
Go
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,
|
|
}
|
|
}
|