sidekiq 5.2.7 → 8.0.5
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.
- checksums.yaml +4 -4
- data/Changes.md +845 -8
- data/LICENSE.txt +9 -0
- data/README.md +54 -54
- data/bin/multi_queue_bench +271 -0
- data/bin/sidekiq +22 -3
- data/bin/sidekiqload +219 -112
- data/bin/sidekiqmon +11 -0
- data/bin/webload +69 -0
- data/lib/active_job/queue_adapters/sidekiq_adapter.rb +120 -0
- data/lib/generators/sidekiq/job_generator.rb +59 -0
- data/lib/generators/sidekiq/templates/{worker.rb.erb → job.rb.erb} +2 -2
- data/lib/generators/sidekiq/templates/{worker_spec.rb.erb → job_spec.rb.erb} +1 -1
- data/lib/generators/sidekiq/templates/{worker_test.rb.erb → job_test.rb.erb} +1 -1
- data/lib/sidekiq/api.rb +757 -373
- data/lib/sidekiq/capsule.rb +132 -0
- data/lib/sidekiq/cli.rb +210 -233
- data/lib/sidekiq/client.rb +145 -103
- data/lib/sidekiq/component.rb +128 -0
- data/lib/sidekiq/config.rb +315 -0
- data/lib/sidekiq/deploy.rb +64 -0
- data/lib/sidekiq/embedded.rb +64 -0
- data/lib/sidekiq/fetch.rb +49 -42
- data/lib/sidekiq/iterable_job.rb +56 -0
- data/lib/sidekiq/job/interrupt_handler.rb +24 -0
- data/lib/sidekiq/job/iterable/active_record_enumerator.rb +53 -0
- data/lib/sidekiq/job/iterable/csv_enumerator.rb +47 -0
- data/lib/sidekiq/job/iterable/enumerators.rb +135 -0
- data/lib/sidekiq/job/iterable.rb +306 -0
- data/lib/sidekiq/job.rb +385 -0
- data/lib/sidekiq/job_logger.rb +34 -7
- data/lib/sidekiq/job_retry.rb +164 -109
- data/lib/sidekiq/job_util.rb +113 -0
- data/lib/sidekiq/launcher.rb +208 -107
- data/lib/sidekiq/logger.rb +80 -0
- data/lib/sidekiq/manager.rb +42 -46
- data/lib/sidekiq/metrics/query.rb +184 -0
- data/lib/sidekiq/metrics/shared.rb +109 -0
- data/lib/sidekiq/metrics/tracking.rb +150 -0
- data/lib/sidekiq/middleware/chain.rb +113 -56
- data/lib/sidekiq/middleware/current_attributes.rb +119 -0
- data/lib/sidekiq/middleware/i18n.rb +7 -7
- data/lib/sidekiq/middleware/modules.rb +23 -0
- data/lib/sidekiq/monitor.rb +147 -0
- data/lib/sidekiq/paginator.rb +41 -16
- data/lib/sidekiq/processor.rb +146 -127
- data/lib/sidekiq/profiler.rb +72 -0
- data/lib/sidekiq/rails.rb +46 -43
- data/lib/sidekiq/redis_client_adapter.rb +113 -0
- data/lib/sidekiq/redis_connection.rb +79 -108
- data/lib/sidekiq/ring_buffer.rb +31 -0
- data/lib/sidekiq/scheduled.rb +112 -50
- data/lib/sidekiq/sd_notify.rb +149 -0
- data/lib/sidekiq/systemd.rb +26 -0
- data/lib/sidekiq/testing/inline.rb +6 -5
- data/lib/sidekiq/testing.rb +91 -90
- data/lib/sidekiq/transaction_aware_client.rb +51 -0
- data/lib/sidekiq/version.rb +7 -1
- data/lib/sidekiq/web/action.rb +125 -60
- data/lib/sidekiq/web/application.rb +363 -259
- data/lib/sidekiq/web/config.rb +120 -0
- data/lib/sidekiq/web/csrf_protection.rb +183 -0
- data/lib/sidekiq/web/helpers.rb +241 -120
- data/lib/sidekiq/web/router.rb +62 -71
- data/lib/sidekiq/web.rb +69 -161
- data/lib/sidekiq/worker_compatibility_alias.rb +13 -0
- data/lib/sidekiq.rb +94 -182
- data/sidekiq.gemspec +26 -16
- data/web/assets/images/apple-touch-icon.png +0 -0
- data/web/assets/javascripts/application.js +150 -61
- data/web/assets/javascripts/base-charts.js +120 -0
- data/web/assets/javascripts/chart.min.js +13 -0
- data/web/assets/javascripts/chartjs-adapter-date-fns.min.js +7 -0
- data/web/assets/javascripts/chartjs-plugin-annotation.min.js +7 -0
- data/web/assets/javascripts/dashboard-charts.js +194 -0
- data/web/assets/javascripts/dashboard.js +41 -293
- data/web/assets/javascripts/metrics.js +280 -0
- data/web/assets/stylesheets/style.css +766 -0
- data/web/locales/ar.yml +72 -65
- data/web/locales/cs.yml +63 -62
- data/web/locales/da.yml +61 -53
- data/web/locales/de.yml +66 -53
- data/web/locales/el.yml +44 -24
- data/web/locales/en.yml +94 -66
- data/web/locales/es.yml +92 -54
- data/web/locales/fa.yml +66 -65
- data/web/locales/fr.yml +83 -62
- data/web/locales/gd.yml +99 -0
- data/web/locales/he.yml +66 -64
- data/web/locales/hi.yml +60 -59
- data/web/locales/it.yml +93 -54
- data/web/locales/ja.yml +75 -64
- data/web/locales/ko.yml +53 -52
- data/web/locales/lt.yml +84 -0
- data/web/locales/nb.yml +62 -61
- data/web/locales/nl.yml +53 -52
- data/web/locales/pl.yml +46 -45
- data/web/locales/{pt-br.yml → pt-BR.yml} +84 -56
- data/web/locales/pt.yml +52 -51
- data/web/locales/ru.yml +69 -63
- data/web/locales/sv.yml +54 -53
- data/web/locales/ta.yml +61 -60
- data/web/locales/tr.yml +101 -0
- data/web/locales/uk.yml +86 -61
- data/web/locales/ur.yml +65 -64
- data/web/locales/vi.yml +84 -0
- data/web/locales/zh-CN.yml +106 -0
- data/web/locales/{zh-tw.yml → zh-TW.yml} +43 -9
- data/web/views/_footer.erb +31 -19
- data/web/views/_job_info.erb +94 -75
- data/web/views/_metrics_period_select.erb +15 -0
- data/web/views/_nav.erb +14 -21
- data/web/views/_paging.erb +23 -19
- data/web/views/_poll_link.erb +3 -6
- data/web/views/_summary.erb +23 -23
- data/web/views/busy.erb +139 -87
- data/web/views/dashboard.erb +82 -53
- data/web/views/dead.erb +31 -27
- data/web/views/filtering.erb +6 -0
- data/web/views/layout.erb +15 -29
- data/web/views/metrics.erb +84 -0
- data/web/views/metrics_for_job.erb +58 -0
- data/web/views/morgue.erb +60 -70
- data/web/views/profiles.erb +43 -0
- data/web/views/queue.erb +50 -39
- data/web/views/queues.erb +45 -29
- data/web/views/retries.erb +65 -75
- data/web/views/retry.erb +32 -27
- data/web/views/scheduled.erb +58 -52
- data/web/views/scheduled_job_info.erb +1 -1
- metadata +96 -76
- data/.circleci/config.yml +0 -61
- data/.github/contributing.md +0 -32
- data/.github/issue_template.md +0 -11
- data/.gitignore +0 -15
- data/.travis.yml +0 -11
- data/3.0-Upgrade.md +0 -70
- data/4.0-Upgrade.md +0 -53
- data/5.0-Upgrade.md +0 -56
- data/COMM-LICENSE +0 -97
- data/Ent-Changes.md +0 -238
- data/Gemfile +0 -23
- data/LICENSE +0 -9
- data/Pro-2.0-Upgrade.md +0 -138
- data/Pro-3.0-Upgrade.md +0 -44
- data/Pro-4.0-Upgrade.md +0 -35
- data/Pro-Changes.md +0 -759
- data/Rakefile +0 -9
- data/bin/sidekiqctl +0 -20
- data/code_of_conduct.md +0 -50
- data/lib/generators/sidekiq/worker_generator.rb +0 -49
- data/lib/sidekiq/core_ext.rb +0 -1
- data/lib/sidekiq/ctl.rb +0 -221
- data/lib/sidekiq/delay.rb +0 -42
- data/lib/sidekiq/exception_handler.rb +0 -29
- data/lib/sidekiq/extensions/action_mailer.rb +0 -57
- data/lib/sidekiq/extensions/active_record.rb +0 -40
- data/lib/sidekiq/extensions/class_methods.rb +0 -40
- data/lib/sidekiq/extensions/generic_proxy.rb +0 -31
- data/lib/sidekiq/logging.rb +0 -122
- data/lib/sidekiq/middleware/server/active_record.rb +0 -23
- data/lib/sidekiq/util.rb +0 -66
- data/lib/sidekiq/worker.rb +0 -220
- data/web/assets/stylesheets/application-rtl.css +0 -246
- data/web/assets/stylesheets/application.css +0 -1144
- data/web/assets/stylesheets/bootstrap-rtl.min.css +0 -9
- data/web/assets/stylesheets/bootstrap.css +0 -5
- data/web/locales/zh-cn.yml +0 -68
- data/web/views/_status.erb +0 -4
@@ -0,0 +1,58 @@
|
|
1
|
+
<%= script_tag "javascripts/chart.min.js" %>
|
2
|
+
<%= script_tag "javascripts/chartjs-plugin-annotation.min.js" %>
|
3
|
+
<%= script_tag "javascripts/chartjs-adapter-date-fns.min.js" %>
|
4
|
+
<%= script_tag "javascripts/base-charts.js" %>
|
5
|
+
|
6
|
+
<%
|
7
|
+
job_result = @query_result.job_results[@name]
|
8
|
+
hist_totals = job_result.hist.values.first.zip(*job_result.hist.values[1..-1]).map(&:sum).reverse
|
9
|
+
bucket_labels = Sidekiq::Metrics::Histogram::LABELS
|
10
|
+
bucket_intervals = Sidekiq::Metrics::Histogram::BUCKET_INTERVALS
|
11
|
+
%>
|
12
|
+
<section>
|
13
|
+
<% if job_result.totals["s"] > 0 %>
|
14
|
+
<header>
|
15
|
+
<h1>
|
16
|
+
<a href="<%= root_path %>metrics?period=<%= @period %>"><%= t('Metrics') %></a> /
|
17
|
+
<%= h @name %>
|
18
|
+
<a target="blank" href="https://github.com/sidekiq/sidekiq/wiki/Metrics"><span class="info-circle" title="Click to learn more about metrics">?</span></a>
|
19
|
+
</h1>
|
20
|
+
<%= erb :_metrics_period_select, locals: { periods: @periods, period: @period, path: "#{root_path}metrics/#{@name}" } %>
|
21
|
+
</header>
|
22
|
+
|
23
|
+
<canvas id="hist-totals-chart">
|
24
|
+
<%= to_json({
|
25
|
+
series: hist_totals,
|
26
|
+
labels: bucket_labels,
|
27
|
+
xLabel: t('ExecutionTime'),
|
28
|
+
yLabel: t('Jobs'),
|
29
|
+
units: t('Jobs').downcase,
|
30
|
+
}) %>
|
31
|
+
</canvas>
|
32
|
+
|
33
|
+
<canvas id="hist-bubble-chart">
|
34
|
+
<%= to_json({
|
35
|
+
hist: job_result.hist,
|
36
|
+
marks: @query_result.marks.map { |m| [m.bucket, m.label] },
|
37
|
+
starts_at: @query_result.starts_at.iso8601,
|
38
|
+
ends_at: @query_result.ends_at.iso8601,
|
39
|
+
histIntervals: bucket_intervals,
|
40
|
+
yLabel: t('ExecutionTime'),
|
41
|
+
markLabel: t('Deploy'),
|
42
|
+
yUnits: t('Seconds').downcase,
|
43
|
+
zUnits: t('Jobs').downcase,
|
44
|
+
}) %>
|
45
|
+
</canvas>
|
46
|
+
|
47
|
+
<!--p><small>Data from <%= @query_result.starts_at %> to <%= @query_result.ends_at %></small></p-->
|
48
|
+
<% else %>
|
49
|
+
<header>
|
50
|
+
<h1>
|
51
|
+
<a href="<%= root_path %>/metrics"><%= t('Metrics') %></a> /
|
52
|
+
<%= h @name %>
|
53
|
+
</h1>
|
54
|
+
</header>
|
55
|
+
<div class="alert alert-success"><%= t('NoJobMetricsFound') %></div>
|
56
|
+
<% end %>
|
57
|
+
</section>
|
58
|
+
<%= script_tag "javascripts/metrics.js" %>
|
data/web/views/morgue.erb
CHANGED
@@ -1,75 +1,65 @@
|
|
1
|
-
<
|
2
|
-
<
|
3
|
-
<
|
4
|
-
|
5
|
-
<% if @dead.size > 0 && @total_size > @count %>
|
6
|
-
<div class="col-sm-4">
|
1
|
+
<section>
|
2
|
+
<header>
|
3
|
+
<h1><%= t('DeadJobs') %></h1>
|
4
|
+
<% if @dead.size > 0 && @total_size > @count %>
|
7
5
|
<%= erb :_paging, locals: { url: "#{root_path}morgue" } %>
|
8
|
-
|
9
|
-
|
10
|
-
|
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 flip" type="submit" name="retry" value="<%= t('RetryNow') %>" />
|
59
|
-
<input class="btn btn-danger btn-xs pull-left flip" type="submit" name="delete" value="<%= t('Delete') %>" />
|
60
|
-
</form>
|
6
|
+
<% end %>
|
7
|
+
<%= filtering('morgue') %>
|
8
|
+
</header>
|
61
9
|
|
62
|
-
<%
|
63
|
-
<form action="<%= root_path %>morgue
|
64
|
-
<%= csrf_tag %>
|
65
|
-
<input class="btn btn-danger btn-xs pull-right flip" type="submit" name="delete" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" />
|
66
|
-
</form>
|
67
|
-
<form action="<%= root_path %>morgue/all/retry" method="post">
|
10
|
+
<% if @dead.size > 0 %>
|
11
|
+
<form action="<%= root_path %>morgue" method="post">
|
68
12
|
<%= csrf_tag %>
|
69
|
-
<
|
13
|
+
<div class="table_container">
|
14
|
+
<table>
|
15
|
+
<thead>
|
16
|
+
<tr>
|
17
|
+
<th>
|
18
|
+
<label>
|
19
|
+
<input type="checkbox" class="check_all" />
|
20
|
+
</label>
|
21
|
+
</th>
|
22
|
+
<th><%= t('LastRetry') %></th>
|
23
|
+
<th><%= t('Queue') %></th>
|
24
|
+
<th><%= t('Job') %></th>
|
25
|
+
<th><%= t('Arguments') %></th>
|
26
|
+
<th><%= t('Error') %></th>
|
27
|
+
</tr>
|
28
|
+
</thead>
|
29
|
+
<% @dead.each do |entry| %>
|
30
|
+
<tr>
|
31
|
+
<td>
|
32
|
+
<label>
|
33
|
+
<input type='checkbox' name='key[]' value='<%= job_params(entry.item, entry.score) %>' class='shift_clickable' />
|
34
|
+
</label>
|
35
|
+
</td>
|
36
|
+
<td>
|
37
|
+
<a href="<%= root_path %>morgue/<%= job_params(entry.item, entry.score) %>"><%= relative_time(entry.at) %></a>
|
38
|
+
</td>
|
39
|
+
<td>
|
40
|
+
<a href="<%= root_path %>queues/<%= entry.queue %>"><%= entry.queue %></a>
|
41
|
+
</td>
|
42
|
+
<td>
|
43
|
+
<%= entry.display_class %>
|
44
|
+
<%= display_tags(entry, "morgue") %>
|
45
|
+
</td>
|
46
|
+
<td>
|
47
|
+
<div class="args"><%= display_args(entry.display_args) %></div>
|
48
|
+
</td>
|
49
|
+
<td>
|
50
|
+
<% if entry.error? %>
|
51
|
+
<div><a href="<%= root_path %>morgue/<%= job_params(entry.item, entry.score) %>"><%= h truncate("#{entry['error_class']}: #{entry['error_message']}", 200) %></a></div>
|
52
|
+
<% end %>
|
53
|
+
</td>
|
54
|
+
</tr>
|
55
|
+
<% end %>
|
56
|
+
</table>
|
57
|
+
</div>
|
58
|
+
<input class="btn btn-primary pull-left flip" type="submit" name="retry" value="<%= t('RetryNow') %>" />
|
59
|
+
<input class="btn btn-danger pull-left flip" type="submit" name="delete" value="<%= t('Delete') %>" />
|
70
60
|
</form>
|
71
|
-
<% end %>
|
72
61
|
|
73
|
-
<% else %>
|
74
|
-
|
75
|
-
<% end %>
|
62
|
+
<% else %>
|
63
|
+
<div class="alert alert-success"><%= t('NoDeadJobsFound') %></div>
|
64
|
+
<% end %>
|
65
|
+
</section>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<section>
|
2
|
+
<header>
|
3
|
+
<h1>
|
4
|
+
<%= t('Profiles') %>
|
5
|
+
<a target="blank" href="https://github.com/sidekiq/sidekiq/wiki/Profiling"><span class="info-circle" title="Click to learn more about profiling">?</span></a>
|
6
|
+
</h1>
|
7
|
+
</header>
|
8
|
+
|
9
|
+
<% @profiles = Sidekiq::ProfileSet.new %>
|
10
|
+
<% if @profiles.size > 0 %>
|
11
|
+
<div class="table_container">
|
12
|
+
<table>
|
13
|
+
<thead>
|
14
|
+
<th><%= t('CreatedAt') %></th>
|
15
|
+
<th><%= t('Type') %></th>
|
16
|
+
<th><%= t('JID') %></th>
|
17
|
+
<th><%= t('Token') %></th>
|
18
|
+
<th><%= t('Size') %></th>
|
19
|
+
<th><%= t('ElapsedTime') %></th>
|
20
|
+
<th> </th>
|
21
|
+
</thead>
|
22
|
+
<% @profiles.each do |record| %>
|
23
|
+
<tr>
|
24
|
+
<td><%= relative_time(record.started_at) %></td>
|
25
|
+
<td><%= record.type %> </td>
|
26
|
+
<td><%= record.jid %> </td>
|
27
|
+
<td><%= record.token %> </td>
|
28
|
+
<td><%= format_memory(record.size / 1024) %> </td>
|
29
|
+
<td><%= number_with_delimiter(record.elapsed, precision: 2) %> </td>
|
30
|
+
<td>
|
31
|
+
<% if config[:profile_store_url] %>
|
32
|
+
<a target="_blank" class="btn" href="<%= root_path %>profiles/<%= CGI.escape(record.key) %>"><%= t("View") %></a>
|
33
|
+
<% end %>
|
34
|
+
<a class="btn" href="<%= root_path %>profiles/<%= CGI.escape(record.key) %>/data"><%= t("Data") %></a>
|
35
|
+
</td>
|
36
|
+
</tr>
|
37
|
+
<% end %>
|
38
|
+
</table>
|
39
|
+
</div>
|
40
|
+
<% else %>
|
41
|
+
<div class="alert alert-success"><%= t('NoDataFound') %></div>
|
42
|
+
<% end %>
|
43
|
+
</section>
|
data/web/views/queue.erb
CHANGED
@@ -1,46 +1,57 @@
|
|
1
|
-
<
|
2
|
-
<
|
3
|
-
<
|
4
|
-
<%= t('CurrentMessagesInQueue', :queue => h(@name)) %>
|
1
|
+
<section>
|
2
|
+
<header>
|
3
|
+
<h1><%= t('CurrentMessagesInQueue', :queue => h(@name)) %>
|
5
4
|
<% if @queue.paused? %>
|
6
5
|
<span class="label label-danger"><%= t('Paused') %></span>
|
7
6
|
<% end %>
|
8
7
|
<span class="badge badge-secondary"><%= number_with_delimiter(@total_size) %></span>
|
9
|
-
</
|
10
|
-
</div>
|
11
|
-
<div class="col-sm-4 pull-right flip">
|
8
|
+
</h1>
|
12
9
|
<%= erb :_paging, locals: { url: "#{root_path}queues/#{CGI.escape(@name)}" } %>
|
13
|
-
</
|
14
|
-
|
15
|
-
<div class="table_container">
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
<
|
26
|
-
<%
|
27
|
-
|
28
|
-
<span class="worker_<%= index %>"><%= h(a.inspect[0..100]) + "... " %></span>
|
29
|
-
<button data-toggle="collapse" data-target=".worker_<%= index %>" class="btn btn-default btn-xs"><%= t('ShowAll') %></button>
|
30
|
-
<div class="toggle worker_<%= index %>"><%= display_args(a) %></div>
|
10
|
+
</header>
|
11
|
+
|
12
|
+
<div class="table_container">
|
13
|
+
<table>
|
14
|
+
<thead>
|
15
|
+
<th><a href="<%= url %>?direction=<%= url_params("direction") == 'asc' ? 'desc' : 'asc' %>"># <%= sort_direction_label %></a></th>
|
16
|
+
<th><%= t('Job') %></th>
|
17
|
+
<th><%= t('Arguments') %></th>
|
18
|
+
<th><%= t('Context') %></th>
|
19
|
+
<th><%= t('Actions') %></th>
|
20
|
+
</thead>
|
21
|
+
<% @jobs.each_with_index do |job, index| %>
|
22
|
+
<tr title="<%= job.jid %>">
|
23
|
+
<% if url_params("direction") == 'asc' %>
|
24
|
+
<td><%= @count * (@current_page - 1) + index + 1 %></td>
|
31
25
|
<% else %>
|
32
|
-
|
26
|
+
<td><%= @total_size - (@count * (@current_page - 1) + index) %></td>
|
33
27
|
<% end %>
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
28
|
+
<td>
|
29
|
+
<%= h(job.display_class) %>
|
30
|
+
<%= display_tags(job, nil) %>
|
31
|
+
</td>
|
32
|
+
<td>
|
33
|
+
<% a = job.display_args %>
|
34
|
+
<% if a.inspect.size > 100 %>
|
35
|
+
<span id="job_<%= index %>"><%= h(a.inspect[0..100]) + "... " %></span>
|
36
|
+
<button data-toggle="job_<%= index %>_full" class="btn btn-default btn-xs"><%= t('ShowAll') %></button>
|
37
|
+
<div class="toggle" id="job_<%= index %>_full"><%= display_args(a) %></div>
|
38
|
+
<% else %>
|
39
|
+
<code><%= display_args(job.display_args) %></code>
|
40
|
+
<% end %>
|
41
|
+
</td>
|
42
|
+
<td>
|
43
|
+
<%= h(job["cattr"].inspect) if job["cattr"]&.any? %>
|
44
|
+
</td>
|
45
|
+
<td>
|
46
|
+
<form action="<%= root_path %>queues/<%= CGI.escape(@name) %>/delete" method="post">
|
47
|
+
<%= csrf_tag %>
|
48
|
+
<input name="key_val" value="<%= h job.value %>" type="hidden" />
|
49
|
+
<input class="btn btn-danger" type="submit" name="delete" value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSure') %>" />
|
50
|
+
</form>
|
51
|
+
</td>
|
52
|
+
</tr>
|
53
|
+
<% end %>
|
54
|
+
</table>
|
55
|
+
</div>
|
56
|
+
<%= erb :_paging, locals: { url: "#{root_path}queues/#{CGI.escape(@name)}" } %>
|
57
|
+
</section>
|
data/web/views/queues.erb
CHANGED
@@ -1,30 +1,46 @@
|
|
1
|
-
<
|
1
|
+
<section>
|
2
|
+
<header>
|
3
|
+
<h1><%= t('Queues') %></h1>
|
4
|
+
</header>
|
2
5
|
|
3
|
-
<div class="table_container">
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
<%=
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
6
|
+
<div class="table_container">
|
7
|
+
<table>
|
8
|
+
<thead>
|
9
|
+
<th><%= t('Queue') %></th>
|
10
|
+
<th><%= t('Size') %></th>
|
11
|
+
<th><%= t('Latency') %></th>
|
12
|
+
<th><%= t('Actions') %></th>
|
13
|
+
</thead>
|
14
|
+
<% @queues.each do |queue| %>
|
15
|
+
<tr>
|
16
|
+
<td>
|
17
|
+
<a href="<%= root_path %>queues/<%= CGI.escape(queue.name) %>"><%= h queue.name %></a>
|
18
|
+
<% if queue.paused? %>
|
19
|
+
<span class="label label-danger"><%= t('Paused') %></span>
|
20
|
+
<% end %>
|
21
|
+
</td>
|
22
|
+
<td class="num"><%= number_with_delimiter(queue.size) %> </td>
|
23
|
+
<td class="num">
|
24
|
+
<% queue_latency = queue.latency %>
|
25
|
+
<%= (queue_latency < 60) ? '' : " (#{relative_time(Time.at(Time.now.to_f - queue_latency))})" %>
|
26
|
+
<%= number_with_delimiter(queue_latency, precision: 2) %>
|
27
|
+
</td>
|
28
|
+
<td class="delete-confirm">
|
29
|
+
<form action="<%=root_path %>queues/<%= CGI.escape(queue.name) %>" method="post">
|
30
|
+
<%= csrf_tag %>
|
31
|
+
<input class="btn btn-danger" type="submit" name="delete" title="This will delete all jobs within the queue, it will reappear if you push more jobs to it in the future." value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSureDeleteQueue', :queue => h(queue.name)) %>" />
|
32
|
+
|
33
|
+
<% if Sidekiq.pro? %>
|
34
|
+
<% if queue.paused? %>
|
35
|
+
<input class="btn btn-danger" type="submit" name="unpause" value="<%= t('Unpause') %>" />
|
36
|
+
<% else %>
|
37
|
+
<input class="btn btn-danger" type="submit" name="pause" value="<%= t('Pause') %>" />
|
38
|
+
<% end %>
|
39
|
+
<% end %>
|
40
|
+
</form>
|
41
|
+
</td>
|
42
|
+
</tr>
|
43
|
+
<% end %>
|
44
|
+
</table>
|
45
|
+
</div>
|
46
|
+
</section>
|
data/web/views/retries.erb
CHANGED
@@ -1,80 +1,70 @@
|
|
1
|
-
<
|
2
|
-
<
|
3
|
-
<
|
4
|
-
|
5
|
-
<% if @retries.size > 0 && @total_size > @count %>
|
6
|
-
<div class="col-sm-4">
|
1
|
+
<section>
|
2
|
+
<header>
|
3
|
+
<h1><%= t('Retries') %></h1>
|
4
|
+
<% if @retries.size > 0 && @total_size > @count %>
|
7
5
|
<%= erb :_paging, locals: { url: "#{root_path}retries" } %>
|
8
|
-
|
9
|
-
|
10
|
-
|
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 class="table-checkbox checkbox-column">
|
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 %>"><%= entry.queue %></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 flip" type="submit" name="retry" value="<%= t('RetryNow') %>" />
|
59
|
-
<input class="btn btn-danger btn-xs pull-left flip" type="submit" name="delete" value="<%= t('Delete') %>" />
|
60
|
-
<input class="btn btn-danger btn-xs pull-left flip" type="submit" name="kill" value="<%= t('Kill') %>" />
|
61
|
-
</form>
|
6
|
+
<% end %>
|
7
|
+
<%= filtering('retries') %>
|
8
|
+
</header>
|
62
9
|
|
63
|
-
<%
|
64
|
-
<form action="<%= root_path %>retries
|
65
|
-
<%= csrf_tag %>
|
66
|
-
<input class="btn btn-danger btn-xs pull-right flip" type="submit" name="delete" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" />
|
67
|
-
</form>
|
68
|
-
<form action="<%= root_path %>retries/all/retry" method="post">
|
10
|
+
<% if @retries.size > 0 %>
|
11
|
+
<form action="<%= root_path %>retries" method="post">
|
69
12
|
<%= csrf_tag %>
|
70
|
-
<
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
13
|
+
<div class="table_container">
|
14
|
+
<table>
|
15
|
+
<thead>
|
16
|
+
<tr>
|
17
|
+
<th>
|
18
|
+
<label>
|
19
|
+
<input type="checkbox" class="check_all" />
|
20
|
+
</label>
|
21
|
+
</th>
|
22
|
+
<th><%= t('NextRetry') %></th>
|
23
|
+
<th><%= t('RetryCount') %></th>
|
24
|
+
<th><%= t('Queue') %></th>
|
25
|
+
<th><%= t('Job') %></th>
|
26
|
+
<th><%= t('Arguments') %></th>
|
27
|
+
<th><%= t('Error') %></th>
|
28
|
+
</tr>
|
29
|
+
</thead>
|
30
|
+
<% @retries.each do |entry| %>
|
31
|
+
<tr>
|
32
|
+
<td>
|
33
|
+
<label>
|
34
|
+
<input type='checkbox' name='key[]' value='<%= job_params(entry.item, entry.score) %>' class='shift_clickable' />
|
35
|
+
</label>
|
36
|
+
</td>
|
37
|
+
<td>
|
38
|
+
<a href="<%= root_path %>retries/<%= job_params(entry.item, entry.score) %>"><%= relative_time(entry.at) %></a>
|
39
|
+
</td>
|
40
|
+
<td><%= entry['retry_count'] %></td>
|
41
|
+
<td>
|
42
|
+
<a href="<%= root_path %>queues/<%= entry.queue %>"><%= entry.queue %></a>
|
43
|
+
</td>
|
44
|
+
<td>
|
45
|
+
<%= entry.display_class %>
|
46
|
+
<%= display_tags(entry, "retries") %>
|
47
|
+
</td>
|
48
|
+
<td>
|
49
|
+
<code>
|
50
|
+
<div class="args"><%= display_args(entry.display_args) %></div>
|
51
|
+
</code>
|
52
|
+
</td>
|
53
|
+
<td>
|
54
|
+
<div><a href="<%= root_path %>retries/<%= job_params(entry.item, entry.score) %>"><%= h truncate("#{entry['error_class']}: #{entry['error_message']}", 200) %></a></div>
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<% end %>
|
58
|
+
</table>
|
59
|
+
</div>
|
60
|
+
<div class="buttons-row">
|
61
|
+
<input class="btn btn-primary" type="submit" name="retry" value="<%= t('RetryNow') %>" />
|
62
|
+
<input class="btn btn-danger" type="submit" name="delete" value="<%= t('Delete') %>" />
|
63
|
+
<input class="btn btn-danger" type="submit" name="kill" value="<%= t('Kill') %>" />
|
64
|
+
</div>
|
75
65
|
</form>
|
66
|
+
|
67
|
+
<% else %>
|
68
|
+
<div class="alert alert-success"><%= t('NoRetriesFound') %></div>
|
76
69
|
<% end %>
|
77
|
-
|
78
|
-
<% else %>
|
79
|
-
<div class="alert alert-success"><%= t('NoRetriesFound') %></div>
|
80
|
-
<% end %>
|
70
|
+
</section>
|
data/web/views/retry.erb
CHANGED
@@ -1,34 +1,39 @@
|
|
1
1
|
<%= erb :_job_info, locals: { job: @retry, type: :retry } %>
|
2
2
|
|
3
|
-
<
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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? %>
|
3
|
+
<section>
|
4
|
+
<header>
|
5
|
+
<h2><%= t('Error') %></h2>
|
6
|
+
</header>
|
7
|
+
|
8
|
+
<div class="table_container">
|
9
|
+
<table>
|
10
|
+
<tbody>
|
18
11
|
<tr>
|
19
|
-
<th><%= t('
|
12
|
+
<th><%= t('ErrorClass') %></th>
|
20
13
|
<td>
|
21
|
-
<code><%= @retry['
|
14
|
+
<code><%= h @retry['error_class'] %></code>
|
22
15
|
</td>
|
23
16
|
</tr>
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
</
|
17
|
+
<tr>
|
18
|
+
<th><%= t('ErrorMessage') %></th>
|
19
|
+
<td><%= h(@retry['error_message']) %></td>
|
20
|
+
</tr>
|
21
|
+
<% if @retry.error_backtrace %>
|
22
|
+
<tr>
|
23
|
+
<th><%= t('ErrorBacktrace') %></th>
|
24
|
+
<td>
|
25
|
+
<code><%= @retry.error_backtrace.join("<br/>") %></code>
|
26
|
+
</td>
|
27
|
+
</tr>
|
28
|
+
<% end %>
|
29
|
+
</tbody>
|
30
|
+
</table>
|
31
|
+
</div>
|
28
32
|
|
29
|
-
<form
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
</form>
|
33
|
+
<form action="<%= root_path %>retries/<%= job_params(@retry, @retry.score) %>" method="post">
|
34
|
+
<%= csrf_tag %>
|
35
|
+
<a class="btn btn-default" href="<%= root_path %>retries"><%= t('GoBack') %></a>
|
36
|
+
<input class="btn btn-primary" type="submit" name="retry" value="<%= t('RetryNow') %>" />
|
37
|
+
<input class="btn btn-danger" type="submit" name="delete" value="<%= t('Delete') %>" />
|
38
|
+
</form>
|
39
|
+
</section>
|