sidekiq 2.15.1 → 4.2.10
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sidekiq might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/.github/contributing.md +32 -0
- data/.github/issue_template.md +9 -0
- data/.gitignore +1 -0
- data/.travis.yml +16 -17
- data/3.0-Upgrade.md +70 -0
- data/4.0-Upgrade.md +53 -0
- data/COMM-LICENSE +56 -44
- data/Changes.md +644 -1
- data/Ent-Changes.md +173 -0
- data/Gemfile +27 -0
- data/LICENSE +1 -1
- data/Pro-2.0-Upgrade.md +138 -0
- data/Pro-3.0-Upgrade.md +44 -0
- data/Pro-Changes.md +457 -3
- data/README.md +46 -29
- data/Rakefile +6 -3
- data/bin/sidekiq +4 -0
- data/bin/sidekiqctl +41 -20
- data/bin/sidekiqload +154 -0
- data/code_of_conduct.md +50 -0
- data/lib/generators/sidekiq/templates/worker.rb.erb +9 -0
- data/lib/generators/sidekiq/templates/worker_spec.rb.erb +6 -0
- data/lib/generators/sidekiq/templates/worker_test.rb.erb +8 -0
- data/lib/generators/sidekiq/worker_generator.rb +49 -0
- data/lib/sidekiq.rb +141 -29
- data/lib/sidekiq/api.rb +540 -106
- data/lib/sidekiq/cli.rb +131 -71
- data/lib/sidekiq/client.rb +168 -96
- data/lib/sidekiq/core_ext.rb +36 -8
- data/lib/sidekiq/exception_handler.rb +20 -28
- data/lib/sidekiq/extensions/action_mailer.rb +25 -5
- data/lib/sidekiq/extensions/active_record.rb +8 -4
- data/lib/sidekiq/extensions/class_methods.rb +9 -5
- data/lib/sidekiq/extensions/generic_proxy.rb +1 -0
- data/lib/sidekiq/fetch.rb +45 -101
- data/lib/sidekiq/launcher.rb +144 -30
- data/lib/sidekiq/logging.rb +69 -12
- data/lib/sidekiq/manager.rb +90 -140
- data/lib/sidekiq/middleware/chain.rb +18 -5
- data/lib/sidekiq/middleware/i18n.rb +9 -2
- data/lib/sidekiq/middleware/server/active_record.rb +1 -1
- data/lib/sidekiq/middleware/server/logging.rb +11 -11
- data/lib/sidekiq/middleware/server/retry_jobs.rb +98 -44
- data/lib/sidekiq/paginator.rb +20 -8
- data/lib/sidekiq/processor.rb +157 -96
- data/lib/sidekiq/rails.rb +109 -5
- data/lib/sidekiq/redis_connection.rb +70 -24
- data/lib/sidekiq/scheduled.rb +122 -50
- data/lib/sidekiq/testing.rb +171 -31
- data/lib/sidekiq/testing/inline.rb +1 -0
- data/lib/sidekiq/util.rb +31 -5
- data/lib/sidekiq/version.rb +2 -1
- data/lib/sidekiq/web.rb +136 -263
- data/lib/sidekiq/web/action.rb +93 -0
- data/lib/sidekiq/web/application.rb +336 -0
- data/lib/sidekiq/web/helpers.rb +278 -0
- data/lib/sidekiq/web/router.rb +100 -0
- data/lib/sidekiq/worker.rb +40 -7
- data/sidekiq.gemspec +18 -14
- data/web/assets/images/favicon.ico +0 -0
- data/web/assets/images/{status-sd8051fd480.png → status.png} +0 -0
- data/web/assets/javascripts/application.js +67 -19
- data/web/assets/javascripts/dashboard.js +138 -29
- data/web/assets/stylesheets/application.css +267 -406
- data/web/assets/stylesheets/bootstrap.css +4 -8
- data/web/locales/cs.yml +78 -0
- data/web/locales/da.yml +9 -1
- data/web/locales/de.yml +18 -9
- data/web/locales/el.yml +68 -0
- data/web/locales/en.yml +19 -4
- data/web/locales/es.yml +10 -1
- data/web/locales/fa.yml +79 -0
- data/web/locales/fr.yml +50 -32
- data/web/locales/hi.yml +75 -0
- data/web/locales/it.yml +27 -18
- data/web/locales/ja.yml +27 -12
- data/web/locales/ko.yml +8 -3
- data/web/locales/{no.yml → nb.yml} +19 -5
- data/web/locales/nl.yml +8 -3
- data/web/locales/pl.yml +0 -1
- data/web/locales/pt-br.yml +11 -4
- data/web/locales/pt.yml +8 -1
- data/web/locales/ru.yml +39 -21
- data/web/locales/sv.yml +68 -0
- data/web/locales/ta.yml +75 -0
- data/web/locales/uk.yml +76 -0
- data/web/locales/zh-cn.yml +68 -0
- data/web/locales/zh-tw.yml +68 -0
- data/web/views/_footer.erb +17 -0
- data/web/views/_job_info.erb +72 -60
- data/web/views/_nav.erb +58 -25
- data/web/views/_paging.erb +5 -5
- data/web/views/_poll_link.erb +7 -0
- data/web/views/_summary.erb +20 -14
- data/web/views/busy.erb +94 -0
- data/web/views/dashboard.erb +34 -21
- data/web/views/dead.erb +34 -0
- data/web/views/layout.erb +8 -30
- data/web/views/morgue.erb +75 -0
- data/web/views/queue.erb +37 -30
- data/web/views/queues.erb +26 -20
- data/web/views/retries.erb +60 -47
- data/web/views/retry.erb +23 -19
- data/web/views/scheduled.erb +39 -35
- data/web/views/scheduled_job_info.erb +2 -1
- metadata +152 -195
- data/Contributing.md +0 -29
- data/config.ru +0 -18
- data/lib/sidekiq/actor.rb +0 -7
- data/lib/sidekiq/capistrano.rb +0 -54
- data/lib/sidekiq/yaml_patch.rb +0 -21
- data/test/config.yml +0 -11
- data/test/env_based_config.yml +0 -11
- data/test/fake_env.rb +0 -0
- data/test/helper.rb +0 -42
- data/test/test_api.rb +0 -341
- data/test/test_cli.rb +0 -326
- data/test/test_client.rb +0 -211
- data/test/test_exception_handler.rb +0 -124
- data/test/test_extensions.rb +0 -105
- data/test/test_fetch.rb +0 -44
- data/test/test_manager.rb +0 -83
- data/test/test_middleware.rb +0 -135
- data/test/test_processor.rb +0 -160
- data/test/test_redis_connection.rb +0 -97
- data/test/test_retry.rb +0 -306
- data/test/test_scheduled.rb +0 -86
- data/test/test_scheduling.rb +0 -47
- data/test/test_sidekiq.rb +0 -37
- data/test/test_testing.rb +0 -82
- data/test/test_testing_fake.rb +0 -265
- data/test/test_testing_inline.rb +0 -92
- data/test/test_util.rb +0 -18
- data/test/test_web.rb +0 -372
- data/web/assets/images/bootstrap/glyphicons-halflings-white.png +0 -0
- data/web/assets/images/bootstrap/glyphicons-halflings.png +0 -0
- data/web/assets/images/status/active.png +0 -0
- data/web/assets/images/status/idle.png +0 -0
- data/web/assets/javascripts/locales/README.md +0 -27
- data/web/assets/javascripts/locales/jquery.timeago.ar.js +0 -96
- data/web/assets/javascripts/locales/jquery.timeago.bg.js +0 -18
- data/web/assets/javascripts/locales/jquery.timeago.bs.js +0 -49
- data/web/assets/javascripts/locales/jquery.timeago.ca.js +0 -18
- data/web/assets/javascripts/locales/jquery.timeago.cy.js +0 -20
- data/web/assets/javascripts/locales/jquery.timeago.cz.js +0 -18
- data/web/assets/javascripts/locales/jquery.timeago.da.js +0 -18
- data/web/assets/javascripts/locales/jquery.timeago.de.js +0 -18
- data/web/assets/javascripts/locales/jquery.timeago.el.js +0 -18
- data/web/assets/javascripts/locales/jquery.timeago.en-short.js +0 -20
- data/web/assets/javascripts/locales/jquery.timeago.en.js +0 -20
- data/web/assets/javascripts/locales/jquery.timeago.es.js +0 -18
- data/web/assets/javascripts/locales/jquery.timeago.et.js +0 -18
- data/web/assets/javascripts/locales/jquery.timeago.fa.js +0 -22
- data/web/assets/javascripts/locales/jquery.timeago.fi.js +0 -28
- data/web/assets/javascripts/locales/jquery.timeago.fr-short.js +0 -16
- data/web/assets/javascripts/locales/jquery.timeago.fr.js +0 -17
- data/web/assets/javascripts/locales/jquery.timeago.he.js +0 -18
- data/web/assets/javascripts/locales/jquery.timeago.hr.js +0 -49
- data/web/assets/javascripts/locales/jquery.timeago.hu.js +0 -18
- data/web/assets/javascripts/locales/jquery.timeago.hy.js +0 -18
- data/web/assets/javascripts/locales/jquery.timeago.id.js +0 -18
- data/web/assets/javascripts/locales/jquery.timeago.it.js +0 -16
- data/web/assets/javascripts/locales/jquery.timeago.ja.js +0 -19
- data/web/assets/javascripts/locales/jquery.timeago.ko.js +0 -17
- data/web/assets/javascripts/locales/jquery.timeago.lt.js +0 -20
- data/web/assets/javascripts/locales/jquery.timeago.mk.js +0 -20
- data/web/assets/javascripts/locales/jquery.timeago.nl.js +0 -20
- data/web/assets/javascripts/locales/jquery.timeago.no.js +0 -18
- data/web/assets/javascripts/locales/jquery.timeago.pl.js +0 -31
- data/web/assets/javascripts/locales/jquery.timeago.pt-br.js +0 -16
- data/web/assets/javascripts/locales/jquery.timeago.pt.js +0 -16
- data/web/assets/javascripts/locales/jquery.timeago.ro.js +0 -18
- data/web/assets/javascripts/locales/jquery.timeago.rs.js +0 -49
- data/web/assets/javascripts/locales/jquery.timeago.ru.js +0 -34
- data/web/assets/javascripts/locales/jquery.timeago.sk.js +0 -18
- data/web/assets/javascripts/locales/jquery.timeago.sl.js +0 -44
- data/web/assets/javascripts/locales/jquery.timeago.sv.js +0 -18
- data/web/assets/javascripts/locales/jquery.timeago.th.js +0 -20
- data/web/assets/javascripts/locales/jquery.timeago.tr.js +0 -16
- data/web/assets/javascripts/locales/jquery.timeago.uk.js +0 -34
- data/web/assets/javascripts/locales/jquery.timeago.uz.js +0 -19
- data/web/assets/javascripts/locales/jquery.timeago.zh-CN.js +0 -20
- data/web/assets/javascripts/locales/jquery.timeago.zh-TW.js +0 -20
- data/web/views/_poll.erb +0 -14
- data/web/views/_workers.erb +0 -29
- data/web/views/index.erb +0 -16
data/web/views/_nav.erb
CHANGED
@@ -1,33 +1,66 @@
|
|
1
|
-
<div class="navbar-
|
2
|
-
<div class="container">
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
<div class="navbar navbar-default navbar-fixed-top">
|
2
|
+
<div class="container-fluid">
|
3
|
+
<div class="navbar-header" data-navbar="static">
|
4
|
+
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-menu">
|
5
|
+
<span class="icon-bar"></span>
|
6
|
+
<span class="icon-bar"></span>
|
7
|
+
<span class="icon-bar"></span>
|
8
|
+
</button>
|
9
|
+
<div class="navbar-toggle collapsed navbar-livereload">
|
10
|
+
<%= erb :_poll_link %>
|
11
|
+
<% if Sidekiq::Web.app_url %>
|
12
|
+
<a class="btn btn-inverse" href="<%= Sidekiq::Web.app_url %>">Back to App</a>
|
13
|
+
<% end %>
|
14
|
+
</div>
|
15
|
+
<a class="navbar-brand" href="<%= root_path %>">
|
16
|
+
<%= Sidekiq::NAME %>
|
17
|
+
<%= erb :_status %>
|
18
|
+
</a>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<div class="collapse navbar-collapse" id="navbar-menu">
|
22
|
+
<ul class="nav navbar-nav" data-navbar="static">
|
23
|
+
<% Sidekiq::Web.default_tabs.each do |title, url| %>
|
24
|
+
<% if url == '' %>
|
25
|
+
<li class="<%= current_path == url ? 'active' : '' %>">
|
11
26
|
<a href="<%= root_path %><%= url %>"><%= t(title) %></a>
|
12
|
-
|
13
|
-
|
14
|
-
|
27
|
+
</li>
|
28
|
+
<% else %>
|
29
|
+
<li class="<%= current_path.start_with?(url) ? 'active' : '' %>">
|
15
30
|
<a href="<%= root_path %><%= url %>"><%= t(title) %></a>
|
16
|
-
|
31
|
+
</li>
|
32
|
+
<% end %>
|
17
33
|
<% end %>
|
18
|
-
<% end %>
|
19
|
-
<% custom_tabs.each do |title, url| %>
|
20
|
-
<li class="<%= current_path.start_with?(url) ? 'active' : '' %>">
|
21
|
-
<a href="<%= root_path %><%= url %>"><%= t(title) %></a>
|
22
|
-
</li>
|
23
|
-
<% end %>
|
24
|
-
|
25
34
|
|
35
|
+
<li class="dropdown" data-navbar="dropdown">
|
36
|
+
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
37
|
+
<%= t('Plugins') %> <span class="caret"></span>
|
38
|
+
</a>
|
39
|
+
<ul class="dropdown-menu" role="menu">
|
40
|
+
<% Sidekiq::Web.custom_tabs.each do |title, url| %>
|
41
|
+
<li>
|
42
|
+
<a href="<%= root_path %><%= url %>"><%= t(title) %></a>
|
43
|
+
</li>
|
44
|
+
<% end %>
|
45
|
+
</ul>
|
46
|
+
</li>
|
26
47
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
48
|
+
<% Sidekiq::Web.custom_tabs.each do |title, url| %>
|
49
|
+
<li class="<%= current_path.start_with?(url) ? 'active' : '' %>" data-navbar="custom-tab">
|
50
|
+
<a href="<%= root_path %><%= url %>"><%= t(title) %></a>
|
51
|
+
</li>
|
52
|
+
<% end %>
|
53
|
+
</ul>
|
54
|
+
<ul class="nav navbar-nav navbar-right navbar-livereload" data-navbar="static">
|
55
|
+
<li>
|
56
|
+
<div class="poll-wrapper pull-right">
|
57
|
+
<%= erb :_poll_link %>
|
58
|
+
<% if Sidekiq::Web.app_url %>
|
59
|
+
<a class="btn btn-inverse" href="<%= Sidekiq::Web.app_url %>"><%= t('BackToApp') %></a>
|
60
|
+
<% end %>
|
61
|
+
</div>
|
62
|
+
</li>
|
63
|
+
</ul>
|
31
64
|
</div>
|
32
65
|
</div>
|
33
66
|
</div>
|
data/web/views/_paging.erb
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
<% if @total_size > @count %>
|
2
2
|
<ul class="pagination pull-right">
|
3
3
|
<li class="<%= 'disabled' if @current_page == 1 %>">
|
4
|
-
<a href="<%= url %>?page=1"
|
4
|
+
<a href="<%= url %>?page=1">«</a>
|
5
5
|
</li>
|
6
6
|
<% if @current_page > 1 %>
|
7
7
|
<li>
|
8
|
-
<a href="<%= url
|
8
|
+
<a href="<%= url %>?<%= qparams(page: @current_page - 1) %>"><%= @current_page - 1 %></a>
|
9
9
|
</li>
|
10
10
|
<% end %>
|
11
11
|
<li class="disabled">
|
12
|
-
<a href="<%= url
|
12
|
+
<a href="<%= url %>?<%= qparams(page: @current_page) %>"><%= @current_page %></a>
|
13
13
|
</li>
|
14
14
|
<% if @total_size > @current_page * @count %>
|
15
15
|
<li>
|
16
|
-
<a href="<%= url
|
16
|
+
<a href="<%= url %>?<%= qparams(page: @current_page + 1) %>"><%= @current_page + 1 %></a>
|
17
17
|
</li>
|
18
18
|
<% end %>
|
19
19
|
<li class="<%= 'disabled' if @total_size <= @current_page * @count %>">
|
20
|
-
<a href="<%= url
|
20
|
+
<a href="<%= url %>?<%= qparams(page: (@total_size.to_f / @count).ceil) %>">»</a>
|
21
21
|
</li>
|
22
22
|
</ul>
|
23
23
|
<% end %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<% if current_path != '' %>
|
2
|
+
<% if params[:poll] %>
|
3
|
+
<a id="live-poll" class="btn btn-primary active" href="<%= root_path + current_path %>"><%= t('StopPolling') %></a>
|
4
|
+
<% else %>
|
5
|
+
<a id="live-poll" class="btn btn-primary" href="<%= root_path + current_path %>?<%= qparams(poll: true) %>"><%= t('LivePoll') %></a>
|
6
|
+
<% end %>
|
7
|
+
<% end %>
|
data/web/views/_summary.erb
CHANGED
@@ -1,34 +1,40 @@
|
|
1
1
|
<ul class="list-unstyled summary row">
|
2
|
-
<li class="processed col-sm-
|
2
|
+
<li class="processed col-sm-1">
|
3
3
|
<span class="count"><%= number_with_delimiter(stats.processed) %></span>
|
4
4
|
<span class="desc"><%= t('Processed') %></span>
|
5
5
|
</li>
|
6
|
-
<li class="failed col-sm-
|
6
|
+
<li class="failed col-sm-1">
|
7
7
|
<span class="count"><%= number_with_delimiter(stats.failed) %></span>
|
8
8
|
<span class="desc"><%= t('Failed') %></span>
|
9
9
|
</li>
|
10
|
-
<li class="busy col-sm-
|
11
|
-
<a href="<%= root_path %>
|
12
|
-
<span class="count"><%= number_with_delimiter(
|
10
|
+
<li class="busy col-sm-1">
|
11
|
+
<a href="<%= root_path %>busy">
|
12
|
+
<span class="count"><%= number_with_delimiter(workers.size) %></span>
|
13
13
|
<span class="desc"><%= t('Busy') %></span>
|
14
14
|
</a>
|
15
15
|
</li>
|
16
|
-
<li class="
|
17
|
-
<a href="<%= root_path %>
|
18
|
-
<span class="count"><%= number_with_delimiter(stats.
|
19
|
-
<span class="desc"><%= t('
|
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
20
|
</a>
|
21
21
|
</li>
|
22
|
-
<li class="retries col-sm-
|
22
|
+
<li class="retries col-sm-1">
|
23
23
|
<a href="<%= root_path %>retries">
|
24
24
|
<span class="count"><%= number_with_delimiter(stats.retry_size) %></span>
|
25
25
|
<span class="desc"><%= t('Retries') %></span>
|
26
26
|
</a>
|
27
27
|
</li>
|
28
|
-
<li class="
|
29
|
-
<a href="<%= root_path %>
|
30
|
-
<span class="count"><%= number_with_delimiter(stats.
|
31
|
-
<span class="desc"><%= t('
|
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>
|
32
38
|
</a>
|
33
39
|
</li>
|
34
40
|
</ul>
|
data/web/views/busy.erb
ADDED
@@ -0,0 +1,94 @@
|
|
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" class="warning-messages">
|
7
|
+
<%= csrf_tag %>
|
8
|
+
<div class="btn-group pull-right">
|
9
|
+
<button class="btn btn-warn" type="submit" name="quiet" value="1" data-confirm="<%= t('AreYouSure') %>"><%= t('QuietAll') %></button>
|
10
|
+
<button class="btn btn-danger" type="submit" name="stop" value="1" data-confirm="<%= t('AreYouSure') %>"><%= t('StopAll') %></button>
|
11
|
+
</div>
|
12
|
+
</form>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<div class="table_container">
|
17
|
+
<table class="processes table table-hover table-bordered table-striped table-white">
|
18
|
+
<thead>
|
19
|
+
<th><%= t('Name') %></th>
|
20
|
+
<th><%= t('Started') %></th>
|
21
|
+
<th><%= t('Threads') %></th>
|
22
|
+
<th><%= t('Busy') %></th>
|
23
|
+
<th> </th>
|
24
|
+
</thead>
|
25
|
+
<% processes.each do |process| %>
|
26
|
+
<tr>
|
27
|
+
<td class="box">
|
28
|
+
<%= "#{process['hostname']}:#{process['pid']}" %>
|
29
|
+
<span class="label label-success"><%= process.tag %></span>
|
30
|
+
<% process.labels.each do |label| %>
|
31
|
+
<span class="label label-info"><%= label %></span>
|
32
|
+
<% end %>
|
33
|
+
<% if process.stopping? %>
|
34
|
+
<span class="label label-danger">Quiet</span>
|
35
|
+
<% end %>
|
36
|
+
<br>
|
37
|
+
<b><%= "#{t('Queues')}: " %></b>
|
38
|
+
<%= process['queues'] * ", " %>
|
39
|
+
</td>
|
40
|
+
<td><%= relative_time(Time.at(process['started_at'])) %></td>
|
41
|
+
<td><%= process['concurrency'] %></td>
|
42
|
+
<td><%= process['busy'] %></td>
|
43
|
+
<td>
|
44
|
+
<div class="btn-group pull-right">
|
45
|
+
<form method="POST">
|
46
|
+
<%= csrf_tag %>
|
47
|
+
<input type="hidden" name="identity" value="<%= process['identity'] %>"/>
|
48
|
+
<% unless process.stopping? %>
|
49
|
+
<button class="btn btn-warn" type="submit" name="quiet" value="1"><%= t('Quiet') %></button>
|
50
|
+
<% end %>
|
51
|
+
<button class="btn btn-danger" type="submit" name="stop" value="1"><%= t('Stop') %></button>
|
52
|
+
</form>
|
53
|
+
</div>
|
54
|
+
</td>
|
55
|
+
</tr>
|
56
|
+
<% end %>
|
57
|
+
</table>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div class="row header">
|
61
|
+
<div class="col-sm-7">
|
62
|
+
<h3><%= t('Jobs') %></h3>
|
63
|
+
</div>
|
64
|
+
</div>
|
65
|
+
|
66
|
+
<div class="table_container">
|
67
|
+
<table class="workers table table-hover table-bordered table-striped table-white">
|
68
|
+
<thead>
|
69
|
+
<th><%= t('Process') %></th>
|
70
|
+
<th><%= t('TID') %></th>
|
71
|
+
<th><%= t('JID') %></th>
|
72
|
+
<th><%= t('Queue') %></th>
|
73
|
+
<th><%= t('Job') %></th>
|
74
|
+
<th><%= t('Arguments') %></th>
|
75
|
+
<th><%= t('Started') %></th>
|
76
|
+
</thead>
|
77
|
+
<% workers.each do |process, thread, msg| %>
|
78
|
+
<% job = Sidekiq::Job.new(msg['payload']) %>
|
79
|
+
<tr>
|
80
|
+
<td><%= process %></td>
|
81
|
+
<td><%= thread %></td>
|
82
|
+
<td><%= job.jid %></td>
|
83
|
+
<td>
|
84
|
+
<a href="<%= root_path %>queues/<%= msg['queue'] %>"><%= msg['queue'] %></a>
|
85
|
+
</td>
|
86
|
+
<td><%= job.display_class %></td>
|
87
|
+
<td>
|
88
|
+
<div class="args"><%= display_args(job.display_args) %></div>
|
89
|
+
</td>
|
90
|
+
<td><%= relative_time(Time.at(msg['run_at'])) %></td>
|
91
|
+
</tr>
|
92
|
+
<% end %>
|
93
|
+
</table>
|
94
|
+
</div>
|
data/web/views/dashboard.erb
CHANGED
@@ -1,24 +1,37 @@
|
|
1
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">5 sec</span>
|
13
|
+
<br/>
|
14
|
+
<input type="range" min="2000" max="20000" step="1000" value="5000"/>
|
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>
|
2
31
|
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
<span class="ring"></span>
|
7
|
-
<span class="dot"></span>
|
8
|
-
</span>
|
9
|
-
</h3>
|
10
|
-
|
11
|
-
<h5></h5>
|
12
|
-
<div id="realtime"></div>
|
13
|
-
|
14
|
-
<h5>
|
15
|
-
<span class="history-heading"><%= t('History') %></span>
|
16
|
-
<a href="<%= root_path %>?days=7" class="history-graph <%= "active" if params[:days] == "7" %>"><%= t('OneWeek') %></a>
|
17
|
-
<a href="<%= root_path %>" class="history-graph <%= "active" if params[:days].nil? || params[:days] == "30" %>" ><%= t('OneMonth') %></a>
|
18
|
-
<a href="<%= root_path %>?days=90" class="history-graph <%= "active" if params[:days] == "90" %>"><%= t('ThreeMonths') %></a>
|
19
|
-
<a href="<%= root_path %>?days=180" class="history-graph <%= "active" if params[:days] == "180" %>"><%= t('SixMonths') %></a>
|
20
|
-
</h5>
|
21
|
-
<div id="history" data-processed="<%= h Sidekiq.dump_json(@processed_history) %>" data-failed="<%= h Sidekiq.dump_json(@failed_history) %>" data-update-url="<%= root_path %>dashboard/stats"></div>
|
32
|
+
<div id="history" data-processed-label="<%= t('Processed') %>" data-failed-label="<%= t('Failed') %>" data-processed="<%= h Sidekiq.dump_json(@processed_history) %>" data-failed="<%= h Sidekiq.dump_json(@failed_history) %>" data-update-url="<%= root_path %>stats"></div>
|
33
|
+
<div id="history-legend"></div>
|
34
|
+
</div>
|
22
35
|
|
23
36
|
<br/>
|
24
37
|
<h5>Redis</h5>
|
@@ -45,14 +58,14 @@
|
|
45
58
|
</div>
|
46
59
|
<% end %>
|
47
60
|
|
48
|
-
<%
|
61
|
+
<% if @redis_info.fetch("used_memory_human", nil) %>
|
49
62
|
<div class="stat">
|
50
63
|
<h3 class="used_memory_human"><%= @redis_info.fetch("used_memory_human") %></h3>
|
51
64
|
<p><%= t('MemoryUsage') %></p>
|
52
65
|
</div>
|
53
66
|
<% end %>
|
54
67
|
|
55
|
-
<%
|
68
|
+
<% if @redis_info.fetch("used_memory_peak_human", nil) %>
|
56
69
|
<div class="stat">
|
57
70
|
<h3 class="used_memory_peak_human"><%= @redis_info.fetch("used_memory_peak_human") %></h3>
|
58
71
|
<p><%= t('PeakMemoryUsage') %></p>
|
data/web/views/dead.erb
ADDED
@@ -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>
|
data/web/views/layout.erb
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
<!doctype html>
|
2
2
|
<html>
|
3
3
|
<head>
|
4
|
-
<title><%= Sidekiq::NAME %></title>
|
4
|
+
<title><%= environment_title_prefix %><%= Sidekiq::NAME %></title>
|
5
|
+
<meta charset="utf8" />
|
5
6
|
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
6
7
|
<link href="<%= root_path %>stylesheets/bootstrap.css" media="screen" rel="stylesheet" type="text/css" />
|
7
8
|
<link href="<%= root_path %>stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
|
9
|
+
<link rel="shortcut icon" type="image/ico" href="<%= root_path %>images/favicon.ico" />
|
8
10
|
<script type="text/javascript" src="<%= root_path %>javascripts/application.js"></script>
|
9
|
-
<
|
11
|
+
<meta name="google" content="notranslate" />
|
12
|
+
<%= display_custom_head %>
|
10
13
|
</head>
|
11
|
-
<body class="admin">
|
12
|
-
|
13
|
-
<%= erb :_nav %>
|
14
|
-
</div>
|
15
|
-
|
14
|
+
<body class="admin" data-poll-path="<%= poll_path %>" data-locale="<%= locale %>">
|
15
|
+
<%= erb :_nav %>
|
16
16
|
<div id="page">
|
17
17
|
<div class="container">
|
18
18
|
<div class="row">
|
@@ -26,28 +26,6 @@
|
|
26
26
|
</div>
|
27
27
|
</div>
|
28
28
|
</div>
|
29
|
-
|
30
|
-
<div class="navbar navbar-fixed-bottom navbar-inverse">
|
31
|
-
<div class="navbar-inner">
|
32
|
-
<div class="container">
|
33
|
-
<ul class="nav">
|
34
|
-
<li>
|
35
|
-
<p class="navbar-text" style="color:white;">Sidekiq v<%= Sidekiq::VERSION %></p>
|
36
|
-
</li>
|
37
|
-
<li>
|
38
|
-
<p class="navbar-text">Redis: <%= location %></p>
|
39
|
-
</li>
|
40
|
-
<li>
|
41
|
-
<p class="navbar-text"><%= t('Time') %>: <%= Time.now.utc.strftime('%H:%M:%S UTC') %></p>
|
42
|
-
</li>
|
43
|
-
<% if namespace %>
|
44
|
-
<li>
|
45
|
-
<p class="navbar-text"><%= t('Namespace') %>: <%= namespace %></p>
|
46
|
-
</li>
|
47
|
-
<% end %>
|
48
|
-
</ul>
|
49
|
-
</div>
|
50
|
-
</div>
|
51
|
-
</div>
|
29
|
+
<%= erb :_footer %>
|
52
30
|
</body>
|
53
31
|
</html>
|
@@ -0,0 +1,75 @@
|
|
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 class="table-checkbox checkbox-column">
|
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 %>"><%= entry.queue %></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
|
+
<% if entry.error? %>
|
51
|
+
<div><%= h truncate("#{entry['error_class']}: #{entry['error_message']}", 200) %></div>
|
52
|
+
<% end %>
|
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
|
+
</form>
|
61
|
+
|
62
|
+
<% unfiltered? do %>
|
63
|
+
<form action="<%= root_path %>morgue/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 %>morgue/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
|
+
<% end %>
|
72
|
+
|
73
|
+
<% else %>
|
74
|
+
<div class="alert alert-success"><%= t('NoDeadJobsFound') %></div>
|
75
|
+
<% end %>
|