Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 667e3e95962527d8eb47618755d7955a470f6fc4 2 parents 55415e8 + 801fa7b
zhengming authored
4 src/fairy.coffee
@@ -498,8 +498,8 @@ class Queue
498 498 @redis.multi()
499 499 .hdel(@key('PROCESSING'), processing)
500 500 .hincrby(@key('STATISTICS'), 'FINISHED', 1)
501   - .hincrby(@key('STATISTICS'), 'total_pending_time', start_time - task[task.length - 1])
502   - .hincrby(@key('STATISTICS'), 'total_process_time', process_time)
  501 + .hincrby(@key('STATISTICS'), 'TOTAL_PENDING_TIME', start_time - task[task.length - 1])
  502 + .hincrby(@key('STATISTICS'), 'TOTAL_PROCESS_TIME', process_time)
503 503 .lpush(@key('RECENT'), JSON.stringify([task..., finish_time]))
504 504 .ltrim(@key('RECENT'), 0, @recent_size - 1)
505 505 .zadd(@key('SLOWEST'), process_time, JSON.stringify([task..., start_time]))
3  src/web/fairy.coffee
@@ -6,7 +6,7 @@ statistics_template = [
6 6 '<tbody>',
7 7 '<% _.each(data, function(item){ %>',
8 8 '<tr>',
9   - '<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>',
  9 + '<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>',
10 10 '</tr>',
11 11 '<%})%>',
12 12 '</tbody>',
@@ -30,7 +30,6 @@ interval = $("select option:selected").val()
30 30 # 页面加载事件
31 31 $ ->
32 32 $('select').find("option:nth-child(1)").attr("selected","true")
33   - $('#queque_detail').hide()
34 33 render_master()
35 34 events_bind()
36 35
2  src/web/fairy.html
@@ -79,7 +79,7 @@
79 79 <tr><th>Total</td><th><%= statistics.finished_tasks %></td></tr>
80 80 <tr><th>Avg. Waiting In</th><td><%= statistics.average_pending_time %></td></tr>
81 81 <tr><th>Avg. Processing In</th><td><%= statistics.average_process_time %></td></tr>
82   - <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>
  82 + <tr><th>Avg. Finished In</th><td><%= statistics.average_pending_time + statistics.average_process_time%></td></tr>
83 83 </table>
84 84 </script>
85 85

0 comments on commit 667e3e9

Please sign in to comment.
Something went wrong with that request. Please try again.