Skip to content

Commit

Permalink
Expect a floating point value for the total seconds
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Hughes <tom@compton.nu>
  • Loading branch information
tomhughes committed Jul 6, 2023
1 parent 80b01e9 commit e3a73d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions collector/pg_process_idle.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (PGProcessIdleCollector) Update(ctx context.Context, instance *instance, ch
GROUP BY 1, 2, 3;`)

var applicationName sql.NullString
var secondsSum sql.NullInt64
var secondsSum sql.NullFloat64
var secondsCount sql.NullInt64
var seconds []float64
var secondsBucket []int64
Expand Down Expand Up @@ -112,7 +112,7 @@ func (PGProcessIdleCollector) Update(ctx context.Context, instance *instance, ch
}
secondsSumMetric := 0.0
if secondsSum.Valid {
secondsSumMetric = float64(secondsSum.Int64)
secondsSumMetric = secondsSum.Float64
}
ch <- prometheus.MustNewConstHistogram(
pgProcessIdleSeconds,
Expand Down

0 comments on commit e3a73d3

Please sign in to comment.