sidekiq 0.10.0 → 7.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Changes.md +2047 -0
- data/LICENSE.txt +9 -0
- data/README.md +73 -27
- data/bin/sidekiq +25 -9
- data/bin/sidekiqload +247 -0
- data/bin/sidekiqmon +11 -0
- data/lib/generators/sidekiq/job_generator.rb +57 -0
- data/lib/generators/sidekiq/templates/job.rb.erb +9 -0
- data/lib/generators/sidekiq/templates/job_spec.rb.erb +6 -0
- data/lib/generators/sidekiq/templates/job_test.rb.erb +8 -0
- data/lib/sidekiq/api.rb +1145 -0
- data/lib/sidekiq/capsule.rb +127 -0
- data/lib/sidekiq/cli.rb +348 -109
- data/lib/sidekiq/client.rb +241 -41
- data/lib/sidekiq/component.rb +68 -0
- data/lib/sidekiq/config.rb +287 -0
- data/lib/sidekiq/deploy.rb +62 -0
- data/lib/sidekiq/embedded.rb +61 -0
- data/lib/sidekiq/fetch.rb +88 -0
- data/lib/sidekiq/job.rb +374 -0
- data/lib/sidekiq/job_logger.rb +51 -0
- data/lib/sidekiq/job_retry.rb +300 -0
- data/lib/sidekiq/job_util.rb +107 -0
- data/lib/sidekiq/launcher.rb +271 -0
- data/lib/sidekiq/logger.rb +131 -0
- data/lib/sidekiq/manager.rb +96 -103
- data/lib/sidekiq/metrics/query.rb +153 -0
- data/lib/sidekiq/metrics/shared.rb +95 -0
- data/lib/sidekiq/metrics/tracking.rb +136 -0
- data/lib/sidekiq/middleware/chain.rb +149 -38
- data/lib/sidekiq/middleware/current_attributes.rb +95 -0
- data/lib/sidekiq/middleware/i18n.rb +42 -0
- data/lib/sidekiq/middleware/modules.rb +21 -0
- data/lib/sidekiq/monitor.rb +146 -0
- data/lib/sidekiq/paginator.rb +55 -0
- data/lib/sidekiq/processor.rb +246 -61
- data/lib/sidekiq/rails.rb +60 -13
- data/lib/sidekiq/redis_client_adapter.rb +95 -0
- data/lib/sidekiq/redis_connection.rb +68 -15
- data/lib/sidekiq/ring_buffer.rb +29 -0
- data/lib/sidekiq/scheduled.rb +236 -0
- data/lib/sidekiq/sd_notify.rb +149 -0
- data/lib/sidekiq/systemd.rb +24 -0
- data/lib/sidekiq/testing/inline.rb +30 -0
- data/lib/sidekiq/testing.rb +304 -10
- data/lib/sidekiq/transaction_aware_client.rb +44 -0
- data/lib/sidekiq/version.rb +4 -1
- data/lib/sidekiq/web/action.rb +93 -0
- data/lib/sidekiq/web/application.rb +447 -0
- data/lib/sidekiq/web/csrf_protection.rb +180 -0
- data/lib/sidekiq/web/helpers.rb +370 -0
- data/lib/sidekiq/web/router.rb +104 -0
- data/lib/sidekiq/web.rb +143 -74
- data/lib/sidekiq/worker_compatibility_alias.rb +13 -0
- data/lib/sidekiq.rb +120 -73
- data/sidekiq.gemspec +26 -23
- data/web/assets/images/apple-touch-icon.png +0 -0
- data/web/assets/images/favicon.ico +0 -0
- data/web/assets/images/logo.png +0 -0
- data/web/assets/images/status.png +0 -0
- data/web/assets/javascripts/application.js +162 -3
- data/web/assets/javascripts/base-charts.js +106 -0
- data/web/assets/javascripts/chart.min.js +13 -0
- data/web/assets/javascripts/chartjs-plugin-annotation.min.js +7 -0
- data/web/assets/javascripts/dashboard-charts.js +168 -0
- data/web/assets/javascripts/dashboard.js +59 -0
- data/web/assets/javascripts/metrics.js +264 -0
- data/web/assets/stylesheets/application-dark.css +147 -0
- data/web/assets/stylesheets/application-rtl.css +153 -0
- data/web/assets/stylesheets/application.css +720 -7
- data/web/assets/stylesheets/bootstrap-rtl.min.css +9 -0
- data/web/assets/stylesheets/bootstrap.css +5 -0
- data/web/locales/ar.yml +87 -0
- data/web/locales/cs.yml +78 -0
- data/web/locales/da.yml +75 -0
- data/web/locales/de.yml +81 -0
- data/web/locales/el.yml +87 -0
- data/web/locales/en.yml +101 -0
- data/web/locales/es.yml +86 -0
- data/web/locales/fa.yml +80 -0
- data/web/locales/fr.yml +99 -0
- data/web/locales/gd.yml +99 -0
- data/web/locales/he.yml +80 -0
- data/web/locales/hi.yml +75 -0
- data/web/locales/it.yml +69 -0
- data/web/locales/ja.yml +91 -0
- data/web/locales/ko.yml +68 -0
- data/web/locales/lt.yml +83 -0
- data/web/locales/nb.yml +77 -0
- data/web/locales/nl.yml +68 -0
- data/web/locales/pl.yml +59 -0
- data/web/locales/pt-br.yml +96 -0
- data/web/locales/pt.yml +67 -0
- data/web/locales/ru.yml +83 -0
- data/web/locales/sv.yml +68 -0
- data/web/locales/ta.yml +75 -0
- data/web/locales/uk.yml +77 -0
- data/web/locales/ur.yml +80 -0
- data/web/locales/vi.yml +83 -0
- data/web/locales/zh-cn.yml +95 -0
- data/web/locales/zh-tw.yml +102 -0
- data/web/views/_footer.erb +23 -0
- data/web/views/_job_info.erb +105 -0
- data/web/views/_metrics_period_select.erb +12 -0
- data/web/views/_nav.erb +52 -0
- data/web/views/_paging.erb +25 -0
- data/web/views/_poll_link.erb +4 -0
- data/web/views/_status.erb +4 -0
- data/web/views/_summary.erb +40 -0
- data/web/views/busy.erb +148 -0
- data/web/views/dashboard.erb +115 -0
- data/web/views/dead.erb +34 -0
- data/web/views/filtering.erb +7 -0
- data/web/views/layout.erb +42 -0
- data/web/views/metrics.erb +82 -0
- data/web/views/metrics_for_job.erb +68 -0
- data/web/views/morgue.erb +74 -0
- data/web/views/queue.erb +55 -0
- data/web/views/queues.erb +40 -0
- data/web/views/retries.erb +79 -0
- data/web/views/retry.erb +34 -0
- data/web/views/scheduled.erb +56 -0
- data/web/views/scheduled_job_info.erb +8 -0
- metadata +159 -237
- data/.gitignore +0 -6
- data/.rvmrc +0 -4
- data/COMM-LICENSE +0 -75
- data/Gemfile +0 -10
- data/LICENSE +0 -22
- data/Rakefile +0 -9
- data/TODO.md +0 -1
- data/bin/client +0 -7
- data/bin/sidekiqctl +0 -43
- data/config.ru +0 -8
- data/examples/chef/cookbooks/sidekiq/README.rdoc +0 -11
- data/examples/chef/cookbooks/sidekiq/recipes/default.rb +0 -55
- data/examples/chef/cookbooks/sidekiq/templates/default/monitrc.conf.erb +0 -8
- data/examples/chef/cookbooks/sidekiq/templates/default/sidekiq.erb +0 -219
- data/examples/chef/cookbooks/sidekiq/templates/default/sidekiq.yml.erb +0 -22
- data/examples/config.yml +0 -9
- data/examples/monitrc.conf +0 -6
- data/examples/por.rb +0 -27
- data/examples/scheduling.rb +0 -37
- data/examples/sinkiq.rb +0 -57
- data/examples/web-ui.png +0 -0
- data/lib/sidekiq/capistrano.rb +0 -32
- data/lib/sidekiq/extensions/action_mailer.rb +0 -26
- data/lib/sidekiq/extensions/active_record.rb +0 -27
- data/lib/sidekiq/extensions/generic_proxy.rb +0 -21
- data/lib/sidekiq/middleware/client/unique_jobs.rb +0 -32
- data/lib/sidekiq/middleware/server/active_record.rb +0 -13
- data/lib/sidekiq/middleware/server/exception_handler.rb +0 -38
- data/lib/sidekiq/middleware/server/failure_jobs.rb +0 -24
- data/lib/sidekiq/middleware/server/logging.rb +0 -27
- data/lib/sidekiq/middleware/server/retry_jobs.rb +0 -59
- data/lib/sidekiq/middleware/server/unique_jobs.rb +0 -15
- data/lib/sidekiq/retry.rb +0 -57
- data/lib/sidekiq/util.rb +0 -61
- data/lib/sidekiq/worker.rb +0 -37
- data/myapp/.gitignore +0 -15
- data/myapp/Capfile +0 -5
- data/myapp/Gemfile +0 -19
- data/myapp/Gemfile.lock +0 -143
- data/myapp/Rakefile +0 -7
- data/myapp/app/controllers/application_controller.rb +0 -3
- data/myapp/app/controllers/work_controller.rb +0 -38
- data/myapp/app/helpers/application_helper.rb +0 -2
- data/myapp/app/mailers/.gitkeep +0 -0
- data/myapp/app/mailers/user_mailer.rb +0 -9
- data/myapp/app/models/.gitkeep +0 -0
- data/myapp/app/models/post.rb +0 -5
- data/myapp/app/views/layouts/application.html.erb +0 -14
- data/myapp/app/views/user_mailer/greetings.html.erb +0 -3
- data/myapp/app/views/work/index.html.erb +0 -1
- data/myapp/app/workers/hard_worker.rb +0 -9
- data/myapp/config/application.rb +0 -59
- data/myapp/config/boot.rb +0 -6
- data/myapp/config/database.yml +0 -25
- data/myapp/config/deploy.rb +0 -15
- data/myapp/config/environment.rb +0 -5
- data/myapp/config/environments/development.rb +0 -38
- data/myapp/config/environments/production.rb +0 -67
- data/myapp/config/environments/test.rb +0 -37
- data/myapp/config/initializers/backtrace_silencers.rb +0 -7
- data/myapp/config/initializers/inflections.rb +0 -15
- data/myapp/config/initializers/mime_types.rb +0 -5
- data/myapp/config/initializers/secret_token.rb +0 -7
- data/myapp/config/initializers/session_store.rb +0 -8
- data/myapp/config/initializers/sidekiq.rb +0 -6
- data/myapp/config/initializers/wrap_parameters.rb +0 -14
- data/myapp/config/locales/en.yml +0 -5
- data/myapp/config/routes.rb +0 -10
- data/myapp/config.ru +0 -4
- data/myapp/db/migrate/20120123214055_create_posts.rb +0 -10
- data/myapp/db/seeds.rb +0 -7
- data/myapp/lib/assets/.gitkeep +0 -0
- data/myapp/lib/tasks/.gitkeep +0 -0
- data/myapp/log/.gitkeep +0 -0
- data/myapp/script/rails +0 -6
- data/test/config.yml +0 -9
- data/test/fake_env.rb +0 -0
- data/test/helper.rb +0 -15
- data/test/test_cli.rb +0 -168
- data/test/test_client.rb +0 -105
- data/test/test_extensions.rb +0 -68
- data/test/test_manager.rb +0 -43
- data/test/test_middleware.rb +0 -92
- data/test/test_processor.rb +0 -32
- data/test/test_retry.rb +0 -83
- data/test/test_stats.rb +0 -78
- data/test/test_testing.rb +0 -65
- data/test/test_web.rb +0 -61
- data/web/assets/images/bootstrap/glyphicons-halflings-white.png +0 -0
- data/web/assets/images/bootstrap/glyphicons-halflings.png +0 -0
- data/web/assets/javascripts/vendor/bootstrap/bootstrap-alert.js +0 -91
- data/web/assets/javascripts/vendor/bootstrap/bootstrap-button.js +0 -98
- data/web/assets/javascripts/vendor/bootstrap/bootstrap-carousel.js +0 -154
- data/web/assets/javascripts/vendor/bootstrap/bootstrap-collapse.js +0 -136
- data/web/assets/javascripts/vendor/bootstrap/bootstrap-dropdown.js +0 -92
- data/web/assets/javascripts/vendor/bootstrap/bootstrap-modal.js +0 -210
- data/web/assets/javascripts/vendor/bootstrap/bootstrap-popover.js +0 -95
- data/web/assets/javascripts/vendor/bootstrap/bootstrap-scrollspy.js +0 -125
- data/web/assets/javascripts/vendor/bootstrap/bootstrap-tab.js +0 -130
- data/web/assets/javascripts/vendor/bootstrap/bootstrap-tooltip.js +0 -270
- data/web/assets/javascripts/vendor/bootstrap/bootstrap-transition.js +0 -51
- data/web/assets/javascripts/vendor/bootstrap/bootstrap-typeahead.js +0 -271
- data/web/assets/javascripts/vendor/bootstrap.js +0 -12
- data/web/assets/javascripts/vendor/jquery.js +0 -9266
- data/web/assets/stylesheets/vendor/bootstrap-responsive.css +0 -567
- data/web/assets/stylesheets/vendor/bootstrap.css +0 -3365
- data/web/views/index.slim +0 -62
- data/web/views/layout.slim +0 -24
- data/web/views/queue.slim +0 -11
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 table-hover">
|
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 %>
|
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,7 @@
|
|
1
|
+
<div class="sm-col-3 pull-right" style="display: inline; margin: 25px 15px 0 0;">
|
2
|
+
<%= t('Filter') %>:
|
3
|
+
<form method="POST" action='<%= root_path %>filter/<%= which %>' style="display: inline-block">
|
4
|
+
<%= csrf_tag %>
|
5
|
+
<input class="search" type="search" name="substr" value="<%= h params[:substr] %>" placeholder="<%= t('AnyJobContent') %>"/>
|
6
|
+
</form>
|
7
|
+
</div>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html dir="<%= text_direction %>">
|
3
|
+
<head>
|
4
|
+
<title><%= environment_title_prefix %><%= Sidekiq::NAME %></title>
|
5
|
+
<meta charset="utf-8" />
|
6
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
7
|
+
|
8
|
+
<link href="<%= root_path %>stylesheets/bootstrap.css" media="screen" rel="stylesheet" type="text/css" />
|
9
|
+
<% if rtl? %>
|
10
|
+
<link href="<%= root_path %>stylesheets/bootstrap-rtl.min.css" media="screen" rel="stylesheet" type="text/css"/>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<link href="<%= root_path %>stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
|
14
|
+
<link href="<%= root_path %>stylesheets/application-dark.css" media="screen and (prefers-color-scheme: dark)" rel="stylesheet" type="text/css" />
|
15
|
+
<% if rtl? %>
|
16
|
+
<link href="<%= root_path %>stylesheets/application-rtl.css" media="screen" rel="stylesheet" type="text/css" />
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<link rel="apple-touch-icon" href="<%= root_path %>images/apple-touch-icon.png">
|
20
|
+
<link rel="shortcut icon" type="image/ico" href="<%= root_path %>images/favicon.ico" />
|
21
|
+
<script type="text/javascript" src="<%= root_path %>javascripts/application.js"></script>
|
22
|
+
<meta name="google" content="notranslate" />
|
23
|
+
<%= display_custom_head %>
|
24
|
+
</head>
|
25
|
+
<body class="admin" data-locale="<%= locale %>">
|
26
|
+
<%= erb :_nav %>
|
27
|
+
<div id="page">
|
28
|
+
<div class="container">
|
29
|
+
<div class="row">
|
30
|
+
<div class="col-sm-12 summary_bar">
|
31
|
+
<%= erb :_summary %>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<div class="col-sm-12">
|
35
|
+
<%= yield %>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
<%= erb :_footer %>
|
41
|
+
</body>
|
42
|
+
</html>
|
@@ -0,0 +1,82 @@
|
|
1
|
+
<script type="text/javascript" src="<%= root_path %>javascripts/chart.min.js"></script>
|
2
|
+
<script type="text/javascript" src="<%= root_path %>javascripts/chartjs-plugin-annotation.min.js"></script>
|
3
|
+
<script type="text/javascript" src="<%= root_path %>javascripts/base-charts.js"></script>
|
4
|
+
<script type="text/javascript" src="<%= root_path %>javascripts/metrics.js"></script>
|
5
|
+
|
6
|
+
<div class="header-container">
|
7
|
+
<div class="page-title-container">
|
8
|
+
<h1><%= t('Metrics') %></h1>
|
9
|
+
|
10
|
+
<a target="blank" href="https://github.com/sidekiq/sidekiq/wiki/Metrics"><span class="info-circle" title="Click to learn more about metrics">?</span></a>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<%= erb :_metrics_period_select, locals: { periods: @periods, period: @period, path: "#{root_path}metrics" } %>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<%
|
17
|
+
table_limit = 20
|
18
|
+
chart_limit = 5
|
19
|
+
job_results = @query_result.job_results.sort_by { |(kls, jr)| jr.totals["s"] }.reverse.first(table_limit)
|
20
|
+
visible_kls = job_results.first(chart_limit).map(&:first)
|
21
|
+
%>
|
22
|
+
|
23
|
+
<% if job_results.any? %>
|
24
|
+
<canvas id="job-metrics-overview-chart"></canvas>
|
25
|
+
|
26
|
+
<script>
|
27
|
+
window.jobMetricsChart = new JobMetricsOverviewChart(
|
28
|
+
document.getElementById("job-metrics-overview-chart"),
|
29
|
+
<%= Sidekiq.dump_json({
|
30
|
+
series: job_results.map { |(kls, jr)| [kls, jr.dig("series", "s")] }.to_h,
|
31
|
+
marks: @query_result.marks.map { |m| [m.bucket, m.label] },
|
32
|
+
labels: @query_result.buckets,
|
33
|
+
visibleKls: visible_kls,
|
34
|
+
yLabel: t('TotalExecutionTime'),
|
35
|
+
units: t('Seconds').downcase,
|
36
|
+
markLabel: t('Deploy'),
|
37
|
+
}) %>
|
38
|
+
)
|
39
|
+
</script>
|
40
|
+
<% end %>
|
41
|
+
|
42
|
+
<div class="table_container">
|
43
|
+
<table class="table table-bordered table-striped table-hover">
|
44
|
+
<tbody>
|
45
|
+
<tr>
|
46
|
+
<th><%= t('Name') %></th>
|
47
|
+
<th><%= t('Success') %></th>
|
48
|
+
<th><%= t('Failure') %></th>
|
49
|
+
<th><%= t('TotalExecutionTime') %></th>
|
50
|
+
<th><%= t('AvgExecutionTime') %></th>
|
51
|
+
</tr>
|
52
|
+
<% if job_results.any? %>
|
53
|
+
<% job_results.each_with_index do |(kls, jr), i| %>
|
54
|
+
<tr>
|
55
|
+
<td>
|
56
|
+
<div class="metrics-swatch-wrapper">
|
57
|
+
<% id = "metrics-swatch-#{kls}" %>
|
58
|
+
<input
|
59
|
+
type="checkbox"
|
60
|
+
id="<%= id %>"
|
61
|
+
class="metrics-swatch"
|
62
|
+
value="<%= kls %>"
|
63
|
+
<%= visible_kls.include?(kls) ? 'checked' : '' %>
|
64
|
+
/>
|
65
|
+
<code><a href="<%= root_path %>metrics/<%= kls %>?period=<%= @period %>"><%= kls %></a></code>
|
66
|
+
</div>
|
67
|
+
<script>jobMetricsChart.registerSwatch("<%= id %>")</script>
|
68
|
+
</td>
|
69
|
+
<td><%= jr.dig("totals", "p") - jr.dig("totals", "f") %></td>
|
70
|
+
<td><%= jr.dig("totals", "f") %></td>
|
71
|
+
<td><%= jr.dig("totals", "s").round(2) %> seconds</td>
|
72
|
+
<td><%= jr.total_avg("s").round(2) %> seconds</td>
|
73
|
+
</tr>
|
74
|
+
<% end %>
|
75
|
+
<% else %>
|
76
|
+
<tr><td colspan=5><%= t("NoDataFound") %></td></tr>
|
77
|
+
<% end %>
|
78
|
+
</tbody>
|
79
|
+
</table>
|
80
|
+
</div>
|
81
|
+
|
82
|
+
<p><small>Data from <%= @query_result.starts_at %> to <%= @query_result.ends_at %></small></p>
|
@@ -0,0 +1,68 @@
|
|
1
|
+
<script type="text/javascript" src="<%= root_path %>javascripts/chart.min.js"></script>
|
2
|
+
<script type="text/javascript" src="<%= root_path %>javascripts/chartjs-plugin-annotation.min.js"></script>
|
3
|
+
<script type="text/javascript" src="<%= root_path %>javascripts/base-charts.js"></script>
|
4
|
+
<script type="text/javascript" src="<%= root_path %>javascripts/metrics.js"></script>
|
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
|
+
|
13
|
+
<% if job_result.totals["s"] > 0 %>
|
14
|
+
<div class="header-container">
|
15
|
+
<div class="page-title-container">
|
16
|
+
<h1>
|
17
|
+
<a href="<%= root_path %>metrics?period=<%= @period %>"><%= t('Metrics') %></a> /
|
18
|
+
<%= h @name %>
|
19
|
+
</h1>
|
20
|
+
|
21
|
+
<a target="blank" href="https://github.com/sidekiq/sidekiq/wiki/Metrics"><span class="info-circle" title="Click to learn more about metrics">?</span></a>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<%= erb :_metrics_period_select, locals: { periods: @periods, period: @period, path: "#{root_path}metrics/#{@name}" } %>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<canvas id="hist-totals-chart"></canvas>
|
28
|
+
|
29
|
+
<script>
|
30
|
+
window.histTotalsChart = new HistTotalsChart(
|
31
|
+
document.getElementById("hist-totals-chart"),
|
32
|
+
<%= Sidekiq.dump_json({
|
33
|
+
series: hist_totals,
|
34
|
+
labels: bucket_labels,
|
35
|
+
xLabel: t('ExecutionTime'),
|
36
|
+
yLabel: t('Jobs'),
|
37
|
+
units: t('Jobs').downcase,
|
38
|
+
}) %>
|
39
|
+
)
|
40
|
+
</script>
|
41
|
+
|
42
|
+
<canvas id="hist-bubble-chart"></canvas>
|
43
|
+
|
44
|
+
<script>
|
45
|
+
window.histBubbleChart = new HistBubbleChart(
|
46
|
+
document.getElementById("hist-bubble-chart"),
|
47
|
+
<%= Sidekiq.dump_json({
|
48
|
+
hist: job_result.hist,
|
49
|
+
marks: @query_result.marks.map { |m| [m.bucket, m.label] },
|
50
|
+
labels: @query_result.buckets,
|
51
|
+
histIntervals: bucket_intervals,
|
52
|
+
yLabel: t('ExecutionTime'),
|
53
|
+
markLabel: t('Deploy'),
|
54
|
+
yUnits: t('Seconds').downcase,
|
55
|
+
zUnits: t('Jobs').downcase,
|
56
|
+
}) %>
|
57
|
+
)
|
58
|
+
</script>
|
59
|
+
|
60
|
+
<p><small>Data from <%= @query_result.starts_at %> to <%= @query_result.ends_at %></small></p>
|
61
|
+
<% else %>
|
62
|
+
<h1>
|
63
|
+
<a href="<%= root_path %>/metrics"><%= t('Metrics') %></a> /
|
64
|
+
<%= h @name %>
|
65
|
+
</h1>
|
66
|
+
|
67
|
+
<div class="alert alert-success"><%= t('NoJobMetricsFound') %></div>
|
68
|
+
<% end %>
|
@@ -0,0 +1,74 @@
|
|
1
|
+
<div class="header-container">
|
2
|
+
<h1><%= t('DeadJobs') %></h1>
|
3
|
+
<% if @dead.size > 0 && @total_size > @count %>
|
4
|
+
<%= erb :_paging, locals: { url: "#{root_path}morgue" } %>
|
5
|
+
<% end %>
|
6
|
+
<%= filtering('dead') %>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<% if @dead.size > 0 %>
|
10
|
+
<form action="<%= root_path %>morgue" method="post">
|
11
|
+
<%= csrf_tag %>
|
12
|
+
<div class="table_container">
|
13
|
+
<table class="table table-striped table-bordered table-hover">
|
14
|
+
<thead>
|
15
|
+
<tr>
|
16
|
+
<th class="table-checkbox checkbox-column">
|
17
|
+
<label>
|
18
|
+
<input type="checkbox" class="check_all" />
|
19
|
+
</label>
|
20
|
+
</th>
|
21
|
+
<th><%= t('LastRetry') %></th>
|
22
|
+
<th><%= t('Queue') %></th>
|
23
|
+
<th><%= t('Job') %></th>
|
24
|
+
<th><%= t('Arguments') %></th>
|
25
|
+
<th><%= t('Error') %></th>
|
26
|
+
</tr>
|
27
|
+
</thead>
|
28
|
+
<% @dead.each do |entry| %>
|
29
|
+
<tr>
|
30
|
+
<td class="table-checkbox">
|
31
|
+
<label>
|
32
|
+
<input type='checkbox' name='key[]' value='<%= job_params(entry.item, entry.score) %>' class='shift_clickable' />
|
33
|
+
</label>
|
34
|
+
</td>
|
35
|
+
<td>
|
36
|
+
<a href="<%= root_path %>morgue/<%= job_params(entry.item, entry.score) %>"><%= relative_time(entry.at) %></a>
|
37
|
+
</td>
|
38
|
+
<td>
|
39
|
+
<a href="<%= root_path %>queues/<%= entry.queue %>"><%= entry.queue %></a>
|
40
|
+
</td>
|
41
|
+
<td>
|
42
|
+
<%= entry.display_class %>
|
43
|
+
<%= display_tags(entry, "dead") %>
|
44
|
+
</td>
|
45
|
+
<td>
|
46
|
+
<div class="args"><%= display_args(entry.display_args) %></div>
|
47
|
+
</td>
|
48
|
+
<td>
|
49
|
+
<% if entry.error? %>
|
50
|
+
<div><%= h truncate("#{entry['error_class']}: #{entry['error_message']}", 200) %></div>
|
51
|
+
<% end %>
|
52
|
+
</td>
|
53
|
+
</tr>
|
54
|
+
<% end %>
|
55
|
+
</table>
|
56
|
+
</div>
|
57
|
+
<input class="btn btn-primary pull-left flip" type="submit" name="retry" value="<%= t('RetryNow') %>" />
|
58
|
+
<input class="btn btn-danger pull-left flip" type="submit" name="delete" value="<%= t('Delete') %>" />
|
59
|
+
</form>
|
60
|
+
|
61
|
+
<% unfiltered? do %>
|
62
|
+
<form action="<%= root_path %>morgue/all/delete" method="post">
|
63
|
+
<%= csrf_tag %>
|
64
|
+
<input class="btn btn-danger pull-right flip" type="submit" name="delete" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" />
|
65
|
+
</form>
|
66
|
+
<form action="<%= root_path %>morgue/all/retry" method="post">
|
67
|
+
<%= csrf_tag %>
|
68
|
+
<input class="btn btn-danger pull-right flip" type="submit" name="retry" value="<%= t('RetryAll') %>" data-confirm="<%= t('AreYouSure') %>" />
|
69
|
+
</form>
|
70
|
+
<% end %>
|
71
|
+
|
72
|
+
<% else %>
|
73
|
+
<div class="alert alert-success"><%= t('NoDeadJobsFound') %></div>
|
74
|
+
<% end %>
|
data/web/views/queue.erb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
<div class="header-container">
|
2
|
+
<h1><%= t('CurrentMessagesInQueue', :queue => h(@name)) %>
|
3
|
+
<% if @queue.paused? %>
|
4
|
+
<span class="label label-danger"><%= t('Paused') %></span>
|
5
|
+
<% end %>
|
6
|
+
<span class="badge badge-secondary"><%= number_with_delimiter(@total_size) %></span>
|
7
|
+
</h1>
|
8
|
+
<%= erb :_paging, locals: { url: "#{root_path}queues/#{CGI.escape(@name)}" } %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="table_container">
|
12
|
+
<table class="queue table table-hover table-bordered table-striped">
|
13
|
+
<thead>
|
14
|
+
<th><a href="<%= url %>?direction=<%= params[:direction] == 'asc' ? 'desc' : 'asc' %>"># <%= sort_direction_label %></a></th>
|
15
|
+
<th><%= t('Job') %></th>
|
16
|
+
<th><%= t('Arguments') %></th>
|
17
|
+
<th><%= t('Context') %></th>
|
18
|
+
<th></th>
|
19
|
+
</thead>
|
20
|
+
<% @jobs.each_with_index do |job, index| %>
|
21
|
+
<tr title="<%= job.jid %>">
|
22
|
+
<% if params[:direction] == 'asc' %>
|
23
|
+
<td><%= @count * (@current_page - 1) + index + 1 %></td>
|
24
|
+
<% else %>
|
25
|
+
<td><%= @total_size - (@count * (@current_page - 1) + index) %></td>
|
26
|
+
<% end %>
|
27
|
+
<td>
|
28
|
+
<%= h(job.display_class) %>
|
29
|
+
<%= display_tags(job, nil) %>
|
30
|
+
</td>
|
31
|
+
<td>
|
32
|
+
<% a = job.display_args %>
|
33
|
+
<% if a.inspect.size > 100 %>
|
34
|
+
<span id="job_<%= index %>"><%= h(a.inspect[0..100]) + "... " %></span>
|
35
|
+
<button data-toggle="job_<%= index %>_full" class="btn btn-default btn-xs"><%= t('ShowAll') %></button>
|
36
|
+
<div class="toggle" id="job_<%= index %>_full"><%= display_args(a) %></div>
|
37
|
+
<% else %>
|
38
|
+
<%= display_args(job.display_args) %>
|
39
|
+
<% end %>
|
40
|
+
</td>
|
41
|
+
<td>
|
42
|
+
<%= h(job["cattr"].inspect) if job["cattr"]&.any? %>
|
43
|
+
</td>
|
44
|
+
<td>
|
45
|
+
<form action="<%= root_path %>queues/<%= CGI.escape(@name) %>/delete" method="post">
|
46
|
+
<%= csrf_tag %>
|
47
|
+
<input name="key_val" value="<%= h job.value %>" type="hidden" />
|
48
|
+
<input class="btn btn-danger btn-xs" type="submit" name="delete" value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSure') %>" />
|
49
|
+
</form>
|
50
|
+
</td>
|
51
|
+
</tr>
|
52
|
+
<% end %>
|
53
|
+
</table>
|
54
|
+
</div>
|
55
|
+
<%= erb :_paging, locals: { url: "#{root_path}queues/#{CGI.escape(@name)}" } %>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<div class="header-container">
|
2
|
+
<h1><%= t('Queues') %></h1>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<div class="table_container">
|
6
|
+
<table class="queues table table-hover table-bordered table-striped">
|
7
|
+
<thead>
|
8
|
+
<th><%= t('Queue') %></th>
|
9
|
+
<th><%= t('Size') %></th>
|
10
|
+
<th><%= t('Latency') %></th>
|
11
|
+
<th><%= t('Actions') %></th>
|
12
|
+
</thead>
|
13
|
+
<% @queues.each do |queue| %>
|
14
|
+
<tr>
|
15
|
+
<td>
|
16
|
+
<a href="<%= root_path %>queues/<%= CGI.escape(queue.name) %>"><%= h queue.name %></a>
|
17
|
+
<% if queue.paused? %>
|
18
|
+
<span class="label label-danger"><%= t('Paused') %></span>
|
19
|
+
<% end %>
|
20
|
+
</td>
|
21
|
+
<td><%= number_with_delimiter(queue.size) %> </td>
|
22
|
+
<td><% queue_latency = queue.latency %><%= number_with_delimiter(queue_latency.round(2)) %><%= (queue_latency < 60) ? '' : " (#{relative_time(Time.at(Time.now.to_f - queue_latency))})" %> </td>
|
23
|
+
<td class="delete-confirm">
|
24
|
+
<form action="<%=root_path %>queues/<%= CGI.escape(queue.name) %>" method="post">
|
25
|
+
<%= csrf_tag %>
|
26
|
+
<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)) %>" />
|
27
|
+
|
28
|
+
<% if Sidekiq.pro? %>
|
29
|
+
<% if queue.paused? %>
|
30
|
+
<input class="btn btn-danger" type="submit" name="unpause" value="<%= t('Unpause') %>" />
|
31
|
+
<% else %>
|
32
|
+
<input class="btn btn-danger" type="submit" name="pause" value="<%= t('Pause') %>" />
|
33
|
+
<% end %>
|
34
|
+
<% end %>
|
35
|
+
</form>
|
36
|
+
</td>
|
37
|
+
</tr>
|
38
|
+
<% end %>
|
39
|
+
</table>
|
40
|
+
</div>
|
@@ -0,0 +1,79 @@
|
|
1
|
+
<div class="header-container">
|
2
|
+
<h1><%= t('Retries') %></h1>
|
3
|
+
<% if @retries.size > 0 && @total_size > @count %>
|
4
|
+
<%= erb :_paging, locals: { url: "#{root_path}retries" } %>
|
5
|
+
<% end %>
|
6
|
+
<%= filtering('retries') %>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<% if @retries.size > 0 %>
|
10
|
+
<form action="<%= root_path %>retries" method="post">
|
11
|
+
<%= csrf_tag %>
|
12
|
+
<div class="table_container">
|
13
|
+
<table class="table table-striped table-bordered table-hover">
|
14
|
+
<thead>
|
15
|
+
<tr>
|
16
|
+
<th class="table-checkbox checkbox-column">
|
17
|
+
<label>
|
18
|
+
<input type="checkbox" class="check_all" />
|
19
|
+
</label>
|
20
|
+
</th>
|
21
|
+
<th><%= t('NextRetry') %></th>
|
22
|
+
<th><%= t('RetryCount') %></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
|
+
<% @retries.each do |entry| %>
|
30
|
+
<tr>
|
31
|
+
<td class="table-checkbox">
|
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 %>retries/<%= job_params(entry.item, entry.score) %>"><%= relative_time(entry.at) %></a>
|
38
|
+
</td>
|
39
|
+
<td><%= entry['retry_count'] %></td>
|
40
|
+
<td>
|
41
|
+
<a href="<%= root_path %>queues/<%= entry.queue %>"><%= entry.queue %></a>
|
42
|
+
</td>
|
43
|
+
<td>
|
44
|
+
<%= entry.display_class %>
|
45
|
+
<%= display_tags(entry, "retries") %>
|
46
|
+
</td>
|
47
|
+
<td>
|
48
|
+
<div class="args"><%= display_args(entry.display_args) %></div>
|
49
|
+
</td>
|
50
|
+
<td>
|
51
|
+
<div><%= h truncate("#{entry['error_class']}: #{entry['error_message']}", 200) %></div>
|
52
|
+
</td>
|
53
|
+
</tr>
|
54
|
+
<% end %>
|
55
|
+
</table>
|
56
|
+
</div>
|
57
|
+
<input class="btn btn-primary pull-left flip" type="submit" name="retry" value="<%= t('RetryNow') %>" />
|
58
|
+
<input class="btn btn-danger pull-left flip" type="submit" name="delete" value="<%= t('Delete') %>" />
|
59
|
+
<input class="btn btn-danger pull-left flip" type="submit" name="kill" value="<%= t('Kill') %>" />
|
60
|
+
</form>
|
61
|
+
|
62
|
+
<% unfiltered? do %>
|
63
|
+
<form action="<%= root_path %>retries/all/delete" method="post">
|
64
|
+
<%= csrf_tag %>
|
65
|
+
<input class="btn btn-danger pull-right flip" 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 pull-right flip" type="submit" name="retry" value="<%= t('RetryAll') %>" data-confirm="<%= t('AreYouSure') %>" />
|
70
|
+
</form>
|
71
|
+
<form action="<%= root_path %>retries/all/kill" method="post">
|
72
|
+
<%= csrf_tag %>
|
73
|
+
<input class="btn btn-danger pull-right flip" type="submit" name="kill" value="<%= t('KillAll') %>" data-confirm="<%= t('AreYouSure') %>" />
|
74
|
+
</form>
|
75
|
+
<% end %>
|
76
|
+
|
77
|
+
<% else %>
|
78
|
+
<div class="alert alert-success"><%= t('NoRetriesFound') %></div>
|
79
|
+
<% end %>
|
data/web/views/retry.erb
ADDED
@@ -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 table-hover">
|
6
|
+
<tbody>
|
7
|
+
<tr>
|
8
|
+
<th><%= t('ErrorClass') %></th>
|
9
|
+
<td>
|
10
|
+
<code><%= h @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 %>
|
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,56 @@
|
|
1
|
+
<div class="header-container">
|
2
|
+
<h1><%= t('ScheduledJobs') %></h1>
|
3
|
+
<% if @scheduled.size > 0 && @total_size > @count %>
|
4
|
+
<%= erb :_paging, locals: { url: "#{root_path}scheduled" } %>
|
5
|
+
<% end %>
|
6
|
+
<%= filtering('scheduled') %>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<% if @scheduled.size > 0 %>
|
10
|
+
<form action="<%= root_path %>scheduled" method="post">
|
11
|
+
<%= csrf_tag %>
|
12
|
+
<div class="table_container">
|
13
|
+
<table class="table table-striped table-bordered table-hover">
|
14
|
+
<thead>
|
15
|
+
<tr>
|
16
|
+
<th class="table-checkbox checkbox-column">
|
17
|
+
<label>
|
18
|
+
<input type="checkbox" class="check_all" />
|
19
|
+
</label>
|
20
|
+
</th>
|
21
|
+
<th><%= t('When') %></th>
|
22
|
+
<th><%= t('Queue') %></th>
|
23
|
+
<th><%= t('Job') %></th>
|
24
|
+
<th><%= t('Arguments') %></th>
|
25
|
+
</tr>
|
26
|
+
</thead>
|
27
|
+
<% @scheduled.each do |entry| %>
|
28
|
+
<tr>
|
29
|
+
<td class="table-checkbox">
|
30
|
+
<label>
|
31
|
+
<input type='checkbox' name='key[]' value='<%= job_params(entry.item, entry.score) %>' class='shift_clickable' />
|
32
|
+
</label>
|
33
|
+
</td>
|
34
|
+
<td>
|
35
|
+
<a href="<%= root_path %>scheduled/<%= job_params(entry.item, entry.score) %>"><%= relative_time(entry.at) %></a>
|
36
|
+
</td>
|
37
|
+
<td>
|
38
|
+
<a href="<%= root_path %>queues/<%= entry.queue %>"><%= entry.queue %></a>
|
39
|
+
</td>
|
40
|
+
<td>
|
41
|
+
<%= entry.display_class %>
|
42
|
+
<%= display_tags(entry, "scheduled") %>
|
43
|
+
</td>
|
44
|
+
<td>
|
45
|
+
<div class="args"><%= display_args(entry.display_args) %></div>
|
46
|
+
</td>
|
47
|
+
</tr>
|
48
|
+
<% end %>
|
49
|
+
</table>
|
50
|
+
</div>
|
51
|
+
<input class="btn btn-danger pull-right flip" type="submit" name="delete" value="<%= t('Delete') %>" />
|
52
|
+
<input class="btn btn-danger pull-right flip" type="submit" name="add_to_queue" value="<%= t('AddToQueue') %>" />
|
53
|
+
</form>
|
54
|
+
<% else %>
|
55
|
+
<div class="alert alert-success"><%= t('NoScheduledFound') %></div>
|
56
|
+
<% 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>
|