@@ -6,11 +6,12 @@ import (
6
6
"github.com/prometheus/client_golang/prometheus"
7
7
)
8
8
9
+ // Up returns if database is up and accepting connections
9
10
func (g * Gauges ) Up () prometheus.Gauge {
10
11
var gauge = prometheus .NewGauge (
11
12
prometheus.GaugeOpts {
12
13
Name : "postgresql_up" ,
13
- Help : "Dabatase is up and accepting connections" ,
14
+ Help : "Database is up and accepting connections" ,
14
15
ConstLabels : g .labels ,
15
16
},
16
17
)
@@ -27,6 +28,7 @@ func (g *Gauges) Up() prometheus.Gauge {
27
28
return gauge
28
29
}
29
30
31
+ // Size returns the database size in bytes
30
32
func (g * Gauges ) Size () prometheus.Gauge {
31
33
return g .new (
32
34
prometheus.GaugeOpts {
@@ -38,22 +40,24 @@ func (g *Gauges) Size() prometheus.Gauge {
38
40
)
39
41
}
40
42
43
+ // TempSize returns the database total amount of data written to temporary files in bytes
41
44
func (g * Gauges ) TempSize () prometheus.Gauge {
42
45
return g .new (
43
46
prometheus.GaugeOpts {
44
47
Name : "postgresql_temp_bytes" ,
45
- Help : "Temp size in bytes" ,
48
+ Help : "Database total amount of data written to temporary files in bytes" ,
46
49
ConstLabels : g .labels ,
47
50
},
48
51
"SELECT temp_bytes FROM pg_stat_database WHERE datname = current_database()" ,
49
52
)
50
53
}
51
54
55
+ // TempFiles returns the number of temporary files created by queries in this database.
52
56
func (g * Gauges ) TempFiles () prometheus.Gauge {
53
57
return g .new (
54
58
prometheus.GaugeOpts {
55
59
Name : "postgresql_temp_files" ,
56
- Help : "Count of temp files" ,
60
+ Help : "Number of temporary files created by queries in this database. " ,
57
61
ConstLabels : g .labels ,
58
62
},
59
63
"SELECT temp_files FROM pg_stat_database WHERE datname = current_database()" ,
0 commit comments