Skip to content

Commit 71733ed

Browse files
authored
Merge pull request #5 from d0x2f/master
set 'up' metric to 1 if the ping test doesn't fail.
2 parents 566a3be + 8a9dc56 commit 71733ed

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pgpool2_exporter.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
"sync"
3535
"time"
3636

37+
3738
"github.com/go-kit/kit/log/level"
3839
_ "github.com/lib/pq"
3940
"github.com/blang/semver"
@@ -450,7 +451,7 @@ func dbToString(t interface{}) (string, bool) {
450451
return v, true
451452
case bool:
452453
if v {
453-
return "true", true
454+
return "true", true
454455
}
455456
return "false", true
456457
default:
@@ -604,11 +605,10 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric) {
604605
}
605606
e.up.Set(0)
606607
return
607-
} else {
608-
e.up.Set(1)
609608
}
610609
}
611610

611+
e.up.Set(1)
612612
e.error.Set(0)
613613

614614
e.mutex.RLock()

0 commit comments

Comments
 (0)