mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-04-30 06:58:02 +00:00
Rename symbols
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
This commit is contained in:
parent
20685a3937
commit
3142934ed1
@ -68,28 +68,28 @@ func (c PGConnectionByClientCollector) Update(ctx context.Context, instance *ins
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer rows.Close()
|
defer rows.Close()
|
||||||
var clientCount sql.NullInt64
|
var count sql.NullInt64
|
||||||
var clientName sql.NullString
|
var name sql.NullString
|
||||||
|
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
if err := rows.Scan(&clientCount, &clientName); err != nil {
|
if err := rows.Scan(&count, &name); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if !clientName.Valid {
|
if !name.Valid {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
countMetric := 0.0
|
countMetric := 0.0
|
||||||
if clientCount.Valid {
|
if count.Valid {
|
||||||
countMetric = float64(clientCount.Int64)
|
countMetric = float64(count.Int64)
|
||||||
}
|
}
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
pgClientCountDesc,
|
pgClientCountDesc,
|
||||||
prometheus.GaugeValue,
|
prometheus.GaugeValue,
|
||||||
countMetric,
|
countMetric,
|
||||||
clientName.String,
|
name.String,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if err := rows.Err(); err != nil {
|
if err := rows.Err(); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user