pghero 2.7.4 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pghero might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/app/controllers/pg_hero/home_controller.rb +2 -1
- data/app/helpers/pg_hero/home_helper.rb +10 -0
- data/app/views/pg_hero/home/index.html.erb +3 -0
- data/app/views/pg_hero/home/maintenance.html.erb +2 -2
- data/lib/pghero/methods/queries.rb +2 -1
- data/lib/pghero/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: e754becdd218d70d2134bdc75529f30be8b7e5158e2e22bd7e89b326353e12fa
|
4
|
+
data.tar.gz: dd0cd7fe10dc4201643f6c5f91d58060dbde78feab62ed98a6fb63ee17909666
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2b4685743c02cdc9bcc4f98225d7cf1de1efb824a4bda52b02baac22a8aa852755d19f1b343856da334c8aa29e0c27ebe2827be9dd5b6e8d8930e31373da2a2
|
7
|
+
data.tar.gz: ba47c2eed1b11ba28ff2038b88543fd1c78a81c9188c96791dd8002c7928786fc178da9cc12cdf33c752e0243cacde2b1e569478150d988732f9042446be66dd
|
data/CHANGELOG.md
CHANGED
@@ -34,7 +34,8 @@ module PgHero
|
|
34
34
|
@inactive_replication_slots = @database.replication_slots.select { |r| !r[:active] }
|
35
35
|
end
|
36
36
|
|
37
|
-
@
|
37
|
+
@walsender_queries, long_running_queries = @database.long_running_queries.partition { |q| q[:backend_type] == "walsender" }
|
38
|
+
@autovacuum_queries, @long_running_queries = long_running_queries.partition { |q| q[:query].starts_with?("autovacuum:") }
|
38
39
|
|
39
40
|
connection_states = @database.connection_states
|
40
41
|
@total_connections = connection_states.values.sum
|
@@ -26,5 +26,15 @@ module PgHero
|
|
26
26
|
ret << ", column: #{columns.inspect}" if columns
|
27
27
|
ret
|
28
28
|
end
|
29
|
+
|
30
|
+
def pghero_formatted_vacuum_times(time)
|
31
|
+
content_tag(:span, title: pghero_formatted_date_time(time)) do
|
32
|
+
"#{time_ago_in_words(time, include_seconds: true).sub(/(over|about|almost) /, "").sub("less than", "<")} ago"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def pghero_formatted_date_time(time)
|
37
|
+
l time.in_time_zone(@time_zone), format: :long
|
38
|
+
end
|
29
39
|
end
|
30
40
|
end
|
@@ -26,6 +26,9 @@
|
|
26
26
|
<% if @autovacuum_queries.any? %>
|
27
27
|
<span class="tiny"><%= @autovacuum_queries.size %> autovacuum</span>
|
28
28
|
<% end %>
|
29
|
+
<% if @walsender_queries.any? %>
|
30
|
+
<span class="tiny"><%= @walsender_queries.size %> walsender</span>
|
31
|
+
<% end %>
|
29
32
|
</div>
|
30
33
|
<% if @extended %>
|
31
34
|
<div class="alert alert-<%= @good_cache_rate ? "success" : "warning" %>">
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<td>
|
25
25
|
<% time = [table[:last_autovacuum], table[:last_vacuum]].compact.max %>
|
26
26
|
<% if time %>
|
27
|
-
<%=
|
27
|
+
<%= pghero_formatted_vacuum_times(time) %>
|
28
28
|
<% else %>
|
29
29
|
<span class="text-muted">Unknown</span>
|
30
30
|
<% end %>
|
@@ -32,7 +32,7 @@
|
|
32
32
|
<td>
|
33
33
|
<% time = [table[:last_autoanalyze], table[:last_analyze]].compact.max %>
|
34
34
|
<% if time %>
|
35
|
-
<%=
|
35
|
+
<%= pghero_formatted_vacuum_times(time) %>
|
36
36
|
<% else %>
|
37
37
|
<span class="text-muted">Unknown</span>
|
38
38
|
<% end %>
|
@@ -12,7 +12,8 @@ module PgHero
|
|
12
12
|
query,
|
13
13
|
COALESCE(query_start, xact_start) AS started_at,
|
14
14
|
EXTRACT(EPOCH FROM NOW() - COALESCE(query_start, xact_start)) * 1000.0 AS duration_ms,
|
15
|
-
usename AS user
|
15
|
+
usename AS user,
|
16
|
+
#{server_version_num >= 100000 ? "backend_type" : "NULL AS backend_type"}
|
16
17
|
FROM
|
17
18
|
pg_stat_activity
|
18
19
|
WHERE
|
data/lib/pghero/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pghero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|