sidekiq 5.2.8
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/.circleci/config.yml +61 -0
- data/.github/contributing.md +32 -0
- data/.github/issue_template.md +11 -0
- data/.gitignore +15 -0
- data/.travis.yml +11 -0
- data/3.0-Upgrade.md +70 -0
- data/4.0-Upgrade.md +53 -0
- data/5.0-Upgrade.md +56 -0
- data/COMM-LICENSE +97 -0
- data/Changes.md +1542 -0
- data/Ent-Changes.md +238 -0
- data/Gemfile +23 -0
- data/LICENSE +9 -0
- data/Pro-2.0-Upgrade.md +138 -0
- data/Pro-3.0-Upgrade.md +44 -0
- data/Pro-4.0-Upgrade.md +35 -0
- data/Pro-Changes.md +759 -0
- data/README.md +109 -0
- data/Rakefile +9 -0
- data/bin/sidekiq +18 -0
- data/bin/sidekiqctl +20 -0
- data/bin/sidekiqload +149 -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 +237 -0
- data/lib/sidekiq/api.rb +940 -0
- data/lib/sidekiq/cli.rb +445 -0
- data/lib/sidekiq/client.rb +243 -0
- data/lib/sidekiq/core_ext.rb +1 -0
- data/lib/sidekiq/ctl.rb +221 -0
- data/lib/sidekiq/delay.rb +42 -0
- data/lib/sidekiq/exception_handler.rb +29 -0
- data/lib/sidekiq/extensions/action_mailer.rb +57 -0
- data/lib/sidekiq/extensions/active_record.rb +40 -0
- data/lib/sidekiq/extensions/class_methods.rb +40 -0
- data/lib/sidekiq/extensions/generic_proxy.rb +31 -0
- data/lib/sidekiq/fetch.rb +81 -0
- data/lib/sidekiq/job_logger.rb +25 -0
- data/lib/sidekiq/job_retry.rb +262 -0
- data/lib/sidekiq/launcher.rb +173 -0
- data/lib/sidekiq/logging.rb +122 -0
- data/lib/sidekiq/manager.rb +137 -0
- data/lib/sidekiq/middleware/chain.rb +150 -0
- data/lib/sidekiq/middleware/i18n.rb +42 -0
- data/lib/sidekiq/middleware/server/active_record.rb +23 -0
- data/lib/sidekiq/paginator.rb +43 -0
- data/lib/sidekiq/processor.rb +279 -0
- data/lib/sidekiq/rails.rb +58 -0
- data/lib/sidekiq/redis_connection.rb +144 -0
- data/lib/sidekiq/scheduled.rb +174 -0
- data/lib/sidekiq/testing.rb +333 -0
- data/lib/sidekiq/testing/inline.rb +29 -0
- data/lib/sidekiq/util.rb +66 -0
- data/lib/sidekiq/version.rb +4 -0
- data/lib/sidekiq/web.rb +213 -0
- data/lib/sidekiq/web/action.rb +89 -0
- data/lib/sidekiq/web/application.rb +353 -0
- data/lib/sidekiq/web/helpers.rb +325 -0
- data/lib/sidekiq/web/router.rb +100 -0
- data/lib/sidekiq/worker.rb +220 -0
- data/sidekiq.gemspec +21 -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 +92 -0
- data/web/assets/javascripts/dashboard.js +315 -0
- data/web/assets/stylesheets/application-rtl.css +246 -0
- data/web/assets/stylesheets/application.css +1144 -0
- data/web/assets/stylesheets/bootstrap-rtl.min.css +9 -0
- data/web/assets/stylesheets/bootstrap.css +5 -0
- data/web/locales/ar.yml +81 -0
- data/web/locales/cs.yml +78 -0
- data/web/locales/da.yml +68 -0
- data/web/locales/de.yml +69 -0
- data/web/locales/el.yml +68 -0
- data/web/locales/en.yml +81 -0
- data/web/locales/es.yml +70 -0
- data/web/locales/fa.yml +80 -0
- data/web/locales/fr.yml +78 -0
- data/web/locales/he.yml +79 -0
- data/web/locales/hi.yml +75 -0
- data/web/locales/it.yml +69 -0
- data/web/locales/ja.yml +80 -0
- data/web/locales/ko.yml +68 -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 +68 -0
- data/web/locales/pt.yml +67 -0
- data/web/locales/ru.yml +78 -0
- data/web/locales/sv.yml +68 -0
- data/web/locales/ta.yml +75 -0
- data/web/locales/uk.yml +76 -0
- data/web/locales/ur.yml +80 -0
- data/web/locales/zh-cn.yml +68 -0
- data/web/locales/zh-tw.yml +68 -0
- data/web/views/_footer.erb +20 -0
- data/web/views/_job_info.erb +88 -0
- data/web/views/_nav.erb +52 -0
- data/web/views/_paging.erb +23 -0
- data/web/views/_poll_link.erb +7 -0
- data/web/views/_status.erb +4 -0
- data/web/views/_summary.erb +40 -0
- data/web/views/busy.erb +98 -0
- data/web/views/dashboard.erb +75 -0
- data/web/views/dead.erb +34 -0
- data/web/views/layout.erb +40 -0
- data/web/views/morgue.erb +75 -0
- data/web/views/queue.erb +46 -0
- data/web/views/queues.erb +30 -0
- data/web/views/retries.erb +80 -0
- data/web/views/retry.erb +34 -0
- data/web/views/scheduled.erb +54 -0
- data/web/views/scheduled_job_info.erb +8 -0
- metadata +230 -0
@@ -0,0 +1,68 @@
|
|
1
|
+
# elements like %{queue} are variables and should not be translated
|
2
|
+
zh-tw: # <---- change this to your locale code
|
3
|
+
Dashboard: 資訊主頁
|
4
|
+
Status: 狀態
|
5
|
+
Time: 時間
|
6
|
+
Namespace: 命名空間
|
7
|
+
Realtime: 即時
|
8
|
+
History: 歷史資料
|
9
|
+
Busy: 忙碌
|
10
|
+
Processed: 已處理
|
11
|
+
Failed: 已失敗
|
12
|
+
Scheduled: 已排程
|
13
|
+
Retries: 重試
|
14
|
+
Enqueued: 已佇列
|
15
|
+
Worker: 工人
|
16
|
+
LivePoll: 即時輪詢
|
17
|
+
StopPolling: 停止輪詢
|
18
|
+
Queue: 佇列
|
19
|
+
Class: 類別
|
20
|
+
Job: 工作
|
21
|
+
Arguments: 參數
|
22
|
+
Extras: 額外的
|
23
|
+
Started: 已開始
|
24
|
+
ShowAll: 顯示全部
|
25
|
+
CurrentMessagesInQueue: 目前在<span class='title'>%{queue}</span>的工作
|
26
|
+
Delete: 刪除
|
27
|
+
AddToQueue: 增加至佇列
|
28
|
+
AreYouSureDeleteJob: 你確定要刪除這個工作嗎?
|
29
|
+
AreYouSureDeleteQueue: 你確定要刪除%{queue}這個佇列?
|
30
|
+
Queues: 佇列
|
31
|
+
Size: 容量
|
32
|
+
Actions: 動作
|
33
|
+
NextRetry: 下次重試
|
34
|
+
RetryCount: 重試次數
|
35
|
+
RetryNow: 馬上重試
|
36
|
+
LastRetry: 最後一次重試
|
37
|
+
OriginallyFailed: 原本已失敗
|
38
|
+
AreYouSure: 你確定?
|
39
|
+
DeleteAll: 刪除全部
|
40
|
+
RetryAll: 重試全部
|
41
|
+
NoRetriesFound: 沒有發現可重試
|
42
|
+
Error: 錯誤
|
43
|
+
ErrorClass: 錯誤類別
|
44
|
+
ErrorMessage: 錯誤訊息
|
45
|
+
ErrorBacktrace: 錯誤的回調追踨
|
46
|
+
GoBack: ← 返回
|
47
|
+
NoScheduledFound: 沒有發現已排程的工作
|
48
|
+
When: 當
|
49
|
+
ScheduledJobs: 已排程的工作
|
50
|
+
idle: 閒置
|
51
|
+
active: 活動中
|
52
|
+
Version: 版本
|
53
|
+
Connections: 連線
|
54
|
+
MemoryUsage: 記憶體使用量
|
55
|
+
PeakMemoryUsage: 尖峰記憶體使用量
|
56
|
+
Uptime: 上線時間 (天數)
|
57
|
+
OneWeek: 一週
|
58
|
+
OneMonth: 一個月
|
59
|
+
ThreeMonths: 三個月
|
60
|
+
SixMonths: 六個月
|
61
|
+
Failures: 失敗
|
62
|
+
DeadJobs: 停滯工作
|
63
|
+
NoDeadJobsFound: 沒有發現任何停滯的工作
|
64
|
+
Dead: 停滯
|
65
|
+
Processes: 處理中
|
66
|
+
Thread: 執行緒
|
67
|
+
Threads: 執行緒
|
68
|
+
Jobs: 工作
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<div class="navbar navbar-fixed-bottom navbar-inverse ltr">
|
2
|
+
<div class="navbar-inner">
|
3
|
+
<div class="container text-center">
|
4
|
+
<ul class="nav">
|
5
|
+
<li>
|
6
|
+
<p class="navbar-text product-version"><%= product_version %></p>
|
7
|
+
</li>
|
8
|
+
<li>
|
9
|
+
<p class="navbar-text redis-url" title="<%= redis_connection_and_namespace %>"><%= redis_connection_and_namespace %></p>
|
10
|
+
</li>
|
11
|
+
<li>
|
12
|
+
<p class="navbar-text server-utc-time"><%= server_utc_time %></p>
|
13
|
+
</li>
|
14
|
+
<li>
|
15
|
+
<p class="navbar-text"><a style="color: gray;" href="https://github.com/mperham/sidekiq/wiki">docs</a></p>
|
16
|
+
</li>
|
17
|
+
</ul>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
@@ -0,0 +1,88 @@
|
|
1
|
+
<header>
|
2
|
+
<h3><%= t('Job') %></h3>
|
3
|
+
</header>
|
4
|
+
|
5
|
+
<div class="table_container">
|
6
|
+
<table class="table table-bordered table-striped">
|
7
|
+
<tbody>
|
8
|
+
<tr>
|
9
|
+
<th><%= t('Queue') %></th>
|
10
|
+
<td>
|
11
|
+
<a href="<%= root_path %>queues/<%= job.queue %>"><%= job.queue %></a>
|
12
|
+
</td>
|
13
|
+
</tr>
|
14
|
+
<tr>
|
15
|
+
<th><%= t('Job') %></th>
|
16
|
+
<td>
|
17
|
+
<code><%= job.display_class %></code>
|
18
|
+
</td>
|
19
|
+
</tr>
|
20
|
+
<tr>
|
21
|
+
<th><%= t('Arguments') %></th>
|
22
|
+
<td>
|
23
|
+
<code class="code-wrap">
|
24
|
+
<!-- We don't want to truncate any job arguments when viewing a single job's status page -->
|
25
|
+
<div class="args-extended"><%= display_args(job.display_args, nil) %></div>
|
26
|
+
</code>
|
27
|
+
</td>
|
28
|
+
</tr>
|
29
|
+
<tr>
|
30
|
+
<th>JID</th>
|
31
|
+
<td>
|
32
|
+
<code><%= job.jid %></code>
|
33
|
+
</td>
|
34
|
+
</tr>
|
35
|
+
<tr>
|
36
|
+
<th><%= t('CreatedAt') %></th>
|
37
|
+
<td><%= relative_time(job.created_at) %></td>
|
38
|
+
</tr>
|
39
|
+
<tr>
|
40
|
+
<th><%= t('Enqueued') %></th>
|
41
|
+
<td><%= (enqueued_at = job.enqueued_at) ? relative_time(enqueued_at) : t('NotYetEnqueued') %></td>
|
42
|
+
</tr>
|
43
|
+
<% unless retry_extra_items(job).empty? %>
|
44
|
+
<tr>
|
45
|
+
<th><%= t('Extras') %></th>
|
46
|
+
<td>
|
47
|
+
<code>
|
48
|
+
<%= retry_extra_items(job).inspect %>
|
49
|
+
</code>
|
50
|
+
</td>
|
51
|
+
</tr>
|
52
|
+
<% end %>
|
53
|
+
<% if type == :retry %>
|
54
|
+
<% if job['retry_count'] && job['retry_count'] > 0 %>
|
55
|
+
<tr>
|
56
|
+
<th><%= t('RetryCount') %></th>
|
57
|
+
<td><%= job['retry_count'] %></td>
|
58
|
+
</tr>
|
59
|
+
<tr>
|
60
|
+
<th><%= t('LastRetry') %></th>
|
61
|
+
<td><%= relative_time(Time.at(job['retried_at'])) %></td>
|
62
|
+
</tr>
|
63
|
+
<% else %>
|
64
|
+
<tr>
|
65
|
+
<th><%= t('OriginallyFailed') %></th>
|
66
|
+
<td><%= relative_time(Time.at(job['failed_at'])) %></td>
|
67
|
+
</tr>
|
68
|
+
<% end %>
|
69
|
+
<tr>
|
70
|
+
<th><%= t('NextRetry') %></th>
|
71
|
+
<td><%= relative_time(job.at) %></td>
|
72
|
+
</tr>
|
73
|
+
<% end %>
|
74
|
+
<% if type == :scheduled %>
|
75
|
+
<tr>
|
76
|
+
<th><%= t('Scheduled') %></th>
|
77
|
+
<td><%= relative_time(job.at) %></td>
|
78
|
+
</tr>
|
79
|
+
<% end %>
|
80
|
+
<% if type == :dead %>
|
81
|
+
<tr>
|
82
|
+
<th><%= t('LastRetry') %></th>
|
83
|
+
<td><%= relative_time(job.at) if job['retry_count'] %></td>
|
84
|
+
</tr>
|
85
|
+
<% end %>
|
86
|
+
</tbody>
|
87
|
+
</table>
|
88
|
+
</div>
|
data/web/views/_nav.erb
ADDED
@@ -0,0 +1,52 @@
|
|
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 %>"><%= t('BackToApp') %></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' : '' %>">
|
26
|
+
<a href="<%= root_path %><%= url %>"><%= t(title) %></a>
|
27
|
+
</li>
|
28
|
+
<% else %>
|
29
|
+
<li class="<%= current_path.start_with?(url) ? 'active' : '' %>">
|
30
|
+
<a href="<%= root_path %><%= url %>"><%= t(title) %></a>
|
31
|
+
</li>
|
32
|
+
<% end %>
|
33
|
+
<% end %>
|
34
|
+
|
35
|
+
<% Sidekiq::Web.custom_tabs.each do |title, url| %>
|
36
|
+
<li class="<%= current_path.start_with?(url) ? 'active' : '' %>" data-navbar="custom-tab">
|
37
|
+
<a href="<%= root_path %><%= url %>"><%= t(title) %></a>
|
38
|
+
</li>
|
39
|
+
<% end %>
|
40
|
+
|
41
|
+
<li class="navbar-livereload">
|
42
|
+
<div class="poll-wrapper">
|
43
|
+
<%= erb :_poll_link %>
|
44
|
+
<% if Sidekiq::Web.app_url %>
|
45
|
+
<a class="btn btn-inverse" href="<%= Sidekiq::Web.app_url %>"><%= t('BackToApp') %></a>
|
46
|
+
<% end %>
|
47
|
+
</div>
|
48
|
+
</li>
|
49
|
+
</ul>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
</div>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<% if @total_size > @count %>
|
2
|
+
<ul class="pagination pull-right flip">
|
3
|
+
<li class="<%= 'disabled' if @current_page == 1 %>">
|
4
|
+
<a href="<%= url %>?page=1">«</a>
|
5
|
+
</li>
|
6
|
+
<% if @current_page > 1 %>
|
7
|
+
<li>
|
8
|
+
<a href="<%= url %>?<%= qparams(page: @current_page - 1) %>"><%= @current_page - 1 %></a>
|
9
|
+
</li>
|
10
|
+
<% end %>
|
11
|
+
<li class="disabled">
|
12
|
+
<a href="<%= url %>?<%= qparams(page: @current_page) %>"><%= @current_page %></a>
|
13
|
+
</li>
|
14
|
+
<% if @total_size > @current_page * @count %>
|
15
|
+
<li>
|
16
|
+
<a href="<%= url %>?<%= qparams(page: @current_page + 1) %>"><%= @current_page + 1 %></a>
|
17
|
+
</li>
|
18
|
+
<% end %>
|
19
|
+
<li class="<%= 'disabled' if @total_size <= @current_page * @count %>">
|
20
|
+
<a href="<%= url %>?<%= qparams(page: (@total_size.to_f / @count).ceil) %>">»</a>
|
21
|
+
</li>
|
22
|
+
</ul>
|
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 %>
|
@@ -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>
|
data/web/views/busy.erb
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
<div class="row header">
|
2
|
+
<div class="col-sm-8 pull-left flip">
|
3
|
+
<h3><%= t('Processes') %></h3>
|
4
|
+
</div>
|
5
|
+
<div class="col-sm-4 pull-right flip">
|
6
|
+
<form method="POST" class="warning-messages">
|
7
|
+
<%= csrf_tag %>
|
8
|
+
<div class="btn-group pull-right flip">
|
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
|
+
<% lead = processes.leader %>
|
26
|
+
<% processes.each do |process| %>
|
27
|
+
<tr>
|
28
|
+
<td class="box">
|
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
|
+
<% if process.stopping? %>
|
35
|
+
<span class="label label-danger">quiet</span>
|
36
|
+
<% end %>
|
37
|
+
<% if process.identity == lead %>
|
38
|
+
<span class="label label-warning">leader</span>
|
39
|
+
<% end %>
|
40
|
+
<br>
|
41
|
+
<b><%= "#{t('Queues')}: " %></b>
|
42
|
+
<%= process['queues'] * ", " %>
|
43
|
+
</td>
|
44
|
+
<td><%= relative_time(Time.at(process['started_at'])) %></td>
|
45
|
+
<td><%= process['concurrency'] %></td>
|
46
|
+
<td><%= process['busy'] %></td>
|
47
|
+
<td>
|
48
|
+
<div class="btn-group pull-right flip">
|
49
|
+
<form method="POST">
|
50
|
+
<%= csrf_tag %>
|
51
|
+
<input type="hidden" name="identity" value="<%= process['identity'] %>"/>
|
52
|
+
<% unless process.stopping? %>
|
53
|
+
<button class="btn btn-warn" type="submit" name="quiet" value="1"><%= t('Quiet') %></button>
|
54
|
+
<% end %>
|
55
|
+
<button class="btn btn-danger" type="submit" name="stop" value="1"><%= t('Stop') %></button>
|
56
|
+
</form>
|
57
|
+
</div>
|
58
|
+
</td>
|
59
|
+
</tr>
|
60
|
+
<% end %>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<div class="row header">
|
65
|
+
<div class="col-sm-7">
|
66
|
+
<h3><%= t('Jobs') %></h3>
|
67
|
+
</div>
|
68
|
+
</div>
|
69
|
+
|
70
|
+
<div class="table_container">
|
71
|
+
<table class="workers table table-hover table-bordered table-striped table-white">
|
72
|
+
<thead>
|
73
|
+
<th><%= t('Process') %></th>
|
74
|
+
<th><%= t('TID') %></th>
|
75
|
+
<th><%= t('JID') %></th>
|
76
|
+
<th><%= t('Queue') %></th>
|
77
|
+
<th><%= t('Job') %></th>
|
78
|
+
<th><%= t('Arguments') %></th>
|
79
|
+
<th><%= t('Started') %></th>
|
80
|
+
</thead>
|
81
|
+
<% workers.each do |process, thread, msg| %>
|
82
|
+
<% job = Sidekiq::Job.new(msg['payload']) %>
|
83
|
+
<tr>
|
84
|
+
<td><%= process %></td>
|
85
|
+
<td><%= thread %></td>
|
86
|
+
<td><%= job.jid %></td>
|
87
|
+
<td>
|
88
|
+
<a href="<%= root_path %>queues/<%= msg['queue'] %>"><%= msg['queue'] %></a>
|
89
|
+
</td>
|
90
|
+
<td><%= job.display_class %></td>
|
91
|
+
<td>
|
92
|
+
<div class="args"><%= display_args(job.display_args) %></div>
|
93
|
+
</td>
|
94
|
+
<td><%= relative_time(Time.at(msg['run_at'])) %></td>
|
95
|
+
</tr>
|
96
|
+
<% end %>
|
97
|
+
</table>
|
98
|
+
</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 ltr">
|
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>
|
31
|
+
|
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>
|
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>
|