@@ -18,16 +18,48 @@ import "github.com/prometheus/client_golang/prometheus"
18
18
19
19
// bindinfo metrics.
20
20
var (
21
- BindUsageCounter * prometheus.CounterVec
21
+ BindingCacheHitCounter prometheus.Counter
22
+ BindingCacheMissCounter prometheus.Counter
23
+ BindingCacheMemUsage prometheus.Gauge
24
+ BindingCacheMemLimit prometheus.Gauge
25
+ BindingCacheNumBindings prometheus.Gauge
22
26
)
23
27
24
28
// InitBindInfoMetrics initializes bindinfo metrics.
25
29
func InitBindInfoMetrics () {
26
- BindUsageCounter = NewCounterVec (
30
+ BindingCacheHitCounter = NewCounter (
27
31
prometheus.CounterOpts {
28
32
Namespace : "tidb" ,
29
- Subsystem : "bindinfo" ,
30
- Name : "bind_usage_counter" ,
31
- Help : "Counter of query using sql bind" ,
32
- }, []string {LabelScope })
33
+ Subsystem : "server" ,
34
+ Name : "binding_cache_hit_total" ,
35
+ Help : "Counter of binding cache hit." ,
36
+ })
37
+ BindingCacheMissCounter = NewCounter (
38
+ prometheus.CounterOpts {
39
+ Namespace : "tidb" ,
40
+ Subsystem : "server" ,
41
+ Name : "binding_cache_miss_total" ,
42
+ Help : "Counter of binding cache miss." ,
43
+ })
44
+ BindingCacheMemUsage = NewGauge (
45
+ prometheus.GaugeOpts {
46
+ Namespace : "tidb" ,
47
+ Subsystem : "server" ,
48
+ Name : "binding_cache_mem_usage" ,
49
+ Help : "Memory usage of binding cache." ,
50
+ })
51
+ BindingCacheMemLimit = NewGauge (
52
+ prometheus.GaugeOpts {
53
+ Namespace : "tidb" ,
54
+ Subsystem : "server" ,
55
+ Name : "binding_cache_mem_limit" ,
56
+ Help : "Memory limit of binding cache." ,
57
+ })
58
+ BindingCacheNumBindings = NewGauge (
59
+ prometheus.GaugeOpts {
60
+ Namespace : "tidb" ,
61
+ Subsystem : "server" ,
62
+ Name : "binding_cache_num_bindings" ,
63
+ Help : "Number of bindings in binding cache." ,
64
+ })
33
65
}
0 commit comments