ruby-pg-extras 4.12.0 → 4.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -9
- data/lib/ruby-pg-extras.rb +1 -0
- data/lib/ruby_pg_extras/diagnose_data.rb +4 -2
- data/lib/ruby_pg_extras/queries/locks.sql +3 -1
- data/lib/ruby_pg_extras/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5e8b0284d78318c326519ebc03c56d7bb0238ac11d002dce652e82c5b071a3af
|
|
4
|
+
data.tar.gz: d3138af7064138aba53a119169ae2d16be12221ebf3b5fc632be84d806b586e4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 287bb0db06f234fe8904dce580586681b5544aa23181bed9237bb09b567a1255a7efbe9f60a9d51c1d30b6d3e476ef9cd1cf064aa2a8b611ab88bd9f5b36f677
|
|
7
|
+
data.tar.gz: fef3615f8cc53584398b12d64fee13afc68d2999b526f8bc4d8143fdc6b52b717178a22813571fee1eca664b0a5ed3974037c86eb0789e8281a8701cda87f637
|
data/README.md
CHANGED
|
@@ -253,7 +253,7 @@ This command provides information on the efficiency of indexes, represented as w
|
|
|
253
253
|
|
|
254
254
|
```ruby
|
|
255
255
|
|
|
256
|
-
RubyPgExtras.locks
|
|
256
|
+
RubyPgExtras.locks(args: { limit: 20 })
|
|
257
257
|
|
|
258
258
|
procpid | relname | transactionid | granted | query_snippet | mode | age | application |
|
|
259
259
|
---------+---------+---------------+---------+-----------------------+------------------------------------------------------
|
|
@@ -641,14 +641,15 @@ This command lists all the currently installed and available PostgreSQL extensio
|
|
|
641
641
|
|
|
642
642
|
RubyPgExtras.connections
|
|
643
643
|
|
|
644
|
-
|
|
645
|
-
|
|
|
646
|
-
|
|
647
|
-
| username
|
|
648
|
-
|
|
649
|
-
| postgres
|
|
650
|
-
| postgres
|
|
651
|
-
|
|
644
|
+
+----------------------------------------------------------------+
|
|
645
|
+
| Returns the list of all active database connections |
|
|
646
|
+
+------------------+--------------------------+------------------+
|
|
647
|
+
| username | pid | client_address | application_name |
|
|
648
|
+
+------------------+--------------------------+------------------+
|
|
649
|
+
| postgres | 15962 | 172.31.69.166/32 | sidekiq |
|
|
650
|
+
| postgres | 16810 | 172.31.69.166/32 | bin/rails |
|
|
651
|
+
+------------------+--------------------------+------------------+
|
|
652
|
+
|
|
652
653
|
```
|
|
653
654
|
|
|
654
655
|
This command returns the list of all active database connections.
|
data/lib/ruby-pg-extras.rb
CHANGED
|
@@ -25,13 +25,15 @@ module RubyPgExtras
|
|
|
25
25
|
:duplicate_indexes
|
|
26
26
|
].yield_self do |checks|
|
|
27
27
|
extensions_data = query_module.extensions(in_format: :hash)
|
|
28
|
+
|
|
28
29
|
pg_stats_enabled = extensions_data.find do |el|
|
|
29
30
|
el.fetch("name") == "pg_stat_statements"
|
|
30
31
|
end.fetch("installed_version", false)
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
ssl_info = extensions_data.find do |el|
|
|
33
34
|
el.fetch("name") == "sslinfo"
|
|
34
|
-
end
|
|
35
|
+
end
|
|
36
|
+
ssl_info_enabled = ssl_info != nil && ssl_info.fetch("installed_version", false)
|
|
35
37
|
|
|
36
38
|
if pg_stats_enabled
|
|
37
39
|
checks = checks.concat([:outliers])
|
|
@@ -15,4 +15,6 @@ OUTER JOIN pg_class
|
|
|
15
15
|
WHERE pg_stat_activity.query <> '<insufficient privilege>'
|
|
16
16
|
AND pg_locks.pid = pg_stat_activity.pid
|
|
17
17
|
AND pg_locks.mode IN ('ExclusiveLock', 'AccessExclusiveLock', 'RowExclusiveLock')
|
|
18
|
-
AND pg_stat_activity.pid <> pg_backend_pid()
|
|
18
|
+
AND pg_stat_activity.pid <> pg_backend_pid()
|
|
19
|
+
ORDER BY query_start
|
|
20
|
+
LIMIT %{limit};
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby-pg-extras
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.12.
|
|
4
|
+
version: 4.12.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- pawurb
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-01-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: pg
|