Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix to future tasks in stats

  • Loading branch information...
commit a0ba0b2b79ac99c999f87ce2a2fa0100d36bd228 1 parent 3a425b2
phlapjack authored
View
4 extras/rails/views/skynet/index.rhtml
@@ -16,7 +16,7 @@
<th>Workers</th>
<th>Active Workers<BR>(Masters / Tasks / Either)</th>
<th>Idle Workers<BR>(Masters / Tasks / Either)</th>
- <th>Untaken Tasks<BR>(Master / Task / Future)</th>
+ <th>Untaken Tasks<BR>(Master / Task) Future</th>
<th>Taken Tasks<BR>(Master / Task)</th>
<th>Results</th>
<th>Processed <br />(by active workers)</th>
@@ -29,7 +29,7 @@
<td class="numeric"><%= @stats[:number_of_workers] %></td>
<td class="numeric"><b><%= @stats[:active_workers] %></b> (<%= @stats[:active_masters] %> / <%= @stats[:active_taskworkers] %> / <%= @stats[:active_master_or_task_workers] %>)</td>
<td class="numeric"><b><%= @stats[:idle_workers] %></b> (<%= @stats[:idle_masters] %> / <%= @stats[:idle_taskworkers] %> / <%= @stats[:idle_master_or_task_workers] %>)</td>
- <td class="numeric"><%= @stats[:untaken_tasks] %> (<b><%= @stats[:untaken_master_tasks] %></b> / <%= @stats[:untaken_task_tasks] %> / <%= @stats[:untaken_future_tasks] %>)</td>
+ <td class="numeric"><%= @stats[:untaken_tasks] %> (<b><%= @stats[:untaken_master_tasks] %></b> / <%= @stats[:untaken_task_tasks] %>) <%= @stats[:untaken_future_tasks] %></td>
<td class="numeric"><b><%= @stats[:taken_tasks] %></b> (<%= @stats[:taken_master_tasks] %> / <%= @stats[:taken_task_tasks] %>)</td>
<td class="numeric"><%= @stats[:results] %></td>
<td class="numeric"><%= @stats[:processed] %> (<%= @stats[:processed_by_active_workers] %>)</td>
View
4 lib/skynet/message_queue_adapters/mysql.rb
@@ -345,8 +345,8 @@ def stats
GROUP BY tasktype, payload_type, iteration
})
stat_rows.each do |row|
- if row["expire_time"].to_i < Time.now.to_i
- stats[:untaken_future_tasks] += 1
+ if row["expire_time"].to_i > Time.now.to_i
+ stats[:untaken_future_tasks] += 1 if row["tasktype"] == "task"
elsif row["tasktype"] == "result" or row["payload_type"] == "result"
stats[:results] += row["number_of_tasks"].to_i
elsif row["tasktype"] == "task"
Please sign in to comment.
Something went wrong with that request. Please try again.