Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Commit f6367f4

Browse files
committed
Add func comments
1 parent 2007831 commit f6367f4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

gauges/basics.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ import (
66
"github.com/prometheus/client_golang/prometheus"
77
)
88

9+
// Up returns if database is up and accepting connections
910
func (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
3032
func (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
4144
func (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.
5256
func (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

Comments
 (0)