Gather stats from PG and redis from localhost by default

This commit is contained in:
Evan Phoenix
2015-05-18 11:53:57 -07:00
parent 4d0784a64d
commit 60a49243cf
2 changed files with 16 additions and 4 deletions

View File

@@ -17,7 +17,14 @@ type Postgresql struct {
Servers []*Server
}
var localhost = &Server{Address: "sslmode=disable"}
func (p *Postgresql) Gather(acc plugins.Accumulator) error {
if len(p.Servers) == 0 {
p.gatherServer(localhost, acc)
return nil
}
for _, serv := range p.Servers {
err := p.gatherServer(serv, acc)
if err != nil {