@@ -6,11 +6,12 @@ import (
66 "github.com/prometheus/client_golang/prometheus"
77)
88
9+ // Up returns if database is up and accepting connections
910func (g * Gauges ) Up () prometheus.Gauge {
1011 var gauge = prometheus .NewGauge (
1112 prometheus.GaugeOpts {
1213 Name : "postgresql_up" ,
13- Help : "Dabatase is up and accepting connections" ,
14+ Help : "Database is up and accepting connections" ,
1415 ConstLabels : g .labels ,
1516 },
1617 )
@@ -27,6 +28,7 @@ func (g *Gauges) Up() prometheus.Gauge {
2728 return gauge
2829}
2930
31+ // Size returns the database size in bytes
3032func (g * Gauges ) Size () prometheus.Gauge {
3133 return g .new (
3234 prometheus.GaugeOpts {
@@ -38,22 +40,24 @@ func (g *Gauges) Size() prometheus.Gauge {
3840 )
3941}
4042
43+ // TempSize returns the database total amount of data written to temporary files in bytes
4144func (g * Gauges ) TempSize () prometheus.Gauge {
4245 return g .new (
4346 prometheus.GaugeOpts {
4447 Name : "postgresql_temp_bytes" ,
45- Help : "Temp size in bytes" ,
48+ Help : "Database total amount of data written to temporary files in bytes" ,
4649 ConstLabels : g .labels ,
4750 },
4851 "SELECT temp_bytes FROM pg_stat_database WHERE datname = current_database()" ,
4952 )
5053}
5154
55+ // TempFiles returns the number of temporary files created by queries in this database.
5256func (g * Gauges ) TempFiles () prometheus.Gauge {
5357 return g .new (
5458 prometheus.GaugeOpts {
5559 Name : "postgresql_temp_files" ,
56- Help : "Count of temp files" ,
60+ Help : "Number of temporary files created by queries in this database. " ,
5761 ConstLabels : g .labels ,
5862 },
5963 "SELECT temp_files FROM pg_stat_database WHERE datname = current_database()" ,
0 commit comments