@@ -67,7 +67,7 @@ type schemaIndexBlocksRead struct {
6767}
6868
6969// 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 {
7171 var gauge = prometheus .NewGaugeVec (
7272 prometheus.GaugeOpts {
7373 Name : "postgresql_index_blocks_read_sum" ,
@@ -93,7 +93,7 @@ func (g *Gauges) IndexBlocksHit() prometheus.Gauge {
9393 for _ , schema := range schemas {
9494 gauge .With (prometheus.Labels {
9595 "schema" : schema .Name ,
96- }).Set (table .IndexBlocksRead )
96+ }).Set (schema .IndexBlocksRead )
9797 }
9898 }
9999 time .Sleep (g .interval )
@@ -106,11 +106,11 @@ func (g *Gauges) IndexBlocksHit() prometheus.Gauge {
106106
107107type schemaIndexBlocksHit struct {
108108 Name string `db:"schemaname"`
109- IndexBlocksRead float64 `db:"idx_blks_hit"`
109+ IndexBlocksHit float64 `db:"idx_blks_hit"`
110110}
111111
112112// 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 {
114114 var gauge = prometheus .NewGaugeVec (
115115 prometheus.GaugeOpts {
116116 Name : "postgresql_index_blocks_hit_sum" ,
@@ -136,7 +136,7 @@ func (g *Gauges) IndexBlocksRead() prometheus.Gauge {
136136 for _ , schema := range schemas {
137137 gauge .With (prometheus.Labels {
138138 "schema" : schema .Name ,
139- }).Set (table . IndexBlocksRead )
139+ }).Set (schema . IndexBlocksHit )
140140 }
141141 }
142142 time .Sleep (g .interval )
0 commit comments