Skip to content

Commit

Permalink
Fixed error with walsender queries on live queries page - fixes #394
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Mar 12, 2022
1 parent 8342641 commit 1cef17a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.8.3 (unreleased)

- Fixed error with walsender queries on live queries page

## 2.8.2 (2021-12-15)

- Fixed sorting by name on space page when historical space stats are not enabled
Expand Down
18 changes: 10 additions & 8 deletions app/views/pg_hero/home/_live_queries_table.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@
<tr>
<td><%= query[:pid] %></td>
<td>
<% sec = query[:duration_ms] / 1000.0 %>
<% if sec < 1.minute %>
<%= sec.round(1) %> s
<% elsif sec < 1.day %>
<%= Time.at(sec).utc.strftime("%H:%M:%S") %>
<% else %>
<% days = (sec / 1.day).floor %>
<%= days %>d <%= Time.at(sec - days.days).utc.strftime("%H:%M:%S") %>
<% if query[:duration_ms] %>
<% sec = query[:duration_ms] / 1000.0 %>
<% if sec < 1.minute %>
<%= sec.round(1) %> s
<% elsif sec < 1.day %>
<%= Time.at(sec).utc.strftime("%H:%M:%S") %>
<% else %>
<% days = (sec / 1.day).floor %>
<%= days %>d <%= Time.at(sec - days.days).utc.strftime("%H:%M:%S") %>
<% end %>
<% end %>
</td>
<td>
Expand Down

0 comments on commit 1cef17a

Please sign in to comment.