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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47a716ee42969f2310d696f944dae5d4183a29566f831b5a39b462c637d015df
4
- data.tar.gz: ce9c93d605c256b08e81e412f4e6770c647cea7dac24e6e6d46b7e223c1df9d8
3
+ metadata.gz: e754becdd218d70d2134bdc75529f30be8b7e5158e2e22bd7e89b326353e12fa
4
+ data.tar.gz: dd0cd7fe10dc4201643f6c5f91d58060dbde78feab62ed98a6fb63ee17909666
5
5
  SHA512:
6
- metadata.gz: 0f58527f81051d74db0a9cebf63c8e7ae030efc96767a18d60fce2b9c04713c03c8c321f26df7ad266e081065b11d5b23aa9182e2337c0f9831038f41f120eff
7
- data.tar.gz: 88607437eff79a7ef1f23c98fee24bc4d93cec10d93e29e0dbc21ddf9a05711e6a3c3ee93d3851f15bed652b91ff3555ec86314d5bfdcd7d59e29ae463c49ce2
6
+ metadata.gz: b2b4685743c02cdc9bcc4f98225d7cf1de1efb824a4bda52b02baac22a8aa852755d19f1b343856da334c8aa29e0c27ebe2827be9dd5b6e8d8930e31373da2a2
7
+ data.tar.gz: ba47c2eed1b11ba28ff2038b88543fd1c78a81c9188c96791dd8002c7928786fc178da9cc12cdf33c752e0243cacde2b1e569478150d988732f9042446be66dd
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 2.8.0 (2021-03-14)
2
+
3
+ - No longer show walsender in long running queries
4
+ - Show relative time on maintenance page
5
+ - Added support for `PGHERO_TZ` for Docker and Linux
6
+
1
7
  ## 2.7.4 (2021-02-01)
2
8
 
3
9
  - Fixed error on redirect with Ruby 3
@@ -34,7 +34,8 @@ module PgHero
34
34
  @inactive_replication_slots = @database.replication_slots.select { |r| !r[:active] }
35
35
  end
36
36
 
37
- @autovacuum_queries, @long_running_queries = @database.long_running_queries.partition { |q| q[:query].starts_with?("autovacuum:") }
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
- <%= l time.in_time_zone(@time_zone), format: :short %>
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
- <%= l time.in_time_zone(@time_zone), format: :short %>
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
@@ -1,3 +1,3 @@
1
1
  module PgHero
2
- VERSION = "2.7.4"
2
+ VERSION = "2.8.0"
3
3
  end
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.7.4
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-02-01 00:00:00.000000000 Z
11
+ date: 2021-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord