pghero 3.6.1 → 3.7.0
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/CHANGELOG.md +24 -1
- data/LICENSE.txt +1 -1
- data/README.md +1 -1
- data/lib/pghero/engine.rb +2 -1
- data/lib/pghero/methods/sequences.rb +8 -3
- data/lib/pghero/version.rb +1 -1
- data/lib/pghero.rb +4 -10
- metadata +6 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d8718118d2ebc63b25c38aa1942e09eb01816ab034161803258321c3bf31964
|
4
|
+
data.tar.gz: eb64a910c289fb3aeec9675ee1737ccba0e553ca0234b67483888f6323e58c97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3728a465d113849d4de04f979f44ef770c77bc35b10a730b8018e8e9e13e7cccfac3e99aa44ce14763368e288540ecbe601ad0bde8f546da60754e7ed0ae743
|
7
|
+
data.tar.gz: 8a0cc6584bc5b6e64b0ad5bf830c476d8b5857fcf5ec486b99e211d07d598bc895c8b0eb2ebda4348ede890fab9fe92a8c0de452c69713ef7e863637bc2c1c73
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## 3.7.0 (2025-05-26)
|
2
|
+
|
3
|
+
- Dropped support for Linux package for Ubuntu 20.04
|
4
|
+
- Dropped support for Ruby < 3.2 and Rails < 7.1
|
5
|
+
|
6
|
+
## 3.6.2 (2025-03-21)
|
7
|
+
|
8
|
+
- Improved query in `sequences` method
|
9
|
+
|
1
10
|
## 3.6.1 (2024-10-14)
|
2
11
|
|
3
12
|
- Fixed error when Propshaft is installed but not used
|
@@ -491,4 +500,18 @@ PgHero.with(:database2) { PgHero.running_queries }
|
|
491
500
|
|
492
501
|
## 0.1.0 (2014-07-23)
|
493
502
|
|
494
|
-
-
|
503
|
+
- Improved explanations
|
504
|
+
- Updated design
|
505
|
+
|
506
|
+
## 0.0.3 (2014-07-22)
|
507
|
+
|
508
|
+
- Fixed `missing_indexes` method
|
509
|
+
|
510
|
+
## 0.0.2 (2014-07-21)
|
511
|
+
|
512
|
+
- Added `unused_tables` method
|
513
|
+
- Added `database_size` method
|
514
|
+
|
515
|
+
## 0.0.1 (2014-07-21)
|
516
|
+
|
517
|
+
- First release
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@ A performance dashboard for Postgres
|
|
4
4
|
|
5
5
|
[See it in action](https://pghero.dokkuapp.com/)
|
6
6
|
|
7
|
-
[](https://pghero.dokkuapp.com/)
|
8
8
|
|
9
9
|
:tangerine: Battle-tested at [Instacart](https://www.instacart.com/opensource)
|
10
10
|
|
data/lib/pghero/engine.rb
CHANGED
@@ -39,14 +39,19 @@ module PgHero
|
|
39
39
|
|
40
40
|
add_sequence_attributes(sequences)
|
41
41
|
|
42
|
-
|
43
|
-
|
42
|
+
last_value = {}
|
43
|
+
sequences.select { |s| s[:readable] }.map { |s| [s[:schema], s[:sequence]] }.uniq.each_slice(1024) do |slice|
|
44
|
+
sql = slice.map { |s| "SELECT last_value FROM #{quote_ident(s[0])}.#{quote_ident(s[1])}" }.join(" UNION ALL ")
|
44
45
|
|
45
46
|
select_all(sql).zip(slice) do |row, seq|
|
46
|
-
seq
|
47
|
+
last_value[seq] = row[:last_value]
|
47
48
|
end
|
48
49
|
end
|
49
50
|
|
51
|
+
sequences.select { |s| s[:readable] }.each do |seq|
|
52
|
+
seq[:last_value] = last_value[[seq[:schema], seq[:sequence]]]
|
53
|
+
end
|
54
|
+
|
50
55
|
# use to_s for unparsable sequences
|
51
56
|
sequences.sort_by { |s| s[:sequence].to_s }
|
52
57
|
end
|
data/lib/pghero/version.rb
CHANGED
data/lib/pghero.rb
CHANGED
@@ -79,13 +79,13 @@ module PgHero
|
|
79
79
|
# use method instead of attr_accessor to ensure
|
80
80
|
# this works if variable set after PgHero is loaded
|
81
81
|
def username
|
82
|
-
@username ||=
|
82
|
+
@username ||= (file_config || {})["username"] || ENV["PGHERO_USERNAME"]
|
83
83
|
end
|
84
84
|
|
85
85
|
# use method instead of attr_accessor to ensure
|
86
86
|
# this works if variable set after PgHero is loaded
|
87
87
|
def password
|
88
|
-
@password ||=
|
88
|
+
@password ||= (file_config || {})["password"] || ENV["PGHERO_PASSWORD"]
|
89
89
|
end
|
90
90
|
|
91
91
|
# config pattern for https://github.com/ankane/pghero/issues/424
|
@@ -151,7 +151,7 @@ module PgHero
|
|
151
151
|
|
152
152
|
if databases.empty?
|
153
153
|
databases["primary"] = {
|
154
|
-
"url" => ENV["PGHERO_DATABASE_URL"]
|
154
|
+
"url" => ENV["PGHERO_DATABASE_URL"]
|
155
155
|
}
|
156
156
|
end
|
157
157
|
|
@@ -168,11 +168,6 @@ module PgHero
|
|
168
168
|
}
|
169
169
|
end
|
170
170
|
|
171
|
-
# private
|
172
|
-
def default_connection_config
|
173
|
-
connection_config(ActiveRecord::Base) if ActiveRecord::VERSION::STRING.to_f < 7.1
|
174
|
-
end
|
175
|
-
|
176
171
|
# ensure we only have one copy of databases
|
177
172
|
# so there's only one connection pool per database
|
178
173
|
def databases
|
@@ -252,9 +247,8 @@ module PgHero
|
|
252
247
|
end
|
253
248
|
|
254
249
|
# private
|
255
|
-
# Rails 7.0 deprecates `include_replicas` for `include_hidden`
|
256
250
|
def include_replicas_key
|
257
|
-
|
251
|
+
:include_hidden
|
258
252
|
end
|
259
253
|
|
260
254
|
private
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pghero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: activerecord
|
@@ -16,15 +15,14 @@ dependencies:
|
|
16
15
|
requirements:
|
17
16
|
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
18
|
+
version: '7.1'
|
20
19
|
type: :runtime
|
21
20
|
prerelease: false
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
23
22
|
requirements:
|
24
23
|
- - ">="
|
25
24
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
-
description:
|
25
|
+
version: '7.1'
|
28
26
|
email: andrew@ankane.org
|
29
27
|
executables: []
|
30
28
|
extensions: []
|
@@ -109,7 +107,6 @@ homepage: https://github.com/ankane/pghero
|
|
109
107
|
licenses:
|
110
108
|
- MIT
|
111
109
|
metadata: {}
|
112
|
-
post_install_message:
|
113
110
|
rdoc_options: []
|
114
111
|
require_paths:
|
115
112
|
- lib
|
@@ -117,15 +114,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
114
|
requirements:
|
118
115
|
- - ">="
|
119
116
|
- !ruby/object:Gem::Version
|
120
|
-
version: '3.
|
117
|
+
version: '3.2'
|
121
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
119
|
requirements:
|
123
120
|
- - ">="
|
124
121
|
- !ruby/object:Gem::Version
|
125
122
|
version: '0'
|
126
123
|
requirements: []
|
127
|
-
rubygems_version: 3.
|
128
|
-
signing_key:
|
124
|
+
rubygems_version: 3.6.7
|
129
125
|
specification_version: 4
|
130
126
|
summary: A performance dashboard for Postgres
|
131
127
|
test_files: []
|