roundhouse-x 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.travis.yml +16 -0
  4. data/3.0-Upgrade.md +70 -0
  5. data/Changes.md +1127 -0
  6. data/Gemfile +27 -0
  7. data/LICENSE +7 -0
  8. data/README.md +52 -0
  9. data/Rakefile +9 -0
  10. data/bin/roundhouse +19 -0
  11. data/bin/roundhousectl +93 -0
  12. data/lib/generators/roundhouse/templates/worker.rb.erb +9 -0
  13. data/lib/generators/roundhouse/templates/worker_spec.rb.erb +6 -0
  14. data/lib/generators/roundhouse/templates/worker_test.rb.erb +8 -0
  15. data/lib/generators/roundhouse/worker_generator.rb +49 -0
  16. data/lib/roundhouse/actor.rb +39 -0
  17. data/lib/roundhouse/api.rb +859 -0
  18. data/lib/roundhouse/cli.rb +396 -0
  19. data/lib/roundhouse/client.rb +210 -0
  20. data/lib/roundhouse/core_ext.rb +105 -0
  21. data/lib/roundhouse/exception_handler.rb +30 -0
  22. data/lib/roundhouse/fetch.rb +154 -0
  23. data/lib/roundhouse/launcher.rb +98 -0
  24. data/lib/roundhouse/logging.rb +104 -0
  25. data/lib/roundhouse/manager.rb +236 -0
  26. data/lib/roundhouse/middleware/chain.rb +149 -0
  27. data/lib/roundhouse/middleware/i18n.rb +41 -0
  28. data/lib/roundhouse/middleware/server/active_record.rb +13 -0
  29. data/lib/roundhouse/middleware/server/logging.rb +40 -0
  30. data/lib/roundhouse/middleware/server/retry_jobs.rb +206 -0
  31. data/lib/roundhouse/monitor.rb +124 -0
  32. data/lib/roundhouse/paginator.rb +42 -0
  33. data/lib/roundhouse/processor.rb +159 -0
  34. data/lib/roundhouse/rails.rb +24 -0
  35. data/lib/roundhouse/redis_connection.rb +77 -0
  36. data/lib/roundhouse/scheduled.rb +115 -0
  37. data/lib/roundhouse/testing/inline.rb +28 -0
  38. data/lib/roundhouse/testing.rb +193 -0
  39. data/lib/roundhouse/util.rb +68 -0
  40. data/lib/roundhouse/version.rb +3 -0
  41. data/lib/roundhouse/web.rb +264 -0
  42. data/lib/roundhouse/web_helpers.rb +249 -0
  43. data/lib/roundhouse/worker.rb +90 -0
  44. data/lib/roundhouse.rb +177 -0
  45. data/roundhouse.gemspec +27 -0
  46. data/test/config.yml +9 -0
  47. data/test/env_based_config.yml +11 -0
  48. data/test/fake_env.rb +0 -0
  49. data/test/fixtures/en.yml +2 -0
  50. data/test/helper.rb +49 -0
  51. data/test/test_api.rb +521 -0
  52. data/test/test_cli.rb +389 -0
  53. data/test/test_client.rb +294 -0
  54. data/test/test_exception_handler.rb +55 -0
  55. data/test/test_fetch.rb +206 -0
  56. data/test/test_logging.rb +34 -0
  57. data/test/test_manager.rb +169 -0
  58. data/test/test_middleware.rb +160 -0
  59. data/test/test_monitor.rb +258 -0
  60. data/test/test_processor.rb +176 -0
  61. data/test/test_rails.rb +23 -0
  62. data/test/test_redis_connection.rb +127 -0
  63. data/test/test_retry.rb +390 -0
  64. data/test/test_roundhouse.rb +87 -0
  65. data/test/test_scheduled.rb +120 -0
  66. data/test/test_scheduling.rb +75 -0
  67. data/test/test_testing.rb +78 -0
  68. data/test/test_testing_fake.rb +240 -0
  69. data/test/test_testing_inline.rb +65 -0
  70. data/test/test_util.rb +18 -0
  71. data/test/test_web.rb +605 -0
  72. data/test/test_web_helpers.rb +52 -0
  73. data/web/assets/images/bootstrap/glyphicons-halflings-white.png +0 -0
  74. data/web/assets/images/bootstrap/glyphicons-halflings.png +0 -0
  75. data/web/assets/images/logo.png +0 -0
  76. data/web/assets/images/status/active.png +0 -0
  77. data/web/assets/images/status/idle.png +0 -0
  78. data/web/assets/images/status-sd8051fd480.png +0 -0
  79. data/web/assets/javascripts/application.js +83 -0
  80. data/web/assets/javascripts/dashboard.js +300 -0
  81. data/web/assets/javascripts/locales/README.md +27 -0
  82. data/web/assets/javascripts/locales/jquery.timeago.ar.js +96 -0
  83. data/web/assets/javascripts/locales/jquery.timeago.bg.js +18 -0
  84. data/web/assets/javascripts/locales/jquery.timeago.bs.js +49 -0
  85. data/web/assets/javascripts/locales/jquery.timeago.ca.js +18 -0
  86. data/web/assets/javascripts/locales/jquery.timeago.cs.js +18 -0
  87. data/web/assets/javascripts/locales/jquery.timeago.cy.js +20 -0
  88. data/web/assets/javascripts/locales/jquery.timeago.da.js +18 -0
  89. data/web/assets/javascripts/locales/jquery.timeago.de.js +18 -0
  90. data/web/assets/javascripts/locales/jquery.timeago.el.js +18 -0
  91. data/web/assets/javascripts/locales/jquery.timeago.en-short.js +20 -0
  92. data/web/assets/javascripts/locales/jquery.timeago.en.js +20 -0
  93. data/web/assets/javascripts/locales/jquery.timeago.es.js +18 -0
  94. data/web/assets/javascripts/locales/jquery.timeago.et.js +18 -0
  95. data/web/assets/javascripts/locales/jquery.timeago.fa.js +22 -0
  96. data/web/assets/javascripts/locales/jquery.timeago.fi.js +28 -0
  97. data/web/assets/javascripts/locales/jquery.timeago.fr-short.js +16 -0
  98. data/web/assets/javascripts/locales/jquery.timeago.fr.js +17 -0
  99. data/web/assets/javascripts/locales/jquery.timeago.he.js +18 -0
  100. data/web/assets/javascripts/locales/jquery.timeago.hr.js +49 -0
  101. data/web/assets/javascripts/locales/jquery.timeago.hu.js +18 -0
  102. data/web/assets/javascripts/locales/jquery.timeago.hy.js +18 -0
  103. data/web/assets/javascripts/locales/jquery.timeago.id.js +18 -0
  104. data/web/assets/javascripts/locales/jquery.timeago.it.js +16 -0
  105. data/web/assets/javascripts/locales/jquery.timeago.ja.js +19 -0
  106. data/web/assets/javascripts/locales/jquery.timeago.ko.js +17 -0
  107. data/web/assets/javascripts/locales/jquery.timeago.lt.js +20 -0
  108. data/web/assets/javascripts/locales/jquery.timeago.mk.js +20 -0
  109. data/web/assets/javascripts/locales/jquery.timeago.nl.js +20 -0
  110. data/web/assets/javascripts/locales/jquery.timeago.no.js +18 -0
  111. data/web/assets/javascripts/locales/jquery.timeago.pl.js +31 -0
  112. data/web/assets/javascripts/locales/jquery.timeago.pt-br.js +16 -0
  113. data/web/assets/javascripts/locales/jquery.timeago.pt.js +16 -0
  114. data/web/assets/javascripts/locales/jquery.timeago.ro.js +18 -0
  115. data/web/assets/javascripts/locales/jquery.timeago.rs.js +49 -0
  116. data/web/assets/javascripts/locales/jquery.timeago.ru.js +34 -0
  117. data/web/assets/javascripts/locales/jquery.timeago.sk.js +18 -0
  118. data/web/assets/javascripts/locales/jquery.timeago.sl.js +44 -0
  119. data/web/assets/javascripts/locales/jquery.timeago.sv.js +18 -0
  120. data/web/assets/javascripts/locales/jquery.timeago.th.js +20 -0
  121. data/web/assets/javascripts/locales/jquery.timeago.tr.js +16 -0
  122. data/web/assets/javascripts/locales/jquery.timeago.uk.js +34 -0
  123. data/web/assets/javascripts/locales/jquery.timeago.uz.js +19 -0
  124. data/web/assets/javascripts/locales/jquery.timeago.zh-cn.js +20 -0
  125. data/web/assets/javascripts/locales/jquery.timeago.zh-tw.js +20 -0
  126. data/web/assets/stylesheets/application.css +746 -0
  127. data/web/assets/stylesheets/bootstrap.css +9 -0
  128. data/web/locales/cs.yml +68 -0
  129. data/web/locales/da.yml +68 -0
  130. data/web/locales/de.yml +69 -0
  131. data/web/locales/el.yml +68 -0
  132. data/web/locales/en.yml +77 -0
  133. data/web/locales/es.yml +69 -0
  134. data/web/locales/fr.yml +69 -0
  135. data/web/locales/hi.yml +75 -0
  136. data/web/locales/it.yml +69 -0
  137. data/web/locales/ja.yml +69 -0
  138. data/web/locales/ko.yml +68 -0
  139. data/web/locales/nl.yml +68 -0
  140. data/web/locales/no.yml +69 -0
  141. data/web/locales/pl.yml +59 -0
  142. data/web/locales/pt-br.yml +68 -0
  143. data/web/locales/pt.yml +67 -0
  144. data/web/locales/ru.yml +75 -0
  145. data/web/locales/sv.yml +68 -0
  146. data/web/locales/ta.yml +75 -0
  147. data/web/locales/zh-cn.yml +68 -0
  148. data/web/locales/zh-tw.yml +68 -0
  149. data/web/views/_footer.erb +22 -0
  150. data/web/views/_job_info.erb +84 -0
  151. data/web/views/_nav.erb +66 -0
  152. data/web/views/_paging.erb +23 -0
  153. data/web/views/_poll_js.erb +5 -0
  154. data/web/views/_poll_link.erb +7 -0
  155. data/web/views/_status.erb +4 -0
  156. data/web/views/_summary.erb +40 -0
  157. data/web/views/busy.erb +90 -0
  158. data/web/views/dashboard.erb +75 -0
  159. data/web/views/dead.erb +34 -0
  160. data/web/views/layout.erb +31 -0
  161. data/web/views/morgue.erb +71 -0
  162. data/web/views/queue.erb +45 -0
  163. data/web/views/queues.erb +27 -0
  164. data/web/views/retries.erb +74 -0
  165. data/web/views/retry.erb +34 -0
  166. data/web/views/scheduled.erb +54 -0
  167. data/web/views/scheduled_job_info.erb +8 -0
  168. metadata +404 -0
