ruby-pg-extras 4.11.0 → 4.12.1
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 +11 -10
- data/lib/ruby-pg-extras.rb +2 -2
- data/lib/ruby_pg_extras/diagnose_data.rb +4 -2
- data/lib/ruby_pg_extras/queries/{kill_by_pid.sql → kill_pid.sql} +0 -0
- data/lib/ruby_pg_extras/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11c950416b0ecd45e07b683bb3a2fc0c502f68d79797aba489f1a331f425f135
|
4
|
+
data.tar.gz: 0f1f963c3d4b2bccb3e9026eb2ad38042304f29b691f6d580ad1710cdc083fe9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c414dc98101db1d534b3b847abaa9b87868c1c25c3150db2ca4936ef846d78fb3f2500606be6e31abc351c22a5fd41294aa2481855d5933934e628e55172221
|
7
|
+
data.tar.gz: 734625e8df7bb3bc6ffb0886b7fe60caefc49e3ffa8b06455c2fffb92815b007db2d93887601217f552ca98a49160128dbb57a28aedb8704a208fed724410693
|
data/README.md
CHANGED
@@ -591,11 +591,11 @@ RubyPgExtras.kill_all
|
|
591
591
|
|
592
592
|
This commands kills all the currently active connections to the database. It can be useful as a last resort when your database is stuck in a deadlock.
|
593
593
|
|
594
|
-
### `
|
594
|
+
### `kill_pid`
|
595
595
|
|
596
596
|
```ruby
|
597
597
|
|
598
|
-
RubyPgExtras.
|
598
|
+
RubyPgExtras.kill_pid(args: { pid: 4657 })
|
599
599
|
|
600
600
|
```
|
601
601
|
|
@@ -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
@@ -22,7 +22,7 @@ module RubyPgExtras
|
|
22
22
|
long_running_queries mandelbrot outliers
|
23
23
|
records_rank seq_scans table_index_scans table_indexes_size
|
24
24
|
table_size total_index_size total_table_size
|
25
|
-
unused_indexes duplicate_indexes vacuum_stats kill_all
|
25
|
+
unused_indexes duplicate_indexes vacuum_stats kill_all kill_pid
|
26
26
|
pg_stat_statements_reset buffercache_stats
|
27
27
|
buffercache_usage ssl_used connections
|
28
28
|
)
|
@@ -46,7 +46,7 @@ module RubyPgExtras
|
|
46
46
|
table_index_scans: { schema: "public" },
|
47
47
|
records_rank: { schema: "public" },
|
48
48
|
tables: { schema: "public" },
|
49
|
-
|
49
|
+
kill_pid: { pid: 0 }
|
50
50
|
})
|
51
51
|
|
52
52
|
QUERIES.each do |query_name|
|
@@ -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])
|
File without changes
|
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.
|
4
|
+
version: 4.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pawurb
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -106,7 +106,7 @@ files:
|
|
106
106
|
- lib/ruby_pg_extras/queries/index_usage.sql
|
107
107
|
- lib/ruby_pg_extras/queries/indexes.sql
|
108
108
|
- lib/ruby_pg_extras/queries/kill_all.sql
|
109
|
-
- lib/ruby_pg_extras/queries/
|
109
|
+
- lib/ruby_pg_extras/queries/kill_pid.sql
|
110
110
|
- lib/ruby_pg_extras/queries/locks.sql
|
111
111
|
- lib/ruby_pg_extras/queries/long_running_queries.sql
|
112
112
|
- lib/ruby_pg_extras/queries/mandelbrot.sql
|