Skip to content

Commit

Permalink
exclude null state from activity
Browse files Browse the repository at this point in the history
  • Loading branch information
astj committed Nov 6, 2017
1 parent 8a38605 commit ace9a62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mackerel-plugin-postgres/lib/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func fetchConnections(db *sqlx.DB, version version) (map[string]interface{}, err
var query string

if version.first > 9 || version.first == 9 && version.second >= 6 {
query = `select count(*), state, wait_event is not null from pg_stat_activity group by state, wait_event is not null`
query = `select count(*), state, wait_event is not null from pg_stat_activity where state is not null group by state, wait_event is not null`
} else {
query = `select count(*), state, waiting from pg_stat_activity group by state, waiting`
}
Expand Down

0 comments on commit ace9a62

Please sign in to comment.