Skip to content

Commit

Permalink
api/metrics- add gauge first referenced in bcc8f45
Browse files Browse the repository at this point in the history
edits not yet implemented
  • Loading branch information
nektro committed Apr 17, 2022
1 parent fae8888 commit 9b1a621
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var (
GaugeUsrBy = newGaugeLabeled("users_by", "stat")
GaugeChanTotal = newGauge("channels_total")
GaugeChanMsgTotal = newGaugeLabeled("messages_total", "channel")
GaugeChanMsgEdits = newGaugeLabeled("messages_edits", "channel")
GaugeChanMsgDels = newGaugeLabeled("messages_deletes", "channel")
GaugeRoleTotal = newGauge("roles_total")
GaugeInvTotal = newGauge("invites_total")
Expand All @@ -42,6 +43,7 @@ func refresh() {
for _, item := range (db.Channel{}.All()) {
uid := item.UUID.String()
GaugeChanMsgTotal.With(prometheus.Labels{"channel": uid}).Set(getPropInt("count_messages_" + uid))
GaugeChanMsgEdits.With(prometheus.Labels{"channel": uid}).Set(getPropInt("count_messages_" + uid + "_edits"))
GaugeChanMsgDels.With(prometheus.Labels{"channel": uid}).Set(getPropInt("count_messages_" + uid + "_deletes"))
}
for _, item := range (db.Invite{}.All()) {
Expand Down

0 comments on commit 9b1a621

Please sign in to comment.