pghero 0.1.10 → 1.0.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 +10 -0
- data/README.md +11 -226
- data/app/controllers/pg_hero/home_controller.rb +47 -9
- data/app/views/layouts/pg_hero/application.html.erb +43 -16
- data/app/views/pg_hero/home/_live_queries_table.html.erb +27 -0
- data/app/views/pg_hero/home/_queries_table.html.erb +25 -14
- data/app/views/pg_hero/home/index.html.erb +22 -2
- data/app/views/pg_hero/home/{indexes.html.erb → index_usage.html.erb} +1 -1
- data/app/views/pg_hero/home/live_queries.html.erb +9 -0
- data/app/views/pg_hero/home/queries.html.erb +13 -5
- data/app/views/pg_hero/home/space.html.erb +8 -5
- data/app/views/pg_hero/home/system.html.erb +14 -0
- data/config/routes.rb +25 -14
- data/guides/Docker.md +5 -0
- data/guides/Heroku.md +58 -0
- data/guides/Linux.md +203 -0
- data/guides/Query-Stats.md +60 -0
- data/guides/Rails.md +187 -0
- data/lib/pghero.rb +95 -9
- data/lib/pghero/version.rb +1 -1
- metadata +11 -6
- data/app/views/pg_hero/home/_query_stats_table.html.erb +0 -38
- data/app/views/pg_hero/home/query_stats.html.erb +0 -17
- data/app/views/pg_hero/home/system_stats.html.erb +0 -9
@@ -1,38 +0,0 @@
|
|
1
|
-
<table class="table">
|
2
|
-
<thead>
|
3
|
-
<tr>
|
4
|
-
<th style="width: 33.33%;">Total Time</th>
|
5
|
-
<th style="width: 33.33%;">Average Time</th>
|
6
|
-
<th style="width: 33.33%;">Calls</th>
|
7
|
-
</tr>
|
8
|
-
</thead>
|
9
|
-
<tbody>
|
10
|
-
<% queries.each do |query| %>
|
11
|
-
<tr>
|
12
|
-
<td>
|
13
|
-
<%= query["total_minutes"].to_f.round %> min
|
14
|
-
<span class="percent">
|
15
|
-
<% percent = query["total_percent"].to_f %>
|
16
|
-
<% if percent > 1 %>
|
17
|
-
<%= percent.round %>%
|
18
|
-
<% elsif percent > 0.1 %>
|
19
|
-
<%= percent.round(1) %>%
|
20
|
-
<% else %>
|
21
|
-
< 0.1%
|
22
|
-
<% end %>
|
23
|
-
</span>
|
24
|
-
</td>
|
25
|
-
<td><%= query["average_time"].to_f.round %> ms</td>
|
26
|
-
<td><%= number_with_delimiter(query["calls"].to_i) %></td>
|
27
|
-
</tr>
|
28
|
-
<tr>
|
29
|
-
<td colspan="3" style="border-top: none; padding: 0;">
|
30
|
-
<pre><%= query["query"] %></pre>
|
31
|
-
<% if query["query"] == "<insufficient privilege>" %>
|
32
|
-
<p class="text-muted">For security reasons, only superusers can see queries executed by other users.</p>
|
33
|
-
<% end %>
|
34
|
-
</td>
|
35
|
-
</tr>
|
36
|
-
<% end %>
|
37
|
-
</tbody>
|
38
|
-
</table>
|
@@ -1,17 +0,0 @@
|
|
1
|
-
<div class="content">
|
2
|
-
<% if @query_stats_enabled %>
|
3
|
-
<%= button_to "Reset", reset_query_stats_path, class: "btn btn-danger", style: "float: right;" %>
|
4
|
-
<% end %>
|
5
|
-
|
6
|
-
<h1>Queries</h1>
|
7
|
-
|
8
|
-
<% if @query_stats_enabled %>
|
9
|
-
<% if @query_stats.any? %>
|
10
|
-
<%= render partial: "query_stats_table", locals: {queries: @query_stats} %>
|
11
|
-
<% else %>
|
12
|
-
<p>Stats are not available yet. Come back soon!</p>
|
13
|
-
<% end %>
|
14
|
-
<% else %>
|
15
|
-
<p>Query stats are not enabled.</p>
|
16
|
-
<% end %>
|
17
|
-
</div>
|
@@ -1,9 +0,0 @@
|
|
1
|
-
<%= javascript_include_tag "//www.google.com/jsapi", "chartkick" %>
|
2
|
-
|
3
|
-
<div class="content">
|
4
|
-
<h1>CPU Usage</h1>
|
5
|
-
<div style="margin-bottom: 20px;"><%= line_chart @cpu_usage, max: 101, colors: ["#5bc0de"], library: {pointSize: 0, lineWidth: 5} %></div>
|
6
|
-
|
7
|
-
<h1>Connections</h1>
|
8
|
-
<div style="margin-bottom: 20px;"><%= line_chart @connection_stats, colors: ["#5bc0de"], library: {pointSize: 0, lineWidth: 5} %></div>
|
9
|
-
</div>
|