Permalink
Browse files

Merge branch 'master' of github.com:baoshan/fairy

  • Loading branch information...
2 parents 55415e8 + 801fa7b commit 667e3e95962527d8eb47618755d7955a470f6fc4 zhengming committed May 30, 2012
Showing with 4 additions and 5 deletions.
  1. +2 −2 src/fairy.coffee
  2. +1 −2 src/web/fairy.coffee
  3. +1 −1 src/web/fairy.html
View
4 src/fairy.coffee
@@ -498,8 +498,8 @@ class Queue
@redis.multi()
.hdel(@key('PROCESSING'), processing)
.hincrby(@key('STATISTICS'), 'FINISHED', 1)
- .hincrby(@key('STATISTICS'), 'total_pending_time', start_time - task[task.length - 1])
- .hincrby(@key('STATISTICS'), 'total_process_time', process_time)
+ .hincrby(@key('STATISTICS'), 'TOTAL_PENDING_TIME', start_time - task[task.length - 1])
+ .hincrby(@key('STATISTICS'), 'TOTAL_PROCESS_TIME', process_time)
.lpush(@key('RECENT'), JSON.stringify([task..., finish_time]))
.ltrim(@key('RECENT'), 0, @recent_size - 1)
.zadd(@key('SLOWEST'), process_time, JSON.stringify([task..., start_time]))
View
3 src/web/fairy.coffee
@@ -6,7 +6,7 @@ statistics_template = [
'<tbody>',
'<% _.each(data, function(item){ %>',
'<tr>',
- '<td><%= item.name %></td><td><%= item.workers%></td><td><%= item.average_pending_time%></td><td><span><%= item.total.tasks%></span><span>/</span><span><%= item.total.groups%><span></td><td><%= item.finished_tasks%></td><td><%= item.processing_tasks%></td><td><%= item.pending_tasks%></td><td><%= item.failed_tasks%></td><td><span><%= item.blocked.tasks%></span><span>/</span><span><%= item.blocked.groups%><span></td><td><button class="btn_reschedule">Schedule</button></td><td><button class="btn_clear">Clear</button></td>',
+ '<td><%= item.name %></td><td><%= item.workers%></td><td><%= item.average_pending_time + item.average_process_time%></td><td><span><%= item.total.tasks%></span><span>/</span><span><%= item.total.groups%><span></td><td><%= item.finished_tasks%></td><td><%= item.processing_tasks%></td><td><%= item.pending_tasks%></td><td><%= item.failed_tasks%></td><td><span><%= item.blocked.tasks%></span><span>/</span><span><%= item.blocked.groups%><span></td><td><button class="btn_reschedule">Schedule</button></td><td><button class="btn_clear">Clear</button></td>',
'</tr>',
'<%})%>',
'</tbody>',
@@ -30,7 +30,6 @@ interval = $("select option:selected").val()
# 页面加载事件
$ ->
$('select').find("option:nth-child(1)").attr("selected","true")
- $('#queque_detail').hide()
render_master()
events_bind()
View
2 src/web/fairy.html
@@ -79,7 +79,7 @@
<tr><th>Total</td><th><%= statistics.finished_tasks %></td></tr>
<tr><th>Avg. Waiting In</th><td><%= statistics.average_pending_time %></td></tr>
<tr><th>Avg. Processing In</th><td><%= statistics.average_process_time %></td></tr>
- <tr><th>Avg. Finished In</th><td><%= (Number(statistics.average_pending_time)+Number(statistics.average_process_time))?(Number(statistics.average_pending_time)+Number(statistics.average_process_time)).toFixed(2):'-'%></td></tr>
+ <tr><th>Avg. Finished In</th><td><%= statistics.average_pending_time + statistics.average_process_time%></td></tr>
</table>
</script>

0 comments on commit 667e3e9

Please sign in to comment.