-
Notifications
You must be signed in to change notification settings - Fork 711
/
metrics.go
36 lines (31 loc) · 1016 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
package simulator
import "github.com/prometheus/client_golang/prometheus"
var (
snapDuration = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Namespace: "tikv",
Subsystem: "raftstore",
Name: "snapshot_duration_seconds",
Help: "Bucketed histogram of processing time (s) of handled snap requests.",
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 20),
}, []string{"store", "type"})
schedulingCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "pd",
Subsystem: "schedule",
Name: "scheduling_count",
Help: "Counter of region scheduling",
}, []string{"type"})
snapshotCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "pd",
Subsystem: "schedule",
Name: "snapshot_count",
Help: "Counter of region snapshot",
}, []string{"store", "type"})
)
func init() {
prometheus.MustRegister(snapDuration)
prometheus.MustRegister(schedulingCounter)
prometheus.MustRegister(snapshotCounter)
}