ran go fmt as requested
This commit is contained in:
parent
eac52f1929
commit
bf47405209
|
@ -95,27 +95,27 @@ func (p *Postgresql) Gather(acc telegraf.Accumulator) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//return rows.Err()
|
//return rows.Err()
|
||||||
query = `SELECT * FROM pg_stat_bgwriter`
|
query = `SELECT * FROM pg_stat_bgwriter`
|
||||||
|
|
||||||
bg_writer_row, err := db.Query(query)
|
bg_writer_row, err := db.Query(query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
defer bg_writer_row.Close()
|
defer bg_writer_row.Close()
|
||||||
|
|
||||||
// grab the column information from the result
|
// grab the column information from the result
|
||||||
p.OrderedColumns, err = bg_writer_row.Columns()
|
p.OrderedColumns, err = bg_writer_row.Columns()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
for bg_writer_row.Next() {
|
for bg_writer_row.Next() {
|
||||||
err = p.accRow(bg_writer_row, acc)
|
err = p.accRow(bg_writer_row, acc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return bg_writer_row.Err()
|
return bg_writer_row.Err()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ func (p *Postgresql) accRow(row scanner, acc telegraf.Accumulator) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if columnMap["datname"] != nil {
|
if columnMap["datname"] != nil {
|
||||||
// extract the database name from the column map
|
// extract the database name from the column map
|
||||||
dbnameChars := (*columnMap["datname"]).([]uint8)
|
dbnameChars := (*columnMap["datname"]).([]uint8)
|
||||||
for i := 0; i < len(dbnameChars); i++ {
|
for i := 0; i < len(dbnameChars); i++ {
|
||||||
|
|
Loading…
Reference in New Issue