-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmetrics.go
42 lines (29 loc) · 870 Bytes
/
metrics.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//go:build metrics
// +build metrics
package whatnot
/*
Prometheus Metrics
build your projects with the build tag 'metrics' enabled to enable these
*/
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
// Current Locks
var lockCount prometheus.Counter
var currentLockCount prometheus.Gauge
func init() {
lockCount = promauto.NewCounter(prometheus.CounterOpts{Name: "resuri_locks_since_start", Help: "Tptal number of distributed URI locks since boot"})
currentLockCount = promauto.NewGauge(prometheus.GaugeOpts{Name: "resuri_current_lock_count", Help: "Current number of distributed URI locks"})
}
func incrementlocksSinceStart() {
lockCount.Inc()
}
func incCurrentLock() {
currentLockCount.Inc()
}
func decCurrentLock() {
currentLockCount.Dec()
}
func registerNameSpaceMetrics() {
}