/
index.erb
48 lines (43 loc) · 1.96 KB
/
index.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<% if !@hosts.empty? and @hosts.any?{|h| h.alive? } %>
<div id="overall">
<h2>Overview</h2>
<p class="sub"><em>For all active hosts</em></p>
<div class="stats graph">
<img src="<%= graph_url([@hosts.collect{|h| h.get_hits if h.alive? }.compact.sum, @hosts.collect{|h| h.get_misses if h.alive? }.compact.sum], ["Hits", "Misses"]) %>">
<h3><span class="graph-indicator">Hit</span> / Miss</h3>
<p>The amount of returned caches vs misses, misses usually require your application servers to work harder.</p>
</div>
<div class="stats graph">
<img src="<%= graph_url([@hosts.collect{|h| h.cmd_get if h.alive? }.compact.sum, @hosts.collect{|h| h.cmd_set if h.alive? }.compact.sum], ["Reads", "Writes"]) %>">
<h3><span class="graph-indicator">Read</span> / Write</h3>
<p>More writes than reads can often mean that you’re caching too early, or that you’ve not been monitoring for very long.</p>
</div>
<div class="stats graph">
<img src="<%= graph_url([@hosts.collect{|h| h.bytes if h.alive? }.compact.sum, @hosts.collect{|h| h.limit_maxbytes if h.alive? }.compact.sum], ["Free", "Total"]) %>">
<h3><span class="graph-indicator">Free memory</span> / Used Memory</h3>
<p>The cumulative amount of free memory and total memory across all active hosts.</p>
</div>
</div>
<% end %>
<div id="hosts">
<h2>Hosts</h2>
<a id="new" href="/hosts/new">Add a new host</a>
<% unless @hosts.empty? %>
<ul>
<% for host in @hosts %>
<li<%= " class=\"inactive\"" unless host.alive? %>>
<% if host.alive? %>
<p><a href="/hosts/<%= host.id %>"><%= host.address %></a></p>
<% else %>
<p><%= host.address %></p>
<p class="status">Inactive / Not Responding</p>
<% end %>
<form action="/hosts/<%= host.id %>/destroy" method="post">
<input type="hidden" name="_method" value="delete">
<button>Remove</button>
</form>
</li>
<% end %>
</ul>
<% end %>
</div>