@@ -67,7 +67,7 @@ type schemaIndexBlocksRead struct {
67
67
}
68
68
69
69
// IndexBlocksRead returns the sum of the number of disk blocks read from all public indexes
70
- func (g * Gauges ) IndexBlocksHit () prometheus.Gauge {
70
+ func (g * Gauges ) IndexBlocksRead () * prometheus.GaugeVec {
71
71
var gauge = prometheus .NewGaugeVec (
72
72
prometheus.GaugeOpts {
73
73
Name : "postgresql_index_blocks_read_sum" ,
@@ -93,7 +93,7 @@ func (g *Gauges) IndexBlocksHit() prometheus.Gauge {
93
93
for _ , schema := range schemas {
94
94
gauge .With (prometheus.Labels {
95
95
"schema" : schema .Name ,
96
- }).Set (table .IndexBlocksRead )
96
+ }).Set (schema .IndexBlocksRead )
97
97
}
98
98
}
99
99
time .Sleep (g .interval )
@@ -106,11 +106,11 @@ func (g *Gauges) IndexBlocksHit() prometheus.Gauge {
106
106
107
107
type schemaIndexBlocksHit struct {
108
108
Name string `db:"schemaname"`
109
- IndexBlocksRead float64 `db:"idx_blks_hit"`
109
+ IndexBlocksHit float64 `db:"idx_blks_hit"`
110
110
}
111
111
112
112
// IndexBlocksHit returns the sum of the number of buffer hits on all user indexes
113
- func (g * Gauges ) IndexBlocksRead () prometheus.Gauge {
113
+ func (g * Gauges ) IndexBlocksHit () * prometheus.GaugeVec {
114
114
var gauge = prometheus .NewGaugeVec (
115
115
prometheus.GaugeOpts {
116
116
Name : "postgresql_index_blocks_hit_sum" ,
@@ -136,7 +136,7 @@ func (g *Gauges) IndexBlocksRead() prometheus.Gauge {
136
136
for _ , schema := range schemas {
137
137
gauge .With (prometheus.Labels {
138
138
"schema" : schema .Name ,
139
- }).Set (table . IndexBlocksRead )
139
+ }).Set (schema . IndexBlocksHit )
140
140
}
141
141
}
142
142
time .Sleep (g .interval )
0 commit comments