postgres-vacuum-monitor 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0fee499969b39fb4a978796ea02938e41b3bcfd2bc9cc359c6ccd7bc3f899baf
4
- data.tar.gz: 8560faf84d65d94e45bcaff906ca32ec85f2e8f2f917445f5fb2ed26eb162196
3
+ metadata.gz: 592f695cd74785fd4ab69842efe03d5e22a9cebb5ffbaeb5fe04464e0115374b
4
+ data.tar.gz: 5e7742f52d74cd2abd69befbbf7e66359b108a811bbaba50fa5b36889793681c
5
5
  SHA512:
6
- metadata.gz: a56a0f9106ed71b00cfe4121065a441ffbf35c5365217d1e2f0ac4ae7d41dfbd6d7ba1b8693727f06bed87c8ebe2d73358aed33bbd8fdd16d70af9f1ee2437e9
7
- data.tar.gz: 3c1c355e1fd736f397faef12c9ca96520b2266a7747fd65db49da17bd752c99d1d11db09d943b324ddb05e65c2bfdb7fe6ec441720a436b8fcddba1a3f95679e
6
+ metadata.gz: d5a79c0d3bcea4003b28dd74ca89aea9c89e0a55219a66712db91709c35995615fa0d965288210cd09261b1f1be66c8dc710701498c1ca4a9e56f7e08893e478
7
+ data.tar.gz: bd177531dd058f581a3a4c325a1a3fc283fd74c05780bab7bff1c3e541a71fff5d848c03d76546432b931f030b243800aaea382bc4a16cdb932c771ac6b8c8fe
@@ -1,5 +1,9 @@
1
1
  # postgres-vacuum-monitor
2
- ## v.0.5.0
2
+ ## v.0.7.0
3
+ - Lower the default `LongTransactions` threshold from 1 hour to 5 minutes and make this configurable via
4
+ the `long_running_transaction_threshold_seconds` setting.
5
+
6
+ ## v.0.6.0
3
7
  - Add `wait_event_type`, `transaction_id` and `min_transaction_id` to `LongTransactions` events.
4
8
 
5
9
  ## v.0.5.0
data/README.md CHANGED
@@ -33,6 +33,8 @@ The job itself needs a class to report the information and can be configured by
33
33
  ```ruby
34
34
  Postgres::Vacuum::Monitor.configure do |config|
35
35
  config.monitor_reporter_class_name = 'MetricsReporter'
36
+ # Optionally change the default threshold of 5 minutes for reporting long running transactions
37
+ config.long_running_transaction_threshold_seconds = 10 * 60
36
38
  end
37
39
  ```
38
40
 
@@ -1,10 +1,12 @@
1
1
  module Postgres
2
2
  module Vacuum
3
3
  class Configuration
4
- attr_accessor :monitor_reporter_class_name
4
+ DEFAULT_LONG_RUNNING_TRANSACTION_THRESHOLD_SECONDS = 5 * 60
5
+ attr_accessor :monitor_reporter_class_name, :long_running_transaction_threshold_seconds
5
6
 
6
7
  def initialize
7
- @monitor_reporter_class_name = nil
8
+ self.monitor_reporter_class_name = nil
9
+ self.long_running_transaction_threshold_seconds = DEFAULT_LONG_RUNNING_TRANSACTION_THRESHOLD_SECONDS
8
10
  end
9
11
  end
10
12
  end
@@ -5,7 +5,6 @@ module Postgres
5
5
  extend self
6
6
 
7
7
  STATES = ["'idle in transaction'", "'active'"].freeze
8
- TIME_LIMIT = 3600
9
8
  THRESHOLD_SETTING = "'autovacuum_vacuum_threshold'".freeze
10
9
  SCALE_FACTOR_SETTING = "'autovacuum_vacuum_scale_factor'".freeze
11
10
  MAX_AGE_SETTING = "'autovacuum_freeze_max_age'".freeze
@@ -29,7 +28,7 @@ module Postgres
29
28
  WHERE state IN (#{STATES.join(', ')})
30
29
  ORDER BY seconds DESC
31
30
  ) AS long_queries
32
- WHERE seconds > #{TIME_LIMIT};
31
+ WHERE seconds > #{Postgres::Vacuum::Monitor.configuration.long_running_transaction_threshold_seconds};
33
32
  SQL
34
33
  end
35
34
 
@@ -1,7 +1,7 @@
1
1
  module Postgres
2
2
  module Vacuum
3
3
  module Monitor
4
- VERSION = '0.6.0'.freeze
4
+ VERSION = '0.7.0'.freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postgres-vacuum-monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Garces