Sha256: f4572e0c383067d46850e90d4659f34881499ad15f12e926c82b31638187df0f

Contents?: true

Size: 1.53 KB

Versions: 3

Compression:

Stored size: 1.53 KB

Contents

<table class="table queries">
  <thead>
    <tr>
      <th style="width: 25%;">Pid</th>
      <th style="width: 25%;">Duration</th>
      <th style="width: 25%;">State</th>
      <th style="width: 25%;"></th>
    </tr>
  </thead>
  <tbody>
    <% queries.reverse.each do |query| %>
      <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") %>
          <% end %>
        </td>
        <td>
          <%= query[:state] %>
          <% if vacuum_progress[query[:pid]] %>
            <br />
            <strong><%= vacuum_progress[query[:pid]][:phase] %></strong>
          <% end %>
        </td>
        <td class="text-right">
          <%= button_to "Explain", explain_path, params: {query: query[:query]}, form: {target: "_blank"}, class: "btn btn-info" %>
          <%= button_to "Kill", kill_path(pid: query[:pid]), class: "btn btn-danger" %>
        </td>
      </tr>
      <tr>
        <td colspan="6" style="border-top: none; padding: 0;">
          <%= query[:source] %> <span class="text-muted"><%= query[:user] %></span>
          <pre style="margin-top: 1em;"><code><%= query[:query] %></code></pre>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<script>
  highlightQueries();
</script>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pghero-2.4.2 app/views/pg_hero/home/_live_queries_table.html.erb
pghero-2.4.1 app/views/pg_hero/home/_live_queries_table.html.erb
pghero-2.4.0 app/views/pg_hero/home/_live_queries_table.html.erb