README.md in postgres-vacuum-monitor-0.4.0 vs README.md in postgres-vacuum-monitor-0.5.0

- old
+ new

@@ -6,11 +6,11 @@ # Postgres::Vacuum::Monitor Postgres::Vacuum::Monitor provides queries that provide information about the number of dead tuples and long running queries. This information helps to diagnose and monitor two things: 1) That the current auto vacuum settings are working and keeping up. -2) That there are no long running queries affecting the auto vacuuming daemon. +2) That there are no long running transactions affecting the auto vacuuming daemon. ## Installation Add this line to your application's Gemfile: @@ -42,18 +42,19 @@ def report_event(name, attributes) end end ``` -For long running queries, the event name is `LongQueries` and the attributes are: +For long running transactions, the event name is `LongTransactions` and the attributes are: ```ruby { database_name: # The name of the database. - start_time: # When the query started . + start_time: # When the transaction started . running_time: # How long has it been running in seconds. application_name: # What's the application name that is running the query. - query: # The offending query. + most_recent_query: # The last query started by the transaction + state: # The state of the transaction - either "active" or "" } ``` For auto vacuum the attributes are the following: @@ -82,12 +83,12 @@ #### Dead tuples ```SQL SELECT percentile(dead_tuples) FROM AutoVacuumLagging facet table where appName = 'my-app' SINCE 1 DAY AGO TIMESERIES ``` -#### Long running queries +#### Long running transactions ```SQL -SELECT application_name, query, running_time, start_time FROM LongQueries +SELECT application_name, state, most_recent_query, running_time, start_time FROM LongTransactions ``` #### Tables that need to be vacuumed ```SQL SELECT uniques(table) FROM AutoVacuumLagging where appName = 'my-app' since 30 minutes ago