ruby-pg-extras 4.12.1 → 4.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/ruby-pg-extras.rb +2 -1
- 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: f84126ffc90821361e404b0815705d6ee549af7332a98e8cfade6475c8ee8bbe
|
4
|
+
data.tar.gz: 14cdc3c6ed209496be467d8f894e0e05fe163d88c5de135a03d8ffa1bb6fce13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 346f1b641f38d4732a88ffcdfa99d921faa168cd1f6ee2a6b1290764a8cfd7f9e4856f189ed610e22337029598e1799f28bbc30d2212829b968f073d400bc871
|
7
|
+
data.tar.gz: c91b2b32de6ff8fc2f6175ead5ffe464d1361b59fa12328e68ec3416884219074404fa5c85136bc902c5390a82a5ff9c3d85a37709d81a9e5d9f7337e7a31fce
|
data/README.md
CHANGED
@@ -47,7 +47,7 @@ RubyPgExtras.add_extensions
|
|
47
47
|
|
48
48
|
## Usage
|
49
49
|
|
50
|
-
Gem expects the `ENV['DATABASE_URL']` value in the following format:
|
50
|
+
Gem expects the `ENV['RUBY_PG_EXTRAS_DATABASE_URL']` or `ENV['DATABASE_URL']` value in the following format:
|
51
51
|
|
52
52
|
```ruby
|
53
53
|
ENV["DATABASE_URL"] = "postgresql://postgres:secret@localhost:5432/database_name"
|
@@ -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
|
---------+---------+---------------+---------+-----------------------+------------------------------------------------------
|
data/lib/ruby-pg-extras.rb
CHANGED
@@ -31,6 +31,7 @@ module RubyPgExtras
|
|
31
31
|
calls: { limit: 10 },
|
32
32
|
calls_legacy: { limit: 10 },
|
33
33
|
long_running_queries: { threshold: "500 milliseconds" },
|
34
|
+
locks: { limit: 20 },
|
34
35
|
outliers: { limit: 10 },
|
35
36
|
outliers_legacy: { limit: 10 },
|
36
37
|
buffercache_stats: { limit: 10 },
|
@@ -178,6 +179,6 @@ module RubyPgExtras
|
|
178
179
|
end
|
179
180
|
|
180
181
|
def self.database_url
|
181
|
-
@@database_url || ENV.fetch("DATABASE_URL")
|
182
|
+
@@database_url || ENV["RUBY_PG_EXTRAS_DATABASE_URL"] || ENV.fetch("DATABASE_URL")
|
182
183
|
end
|
183
184
|
end
|
@@ -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.
|
4
|
+
version: 4.13.0
|
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-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|