@@ -0,0 +1,40 @@
1
+ <ul class="list-unstyled summary row">
2
+ <li class="processed col-sm-1">
3
+ <span class="count"><%= number_with_delimiter(stats.processed) %></span>
4
+ <span class="desc"><%= t('Processed') %></span>
5
+ </li>
6
+ <li class="failed col-sm-1">
7
+ <span class="count"><%= number_with_delimiter(stats.failed) %></span>
8
+ <span class="desc"><%= t('Failed') %></span>
9
+ </li>
10
+ <li class="busy col-sm-1">
11
+ <a href="<%= root_path %>busy">
12
+ <span class="count"><%= number_with_delimiter(workers.size) %></span>
13
+ <span class="desc"><%= t('Busy') %></span>
14
+ </a>
15
+ </li>
16
+ <li class="enqueued col-sm-1">
17
+ <a href="<%= root_path %>queues">
18
+ <span class="count"><%= number_with_delimiter(stats.enqueued) %></span>
19
+ <span class="desc"><%= t('Enqueued') %></span>
20
+ </a>
21
+ </li>
22
+ <li class="retries col-sm-1">
23
+ <a href="<%= root_path %>retries">
24
+ <span class="count"><%= number_with_delimiter(stats.retry_size) %></span>
25
+ <span class="desc"><%= t('Retries') %></span>
26
+ </a>
27
+ </li>
28
+ <li class="scheduled col-sm-1">
29
+ <a href="<%= root_path %>scheduled">
30
+ <span class="count"><%= number_with_delimiter(stats.scheduled_size) %></span>
31
+ <span class="desc"><%= t('Scheduled') %></span>
32
+ </a>
33
+ </li>
34
+ <li class="dead col-sm-1">
35
+ <a href="<%= root_path %>morgue">
36
+ <span class="count"><%= number_with_delimiter(stats.dead_size) %></span>
37
+ <span class="desc"><%= t('Dead') %></span>
38
+ </a>
39
+ </li>
40
+ </ul>
@@ -0,0 +1,90 @@
1
+ <div class="row header">
2
+ <div class="col-sm-8 pull-left">
3
+ <h3><%= t('Processes') %></h3>
4
+ </div>
5
+ <div class="col-sm-4 pull-right">
6
+ <form method="POST" style="margin-top: 20px; margin-bottom: 10px;">
7
+ <%= csrf_tag %>
8
+ <div class="btn-group pull-right">
9
+ <button class="btn btn-warn" type="submit" name="quiet" value="1"><%= t('QuietAll') %></button>
10
+ <button class="btn btn-danger" type="submit" name="stop" value="1"><%= t('StopAll') %></button>
11
+ </div>
12
+ </form>
13
+ </div>
14
+ </div>
15
+ </div>
16
+
17
+ <div class="table_container">
18
+ <table class="processes table table-hover table-bordered table-striped table-white">
19
+ <thead>
20
+ <th><%= t('Name') %></th>
21
+ <th><%= t('Started') %></th>
22
+ <th><%= t('Threads') %></th>
23
+ <th><%= t('Busy') %></th>
24
+ <th>&nbsp;</th>
25
+ </thead>
26
+ <% processes.each do |process| %>
27
+ <tr>
28
+ <td width="50%">
29
+ <%= "#{process['hostname']}:#{process['pid']}" %>
30
+ <span class="label label-success"><%= process.tag %></span>
31
+ <% process.labels.each do |label| %>
32
+ <span class="label label-info"><%= label %></span>
33
+ <% end %>
34
+ <br>
35
+ <b><%= "#{t('Queues')}: " %></b>
36
+ <%= process['queues'] * ", " %>
37
+ </td>
38
+ <td><%= relative_time(Time.at(process['started_at'])) %></td>
39
+ <td><%= process['concurrency'] %></td>
40
+ <td><%= process['busy'] %></td>
41
+ <td>
42
+ <div class="btn-group pull-right">
43
+ <form method="POST">
44
+ <%= csrf_tag %>
45
+ <input type="hidden" name="identity" value="<%= process['identity'] %>"/>
46
+ <button class="btn btn-warn" type="submit" name="quiet" value="1"><%= t('Quiet') %></button>
47
+ <button class="btn btn-danger" type="submit" name="stop" value="1"><%= t('Stop') %></button>
48
+ </form>
49
+ </div>
50
+ </td>
51
+ </tr>
52
+ <% end %>
53
+ </table>
54
+ </div>
55
+
56
+ <div class="row header">
57
+ <div class="col-sm-7">
58
+ <h3><%= t('Jobs') %></h3>
59
+ </div>
60
+ </div>
61
+
62
+ <div class="table_container">
63
+ <table class="workers table table-hover table-bordered table-striped table-white">
64
+ <thead>
65
+ <th><%= t('Process') %></th>
66
+ <th><%= t('TID') %></th>
67
+ <th><%= t('JID') %></th>
68
+ <th><%= t('Queue') %></th>
69
+ <th><%= t('Job') %></th>
70
+ <th><%= t('Arguments') %></th>
71
+ <th><%= t('Started') %></th>
72
+ </thead>
73
+ <% workers.each do |process, thread, msg| %>
74
+ <% job = Roundhouse::Job.new(msg['payload']) %>
75
+ <tr>
76
+ <td><%= process %></td>
77
+ <td><%= thread %></td>
78
+ <td><%= job.jid %></td>
79
+ <td>
80
+ <a href="<%= root_path %>queues/<%= msg['queue'] %>"><%= msg['queue'] %></a>
81
+ </td>
82
+ <td><%= job.display_class %></td>
83
+ <td>
84
+ <div class="args"><%= display_args(job.display_args) %></div>
85
+ </td>
86
+ <td><%= relative_time(Time.at(msg['run_at'])) %></td>
87
+ </tr>
88
+ <% end %>
89
+ </table>
90
+ </div>
@@ -0,0 +1,75 @@
1
+ <script type="text/javascript" src="<%= root_path %>javascripts/dashboard.js"></script>
2
+ <div class= "dashboard clearfix">
3
+ <h3 >
4
+ <%= t('Dashboard') %>
5
+ <span class="beacon">
6
+ <span class="ring"></span>
7
+ <span class="dot"></span>
8
+ </span>
9
+ </h3>
10
+ <div class="interval-slider">
11
+ <span class="interval-slider-label"><%= t('PollingInterval') %>:</span>
12
+ <span class="current-interval">2 sec</span>
13
+ <br/>
14
+ <input type="range" min="2000" max="20000" step="1000" value="2000"/>
15
+ </div>
16
+ </div>
17
+
18
+ <div class="row chart">
19
+ <div id="realtime" data-processed-label="<%= t('Processed') %>" data-failed-label="<%= t('Failed') %>"></div>
20
+ <div id="realtime-legend"></div>
21
+ </div>
22
+
23
+ <div class="row chart">
24
+ <h5>
25
+ <span class="history-heading"><%= t('History') %></span>
26
+ <a href="<%= root_path %>?days=7" class="history-graph <%= "active" if params[:days] == "7" %>"><%= t('OneWeek') %></a>
27
+ <a href="<%= root_path %>" class="history-graph <%= "active" if params[:days].nil? || params[:days] == "30" %>"><%= t('OneMonth') %></a>
28
+ <a href="<%= root_path %>?days=90" class="history-graph <%= "active" if params[:days] == "90" %>"><%= t('ThreeMonths') %></a>
29
+ <a href="<%= root_path %>?days=180" class="history-graph <%= "active" if params[:days] == "180" %>"><%= t('SixMonths') %></a>
30
+ </h5>
31
+
32
+ <div id="history" data-processed-label="<%= t('Processed') %>" data-failed-label="<%= t('Failed') %>" data-processed="<%= h Roundhouse.dump_json(@processed_history) %>" data-failed="<%= h Roundhouse.dump_json(@failed_history) %>" data-update-url="<%= root_path %>stats"></div>
33
+ <div id="history-legend"></div>
34
+ </div>
35
+
36
+ <br/>
37
+ <h5>Redis</h5>
38
+ <div class="redis-wrapper">
39
+ <div class="stats-container">
40
+ <% if @redis_info.fetch("redis_version", nil) %>
41
+ <div class="stat">
42
+ <h3 class="redis_version"><%= @redis_info.fetch("redis_version") %></h3>
43
+ <p><%= t('Version') %></p>
44
+ </div>
45
+ <% end %>
46
+
47
+ <% if @redis_info.fetch("uptime_in_days", nil) %>
48
+ <div class="stat">
49
+ <h3 class="uptime_in_days"><%= @redis_info.fetch("uptime_in_days") %></h3>
50
+ <p><%= t('Uptime') %></p>
51
+ </div>
52
+ <% end %>
53
+
54
+ <% if @redis_info.fetch("connected_clients", nil) %>
55
+ <div class="stat">
56
+ <h3 class="connected_clients"><%= @redis_info.fetch("connected_clients") %></h3>
57
+ <p><%= t('Connections') %></p>
58
+ </div>
59
+ <% end %>
60
+
61
+ <% if @redis_info.fetch("used_memory_human", nil) %>
62
+ <div class="stat">
63
+ <h3 class="used_memory_human"><%= @redis_info.fetch("used_memory_human") %></h3>
64
+ <p><%= t('MemoryUsage') %></p>
65
+ </div>
66
+ <% end %>
67
+
68
+ <% if @redis_info.fetch("used_memory_peak_human", nil) %>
69
+ <div class="stat">
70
+ <h3 class="used_memory_peak_human"><%= @redis_info.fetch("used_memory_peak_human") %></h3>
71
+ <p><%= t('PeakMemoryUsage') %></p>
72
+ </div>
73
+ <% end %>
74
+ </div>
75
+ </div>
@@ -0,0 +1,34 @@
1
+ <%= erb :_job_info, :locals => {:job => @dead, :type => :dead} %>
2
+
3
+ <h3><%= t('Error') %></h3>
4
+ <div class="table_container">
5
+ <table class="error table table-bordered table-striped">
6
+ <tbody>
7
+ <tr>
8
+ <th><%= t('ErrorClass') %></th>
9
+ <td>
10
+ <code><%= @dead['error_class'] %></code>
11
+ </td>
12
+ </tr>
13
+ <tr>
14
+ <th><%= t('ErrorMessage') %></th>
15
+ <td><%= h(@dead['error_message']) %></td>
16
+ </tr>
17
+ <% if !@dead['error_backtrace'].nil? %>
18
+ <tr>
19
+ <th><%= t('ErrorBacktrace') %></th>
20
+ <td>
21
+ <code><%= @dead['error_backtrace'].join("<br/>") %></code>
22
+ </td>
23
+ </tr>
24
+ <% end %>
25
+ </tbody>
26
+ </table>
27
+ </div>
28
+
29
+ <form class="form-horizontal" action="<%= root_path %>morgue/<%= job_params(@dead, @dead.score) %>" method="post">
30
+ <%= csrf_tag %>
31
+ <a class="btn btn-default" href="<%= root_path %>morgue"><%= t('GoBack') %></a>
32
+ <input class="btn btn-primary" type="submit" name="retry" value="<%= t('RetryNow') %>" />
33
+ <input class="btn btn-danger" type="submit" name="delete" value="<%= t('Delete') %>" />
34
+ </form>
@@ -0,0 +1,31 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <title><%= environment_title_prefix %><%= Roundhouse::NAME %></title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1.0" />
6
+ <link href="<%= root_path %>stylesheets/bootstrap.css" media="screen" rel="stylesheet" type="text/css" />
7
+ <link href="<%= root_path %>stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
8
+ <script type="text/javascript" src="<%= root_path %>javascripts/application.js"></script>
9
+ <script type="text/javascript" src="<%= root_path %>javascripts/locales/jquery.timeago.<%= locale %>.js"></script>
10
+ <meta name="google" content="notranslate" />
11
+ <%= display_custom_head %>
12
+ </head>
13
+ <body class="admin">
14
+ <%= erb :_nav %>
15
+ <div id="page">
16
+ <div class="container">
17
+ <div class="row">
18
+ <div class="col-sm-12 summary_bar">
19
+ <%= erb :_summary %>
20
+ </div>
21
+
22
+ <div class="col-sm-12">
23
+ <%= yield %>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ <%= erb :_footer %>
29
+ <%= erb :_poll_js %>
30
+ </body>
31
+ </html>
@@ -0,0 +1,71 @@
1
+ <header class="row">
2
+ <div class="col-sm-5">
3
+ <h3><%= t('DeadJobs') %></h3>
4
+ </div>
5
+ <% if @dead.size > 0 && @total_size > @count %>
6
+ <div class="col-sm-4">
7
+ <%= erb :_paging, :locals => { :url => "#{root_path}morgue" } %>
8
+ </div>
9
+ <% end %>
10
+ <%= filtering('dead') %>
11
+ </header>
12
+
13
+ <% if @dead.size > 0 %>
14
+ <form action="<%= root_path %>morgue" method="post">
15
+ <%= csrf_tag %>
16
+ <div class="table_container">
17
+ <table class="table table-striped table-bordered table-white">
18
+ <thead>
19
+ <tr>
20
+ <th width="20px" class="table-checkbox">
21
+ <label>
22
+ <input type="checkbox" class="check_all" />
23
+ </label>
24
+ </th>
25
+ <th><%= t('LastRetry') %></th>
26
+ <th><%= t('Queue') %></th>
27
+ <th><%= t('Job') %></th>
28
+ <th><%= t('Arguments') %></th>
29
+ <th><%= t('Error') %></th>
30
+ </tr>
31
+ </thead>
32
+ <% @dead.each do |entry| %>
33
+ <tr>
34
+ <td class="table-checkbox">
35
+ <label>
36
+ <input type='checkbox' name='key[]' value='<%= job_params(entry.item, entry.score) %>' />
37
+ </label>
38
+ </td>
39
+ <td>
40
+ <a href="<%= root_path %>morgue/<%= job_params(entry.item, entry.score) %>"><%= relative_time(entry.at) %></a>
41
+ </td>
42
+ <td>
43
+ <a href="<%= root_path %>queues/<%= entry.queue_id %>"><%= entry.queue_id %></a>
44
+ </td>
45
+ <td><%= entry.display_class %></td>
46
+ <td>
47
+ <div class="args"><%= display_args(entry.display_args) %></div>
48
+ </td>
49
+ <td>
50
+ <div><%= h truncate("#{entry['error_class']}: #{entry['error_message']}", 200) %></div>
51
+ </td>
52
+ </tr>
53
+ <% end %>
54
+ </table>
55
+ </div>
56
+ <input class="btn btn-primary btn-xs pull-left" type="submit" name="retry" value="<%= t('RetryNow') %>" />
57
+ <input class="btn btn-danger btn-xs pull-left" type="submit" name="delete" value="<%= t('Delete') %>" />
58
+ </form>
59
+
60
+ <form action="<%= root_path %>morgue/all/delete" method="post">
61
+ <%= csrf_tag %>
62
+ <input class="btn btn-danger btn-xs pull-right" type="submit" name="delete" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" />
63
+ </form>
64
+ <form action="<%= root_path %>morgue/all/retry" method="post">
65
+ <%= csrf_tag %>
66
+ <input class="btn btn-danger btn-xs pull-right" type="submit" name="retry" value="<%= t('RetryAll') %>" data-confirm="<%= t('AreYouSure') %>" />
67
+ </form>
68
+
69
+ <% else %>
70
+ <div class="alert alert-success"><%= t('NoDeadJobsFound') %></div>
71
+ <% end %>
@@ -0,0 +1,45 @@
1
+ <header class="row">
2
+ <div class="col-sm-5">
3
+ <h3>
4
+ <%= t('CurrentMessagesInQueue', :queue => h(@name)) %>
5
+ <% if @queue.paused? %>
6
+ <span class="label label-danger"><%= t('Paused') %></span>
7
+ <% end %>
8
+ </h3>
9
+ </div>
10
+ <div class="col-sm-4 pull-right">
11
+ <%= erb :_paging, :locals => { :url => "#{root_path}queues/#{@name}" } %>
12
+ </div>
13
+ </header>
14
+ <div class="table_container">
15
+ <table class="queue table table-hover table-bordered table-striped">
16
+ <thead>
17
+ <th><%= t('Job') %></th>
18
+ <th><%= t('Arguments') %></th>
19
+ <th></th>
20
+ </thead>
21
+ <% @messages.each_with_index do |msg, index| %>
22
+ <tr>
23
+ <td><%= h(msg.display_class) %></td>
24
+ <td>
25
+ <% a = msg.display_args.inspect %>
26
+ <% if a.size > 100 %>
27
+ <%= h(msg.display_args.inspect[0..100]) + "... " %>
28
+ <button data-toggle="collapse" data-target="#worker_<%= index %>" class="btn btn-default btn-xs"><%= t('ShowAll') %></button>
29
+ <div class="toggle" id="worker_<%= index %>" style="display: none;"><%= h(msg.display_args) %></div>
30
+ <% else %>
31
+ <%= h(msg.display_args) %>
32
+ <% end %>
33
+ </td>
34
+ <td>
35
+ <form action="<%= root_path %>queues/<%= @name %>/delete" method="post">
36
+ <%= csrf_tag %>
37
+ <input name="key_val" value="<%= h Roundhouse.dump_json(msg.item) %>" type="hidden" />
38
+ <input class="btn btn-danger btn-xs" type="submit" name="delete" value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSure') %>" />
39
+ </form>
40
+ </td>
41
+ </tr>
42
+ <% end %>
43
+ </table>
44
+ </div>
45
+ <%= erb :_paging, :locals => { :url => "#{root_path}queues/#{@name}" } %>
@@ -0,0 +1,27 @@
1
+ <h3><%= t('Queues') %></h3>
2
+
3
+ <div class="table_container">
4
+ <table class="queues table table-hover table-bordered table-striped table-white">
5
+ <thead>
6
+ <th><%= t('Queue') %></th>
7
+ <th><%= t('Size') %></th>
8
+ <th><%= t('Actions') %></th>
9
+ </thead>
10
+ <% @queues.each do |queue| %>
11
+ <tr>
12
+ <td>
13
+ <a href="<%= root_path %>queues/<%= queue.queue_id %>"><%= queue.queue_id %></a>
14
+ <span class="label">Status: <%= queue.status %></span>
15
+ <span class="label">Latency: <%= queue.latency %></span>
16
+ </td>
17
+ <td><%= number_with_delimiter(queue.size) %> </td>
18
+ <td width="20%">
19
+ <form action="<%=root_path %>queues/<%= queue.queue_id %>" method="post">
20
+ <%= csrf_tag %>
21
+ <input class="btn btn-danger btn-xs" type="submit" name="delete" value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSureDeleteQueue', :queue => h(queue.queue_id)) %>" />
22
+ </form>
23
+ </td>
24
+ </tr>
25
+ <% end %>
26
+ </table>
27
+ </div>
@@ -0,0 +1,74 @@
1
+ <header class="row">
2
+ <div class="col-sm-5">
3
+ <h3><%= t('Retries') %></h3>
4
+ </div>
5
+ <% if @retries.size > 0 && @total_size > @count %>
6
+ <div class="col-sm-4">
7
+ <%= erb :_paging, :locals => { :url => "#{root_path}retries" } %>
8
+ </div>
9
+ <% end %>
10
+ <%= filtering('retries') %>
11
+ </header>
12
+
13
+ <% if @retries.size > 0 %>
14
+ <form action="<%= root_path %>retries" method="post">
15
+ <%= csrf_tag %>
16
+ <div class="table_container">
17
+ <table class="table table-striped table-bordered table-white">
18
+ <thead>
19
+ <tr>
20
+ <th width="20px" class="table-checkbox">
21
+ <label>
22
+ <input type="checkbox" class="check_all" />
23
+ </label>
24
+ </th>
25
+ <th><%= t('NextRetry') %></th>
26
+ <th><%= t('RetryCount') %></th>
27
+ <th><%= t('Queue') %></th>
28
+ <th><%= t('Job') %></th>
29
+ <th><%= t('Arguments') %></th>
30
+ <th><%= t('Error') %></th>
31
+ </tr>
32
+ </thead>
33
+ <% @retries.each do |entry| %>
34
+ <tr>
35
+ <td class="table-checkbox">
36
+ <label>
37
+ <input type='checkbox' name='key[]' value='<%= job_params(entry.item, entry.score) %>' />
38
+ </label>
39
+ </td>
40
+ <td>
41
+ <a href="<%= root_path %>retries/<%= job_params(entry.item, entry.score) %>"><%= relative_time(entry.at) %></a>
42
+ </td>
43
+ <td><%= entry['retry_count'] %></td>
44
+ <td>
45
+ <a href="<%= root_path %>queues/<%= entry.queue_id %>"><%= entry.queue_id %></a>
46
+ </td>
47
+ <td><%= entry.display_class %></td>
48
+ <td>
49
+ <div class="args"><%= display_args(entry.display_args) %></div>
50
+ </td>
51
+ <td>
52
+ <div><%= h truncate("#{entry['error_class']}: #{entry['error_message']}", 200) %></div>
53
+ </td>
54
+ </tr>
55
+ <% end %>
56
+ </table>
57
+ </div>
58
+ <input class="btn btn-primary btn-xs pull-left" type="submit" name="retry" value="<%= t('RetryNow') %>" />
59
+ <input class="btn btn-danger btn-xs pull-left" type="submit" name="delete" value="<%= t('Delete') %>" />
60
+ <input class="btn btn-danger btn-xs pull-left" type="submit" name="kill" value="<%= t('Kill') %>" />
61
+ </form>
62
+
63
+ <form action="<%= root_path %>retries/all/delete" method="post">
64
+ <%= csrf_tag %>
65
+ <input class="btn btn-danger btn-xs pull-right" type="submit" name="delete" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" />
66
+ </form>
67
+ <form action="<%= root_path %>retries/all/retry" method="post">
68
+ <%= csrf_tag %>
69
+ <input class="btn btn-danger btn-xs pull-right" type="submit" name="retry" value="<%= t('RetryAll') %>" data-confirm="<%= t('AreYouSure') %>" />
70
+ </form>
71
+
72
+ <% else %>
73
+ <div class="alert alert-success"><%= t('NoRetriesFound') %></div>
74
+ <% end %>
@@ -0,0 +1,34 @@
1
+ <%= erb :_job_info, :locals => {:job => @retry, :type => :retry} %>
2
+
3
+ <h3><%= t('Error') %></h3>
4
+ <div class="table_container">
5
+ <table class="error table table-bordered table-striped">
6
+ <tbody>
7
+ <tr>
8
+ <th><%= t('ErrorClass') %></th>
9
+ <td>
10
+ <code><%= @retry['error_class'] %></code>
11
+ </td>
12
+ </tr>
13
+ <tr>
14
+ <th><%= t('ErrorMessage') %></th>
15
+ <td><%= h(@retry['error_message']) %></td>
16
+ </tr>
17
+ <% if !@retry['error_backtrace'].nil? %>
18
+ <tr>
19
+ <th><%= t('ErrorBacktrace') %></th>
20
+ <td>
21
+ <code><%= @retry['error_backtrace'].join("<br/>") %></code>
22
+ </td>
23
+ </tr>
24
+ <% end %>
25
+ </tbody>
26
+ </table>
27
+ </div>
28
+
29
+ <form class="form-horizontal" action="<%= root_path %>retries/<%= job_params(@retry, @retry.score) %>" method="post">
30
+ <%= csrf_tag %>
31
+ <a class="btn btn-default" href="<%= root_path %>retries"><%= t('GoBack') %></a>
32
+ <input class="btn btn-primary" type="submit" name="retry" value="<%= t('RetryNow') %>" />
33
+ <input class="btn btn-danger" type="submit" name="delete" value="<%= t('Delete') %>" />
34
+ </form>
@@ -0,0 +1,54 @@
1
+ <header class="row">
2
+ <div class="col-sm-5">
3
+ <h3><%= t('ScheduledJobs') %></h3>
4
+ </div>
5
+ <% if @scheduled.size > 0 && @total_size > @count %>
6
+ <div class="col-sm-4">
7
+ <%= erb :_paging, :locals => { :url => "#{root_path}scheduled" } %>
8
+ </div>
9
+ <% end %>
10
+ <%= filtering('scheduled') %>
11
+ </header>
12
+
13
+ <% if @scheduled.size > 0 %>
14
+
15
+ <form action="<%= root_path %>scheduled" method="post">
16
+ <%= csrf_tag %>
17
+ <div class="table_container">
18
+ <table class="table table-striped table-bordered table-white">
19
+ <thead>
20
+ <tr>
21
+ <th width="20px">
22
+ <input type="checkbox" class="check_all" />
23
+ </th>
24
+ <th><%= t('When') %></th>
25
+ <th><%= t('Queue') %></th>
26
+ <th><%= t('Job') %></th>
27
+ <th><%= t('Arguments') %></th>
28
+ </tr>
29
+ </thead>
30
+ <% @scheduled.each do |entry| %>
31
+ <tr>
32
+ <td>
33
+ <input type='checkbox' name='key[]' value='<%= job_params(entry.item, entry.score) %>' />
34
+ </td>
35
+ <td>
36
+ <a href="<%= root_path %>scheduled/<%= job_params(entry.item, entry.score) %>"><%= relative_time(entry.at) %></a>
37
+ </td>
38
+ <td>
39
+ <a href="<%= root_path %>queues/<%= entry.queue_id %>"><%= entry.queue_id %></a>
40
+ </td>
41
+ <td><%= entry.display_class %></td>
42
+ <td>
43
+ <div class="args"><%= display_args(entry.display_args) %></div>
44
+ </td>
45
+ </tr>
46
+ <% end %>
47
+ </table>
48
+ </div>
49
+ <input class="btn btn-danger pull-right" type="submit" name="delete" value="<%= t('Delete') %>" />
50
+ <input class="btn btn-danger pull-right" type="submit" name="add_to_queue" value="<%= t('AddToQueue') %>" />
51
+ </form>
52
+ <% else %>
53
+ <div class="alert alert-success"><%= t('NoScheduledFound') %></div>
54
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <%= erb :_job_info, :locals => {:job => @job, :type => :scheduled} %>
2
+
3
+ <form class="form-horizontal" action="<%= root_path %>scheduled/<%= job_params(@job, @job.score) %>" method="post">
4
+ <%= csrf_tag %>
5
+ <a class="btn btn-default" href="<%= root_path %>scheduled"><%= t('GoBack') %></a>
6
+ <input class="btn btn-primary" type="submit" name="add_to_queue" value="<%= t('AddToQueue') %>" />
7
+ <input class="btn btn-danger" type="submit" name="delete" value="<%= t('Delete') %>" />
8
+ </form>