Module: PgReports::Modules::Connections
Overview
Connection and lock analysis module Most report methods are generated from YAML definitions in lib/pg_reports/definitions/connections/
Instance Method Summary collapse
-
#cancel_query(pid) ⇒ Boolean
Cancel a specific query (softer than kill).
-
#kill_connection(pid) ⇒ Boolean
Kill a specific backend process.
Instance Method Details
#cancel_query(pid) ⇒ Boolean
Cancel a specific query (softer than kill)
29 30 31 32 |
# File 'lib/pg_reports/modules/connections.rb', line 29 def cancel_query(pid) result = executor.execute("SELECT pg_cancel_backend(:pid)", pid: pid) result.first&.fetch("pg_cancel_backend", false) || false end |
#kill_connection(pid) ⇒ Boolean
Kill a specific backend process
21 22 23 24 |
# File 'lib/pg_reports/modules/connections.rb', line 21 def kill_connection(pid) result = executor.execute("SELECT pg_terminate_backend(:pid)", pid: pid) result.first&.fetch("pg_terminate_backend", false) || false end |