@@ -8,13 +8,19 @@ import (
8
8
)
9
9
10
10
type metrics struct {
11
- availableBuffersPerSlab * prometheus.CounterVec
11
+ availableBuffersPerSlab * prometheus.GaugeVec
12
12
errorsCounter * prometheus.CounterVec
13
+ accesses * prometheus.CounterVec
13
14
}
14
15
16
+ const (
17
+ opTypeGet = "get"
18
+ opTypePut = "put"
19
+ )
20
+
15
21
func newMetrics (r prometheus.Registerer , name string ) * metrics {
16
22
return & metrics {
17
- availableBuffersPerSlab : promauto .With (r ).NewCounterVec (prometheus.CounterOpts {
23
+ availableBuffersPerSlab : promauto .With (r ).NewGaugeVec (prometheus.GaugeOpts {
18
24
Namespace : constants .Loki ,
19
25
Subsystem : "mempool" ,
20
26
Name : "available_buffers_per_slab" ,
@@ -28,5 +34,12 @@ func newMetrics(r prometheus.Registerer, name string) *metrics {
28
34
Help : "The total amount of errors returned from the pool." ,
29
35
ConstLabels : prometheus.Labels {"pool" : name },
30
36
}, []string {"slab" , "reason" }),
37
+ accesses : promauto .With (r ).NewCounterVec (prometheus.CounterOpts {
38
+ Namespace : constants .Loki ,
39
+ Subsystem : "mempool" ,
40
+ Name : "accesses_total" ,
41
+ Help : "The total amount of accesses to the pool." ,
42
+ ConstLabels : prometheus.Labels {"pool" : name },
43
+ }, []string {"slab" , "op" }),
31
44
}
32
45
}
0 commit comments