<col width="50%">
</colgroup>
<tr>
- <% queued_containers = Container.order("modified_at asc").filter([["state", "in", ["Queued", "Locked"]], ["priority", ">", 0]]).limit(1) %>
- <% running_containers = Container.order("started_at desc").where(state: "Running").limit(1) %>
- <td><%= queued_containers.items_available %></td>
- <td><%= running_containers.items_available %></td>
+ <td><%= nodes.select {|n| n.crunch_worker_state == "busy" }.size %></td>
+ <td><%= nodes.select {|n| n.crunch_worker_state == "idle" }.size %></td>
</tr>
<tr>
- <th>Pending containers</th>
- <th>Running containers</th>
- </tr>
- <tr>
- <th><%= if queued_containers.first then render_runtime(Time.now - queued_containers.first.modified_at, false, false) else "-" end %></th>
- <th><%= if running_containers.first then render_runtime(Time.now - running_containers.first.started_at, false, false) else "-" end %></th>
- </tr>
- <tr>
- <th>Queue wait</th>
- <th>Last start</th>
+ <th>Busy nodes</th>
+ <th>Idle nodes</th>
</tr>
</table>
-
</div>
--- /dev/null
+<%# Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: AGPL-3.0 %>
+
+<div class="compute-summary-numbers">
+ <table>
+ <colgroup>
+ <col width="50%">
+ <col width="50%">
+ </colgroup>
+ <tr>
+ <% pending_containers = Container.order("modified_at asc").filter([["state", "in", ["Queued", "Locked"]], ["priority", ">", 0]]).limit(1) %>
+ <% running_containers = Container.order("started_at asc").where(state: "Running").limit(1) %>
+ <td><%= pending_containers.items_available %></td>
+ <td><%= running_containers.items_available %></td>
+ </tr>
+ <tr>
+ <th>Pending containers</th>
+ <th>Running containers</th>
+ </tr>
+ <tr>
+ <th><%= if pending_containers.first then render_runtime(Time.now - pending_containers.first.modified_at, false, false) else "-" end %></th>
+ <th><%= if running_containers.first then render_runtime(Time.now - running_containers.first.started_at, false, false) else "-" end %></th>
+ </tr>
+ <tr>
+ <th>Oldest pending</th>
+ <th>Longest running</th>
+ </tr>
+ </table>
+
+</div>
</div>
</div>
</div>
+ <% end %>
+ <% if Container.api_exists?(:index) %>
+ <div class="panel panel-default" style="min-height: 10.5em">
+ <div class="panel-heading"><span class="panel-title">Container status</span></div>
+ <div class="panel-body compute-node-summary-pane">
+ <div>
+ <%= render partial: 'container_summary' %>
+ </div>
+ </div>
+ </div>
<% end %>
<% if Rails.configuration.show_recent_collections_on_dashboard %>
<div class="panel panel-default">