Sha256: 571e159c276c2ac35f59ebe7f447afb2a2f2e3506ab8ccad17fc1f38b75afd96

Contents?: true

Size: 1.58 KB

Versions: 1

Compression:

Stored size: 1.58 KB

Contents

<table class="table">
  <% unless local_assigns[:xhr] %>
    <thead>
      <tr>
        <th style="width: 33.33%;">Total Time</th>
        <th style="width: 33.33%;">Average Time</th>
        <th style="width: 33.33%;">Calls</th>
      </tr>
    </thead>
  <% end %>
  <tbody id="queries">
    <% if queries.empty? %>
      <tr>
        <td colspan="3">
          <p class="queries-info text-muted">
            <% if local_assigns[:xhr] %>
              No data available for this time.
            <% else %>
              ...
            <% end %>
          </p>
        </td>
      </tr>
    <% end %>
    <% queries.each do |query| %>
      <tr>
        <td>
          <%= number_with_delimiter(query["total_minutes"].to_f.round) %> min
          <span class="percent">
            <% percent = query["total_percent"].to_f %>
            <% if percent > 1 %>
              <%= percent.round %>%
            <% elsif percent > 0.1 %>
              <%= percent.round(1) %>%
            <% else %>
              &lt; 0.1%
            <% end %>
          </span>
        </td>
        <td><%= number_with_delimiter(query["average_time"].to_f.round) %> ms</td>
        <td><%= number_with_delimiter(query["calls"].to_i) %></td>
      </tr>
      <tr>
        <td colspan="3" style="border-top: none; padding: 0;">
          <pre><%= query["query"] %></pre>
          <% if query["query"] == "<insufficient privilege>" %>
            <p class="text-muted">For security reasons, only superusers can see queries executed by other users.</p>
          <% end %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pghero-1.1.0 app/views/pg_hero/home/_queries_table.html.erb