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 +4 -4
- data/CHANGELOG.md +5 -1
- data/README.md +2 -0
- data/lib/postgres/vacuum/configuration.rb +4 -2
- data/lib/postgres/vacuum/monitor/query.rb +1 -2
- data/lib/postgres/vacuum/monitor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 592f695cd74785fd4ab69842efe03d5e22a9cebb5ffbaeb5fe04464e0115374b
|
4
|
+
data.tar.gz: 5e7742f52d74cd2abd69befbbf7e66359b108a811bbaba50fa5b36889793681c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5a79c0d3bcea4003b28dd74ca89aea9c89e0a55219a66712db91709c35995615fa0d965288210cd09261b1f1be66c8dc710701498c1ca4a9e56f7e08893e478
|
7
|
+
data.tar.gz: bd177531dd058f581a3a4c325a1a3fc283fd74c05780bab7bff1c3e541a71fff5d848c03d76546432b931f030b243800aaea382bc4a16cdb932c771ac6b8c8fe
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# postgres-vacuum-monitor
|
2
|
-
## v.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
|
-
|
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
|
-
|
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 > #{
|
31
|
+
WHERE seconds > #{Postgres::Vacuum::Monitor.configuration.long_running_transaction_threshold_seconds};
|
33
32
|
SQL
|
34
33
|
end
|
35
34
|
|