sidekiq 6.3.1 → 6.5.9

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.

Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/Changes.md +134 -0
  3. data/LICENSE +3 -3
  4. data/README.md +7 -2
  5. data/bin/sidekiq +3 -3
  6. data/bin/sidekiqload +70 -66
  7. data/bin/sidekiqmon +1 -1
  8. data/lib/generators/sidekiq/job_generator.rb +57 -0
  9. data/lib/generators/sidekiq/templates/{worker.rb.erb → job.rb.erb} +2 -2
  10. data/lib/generators/sidekiq/templates/{worker_spec.rb.erb → job_spec.rb.erb} +1 -1
  11. data/lib/generators/sidekiq/templates/{worker_test.rb.erb → job_test.rb.erb} +1 -1
  12. data/lib/sidekiq/api.rb +261 -104
  13. data/lib/sidekiq/cli.rb +62 -38
  14. data/lib/sidekiq/client.rb +47 -67
  15. data/lib/sidekiq/{util.rb → component.rb} +12 -42
  16. data/lib/sidekiq/delay.rb +3 -1
  17. data/lib/sidekiq/extensions/generic_proxy.rb +1 -1
  18. data/lib/sidekiq/fetch.rb +20 -18
  19. data/lib/sidekiq/job_logger.rb +15 -27
  20. data/lib/sidekiq/job_retry.rb +78 -55
  21. data/lib/sidekiq/job_util.rb +71 -0
  22. data/lib/sidekiq/launcher.rb +58 -54
  23. data/lib/sidekiq/logger.rb +8 -18
  24. data/lib/sidekiq/manager.rb +35 -34
  25. data/lib/sidekiq/metrics/deploy.rb +47 -0
  26. data/lib/sidekiq/metrics/query.rb +153 -0
  27. data/lib/sidekiq/metrics/shared.rb +94 -0
  28. data/lib/sidekiq/metrics/tracking.rb +134 -0
  29. data/lib/sidekiq/middleware/chain.rb +82 -38
  30. data/lib/sidekiq/middleware/current_attributes.rb +19 -8
  31. data/lib/sidekiq/middleware/i18n.rb +6 -4
  32. data/lib/sidekiq/middleware/modules.rb +21 -0
  33. data/lib/sidekiq/monitor.rb +2 -2
  34. data/lib/sidekiq/paginator.rb +17 -9
  35. data/lib/sidekiq/processor.rb +47 -41
  36. data/lib/sidekiq/rails.rb +15 -8
  37. data/lib/sidekiq/redis_client_adapter.rb +154 -0
  38. data/lib/sidekiq/redis_connection.rb +80 -49
  39. data/lib/sidekiq/ring_buffer.rb +29 -0
  40. data/lib/sidekiq/scheduled.rb +66 -27
  41. data/lib/sidekiq/testing/inline.rb +4 -4
  42. data/lib/sidekiq/testing.rb +37 -36
  43. data/lib/sidekiq/transaction_aware_client.rb +45 -0
  44. data/lib/sidekiq/version.rb +1 -1
  45. data/lib/sidekiq/web/action.rb +3 -3
  46. data/lib/sidekiq/web/application.rb +26 -7
  47. data/lib/sidekiq/web/csrf_protection.rb +2 -2
  48. data/lib/sidekiq/web/helpers.rb +21 -8
  49. data/lib/sidekiq/web.rb +8 -4
  50. data/lib/sidekiq/worker.rb +78 -19
  51. data/lib/sidekiq.rb +111 -30
  52. data/sidekiq.gemspec +2 -2
  53. data/web/assets/javascripts/application.js +58 -26
  54. data/web/assets/javascripts/chart.min.js +13 -0
  55. data/web/assets/javascripts/chartjs-plugin-annotation.min.js +7 -0
  56. data/web/assets/javascripts/dashboard.js +0 -17
  57. data/web/assets/javascripts/graph.js +16 -0
  58. data/web/assets/javascripts/metrics.js +262 -0
  59. data/web/assets/stylesheets/application-dark.css +13 -17
  60. data/web/assets/stylesheets/application.css +48 -6
  61. data/web/locales/el.yml +43 -19
  62. data/web/locales/en.yml +7 -0
  63. data/web/locales/ja.yml +7 -0
  64. data/web/locales/pt-br.yml +27 -9
  65. data/web/locales/zh-cn.yml +36 -11
  66. data/web/locales/zh-tw.yml +32 -7
  67. data/web/views/_nav.erb +1 -1
  68. data/web/views/_summary.erb +1 -1
  69. data/web/views/busy.erb +9 -4
  70. data/web/views/dashboard.erb +1 -0
  71. data/web/views/metrics.erb +69 -0
  72. data/web/views/metrics_for_job.erb +87 -0
  73. data/web/views/queue.erb +5 -1
  74. metadata +39 -13
  75. data/lib/generators/sidekiq/worker_generator.rb +0 -57
  76. data/lib/sidekiq/exception_handler.rb +0 -27
@@ -7,6 +7,7 @@ zh-cn: # <---- change this to your locale code
7
7
  Realtime: 实时
8
8
  History: 历史记录
9
9
  Busy: 执行中
10
+ Utilization: 利用率
10
11
  Processed: 已处理
11
12
  Failed: 已失败
12
13
  Scheduled: 已计划
@@ -17,15 +18,15 @@ zh-cn: # <---- change this to your locale code
17
18
  StopPolling: 停止轮询
18
19
  Queue: 队列
19
20
  Class: 类别
20
- Job: 作业
21
+ Job: 任务
21
22
  Arguments: 参数
22
23
  Extras: 额外的
23
24
  Started: 已开始
24
25
  ShowAll: 显示全部
25
- CurrentMessagesInQueue: 目前在<span class='title'>%{queue}</span>的作业
26
+ CurrentMessagesInQueue: 目前在<span class='title'>%{queue}</span>的任务
26
27
  Delete: 删除
27
28
  AddToQueue: 添加至队列
28
- AreYouSureDeleteJob: 你确定要删除这个作业么?
29
+ AreYouSureDeleteJob: 你确定要删除这个任务么?
29
30
  AreYouSureDeleteQueue: 你确定要删除%{queue}这个队列?
30
31
  Queues: 队列
31
32
  Size: 容量
@@ -33,20 +34,22 @@ zh-cn: # <---- change this to your locale code
33
34
  NextRetry: 下次重试
34
35
  RetryCount: 重试次數
35
36
  RetryNow: 现在重试
37
+ Kill: 终止
36
38
  LastRetry: 最后一次重试
37
39
  OriginallyFailed: 原本已失败
38
40
  AreYouSure: 你确定?
39
- DeleteAll: 删除全部
40
- RetryAll: 重试全部
41
+ DeleteAll: 全部删除
42
+ RetryAll: 全部重试
43
+ KillAll: 全部终止
41
44
  NoRetriesFound: 沒有发现可重试
42
45
  Error: 错误
43
46
  ErrorClass: 错误类别
44
47
  ErrorMessage: 错误消息
45
- ErrorBacktrace: 错误的回调追踪
48
+ ErrorBacktrace: 错误细节
46
49
  GoBack: ← 返回
47
- NoScheduledFound: 沒有发现计划作业
50
+ NoScheduledFound: 沒有发现计划任务
48
51
  When: 当
49
- ScheduledJobs: 计划作业
52
+ ScheduledJobs: 计划任务
50
53
  idle: 闲置
51
54
  active: 活动中
52
55
  Version: 版本
@@ -59,10 +62,32 @@ zh-cn: # <---- change this to your locale code
59
62
  ThreeMonths: 三个月
60
63
  SixMonths: 六个月
61
64
  Failures: 失败
62
- DeadJobs: 已停滞作业
63
- NoDeadJobsFound: 沒有发现任何已停滞的作业
65
+ DeadJobs: 已停滞任务
66
+ NoDeadJobsFound: 沒有发现任何已停滞的任务
64
67
  Dead: 已停滞
68
+ Process: 进程
65
69
  Processes: 处理中
70
+ Name: 名称
66
71
  Thread: 线程
67
72
  Threads: 线程
68
- Jobs: 作业
73
+ Jobs: 任务
74
+ Paused: 已暫停
75
+ Stop: 強制暫停
76
+ Quiet: 暫停
77
+ StopAll: 全部強制暫停
78
+ QuietAll: 全部暫停
79
+ PollingInterval: 輪詢週期
80
+ Plugins: 套件
81
+ NotYetEnqueued: 尚未進入佇列
82
+ CreatedAt: 建立時間
83
+ BackToApp: 回首頁
84
+ Latency: 延時
85
+ Pause: 暫停
86
+ Unpause: 取消暂停
87
+ Metrics: 指标
88
+ NoDataFound: 无数据
89
+ TotalExecutionTime: 总执行时间
90
+ AvgExecutionTime: 平均执行时间
91
+ Context: 上下文
92
+ Bucket: 桶
93
+ NoJobMetricsFound: 无任务相关指标数据
@@ -7,6 +7,7 @@ zh-tw: # <---- change this to your locale code
7
7
  Realtime: 即時
8
8
  History: 歷史資料
9
9
  Busy: 忙碌
10
+ Utilization: 使用率
10
11
  Processed: 已處理
11
12
  Failed: 已失敗
12
13
  Scheduled: 已排程
@@ -25,26 +26,28 @@ zh-tw: # <---- change this to your locale code
25
26
  CurrentMessagesInQueue: 目前在<span class='title'>%{queue}</span>的工作
26
27
  Delete: 刪除
27
28
  AddToQueue: 增加至佇列
28
- AreYouSureDeleteJob: 你確定要刪除這個工作嗎?
29
- AreYouSureDeleteQueue: 你確定要刪除%{queue}這個佇列?
29
+ AreYouSureDeleteJob: 確定要刪除這個工作嗎?
30
+ AreYouSureDeleteQueue: 確定要刪除%{queue}佇列?這會刪除佇列裡的所有工作,佇列將會在有新工作時重新出現。
30
31
  Queues: 佇列
31
32
  Size: 容量
32
33
  Actions: 動作
33
34
  NextRetry: 下次重試
34
35
  RetryCount: 重試次數
35
36
  RetryNow: 馬上重試
37
+ Kill: 取消
36
38
  LastRetry: 最後一次重試
37
39
  OriginallyFailed: 原本已失敗
38
40
  AreYouSure: 你確定?
39
- DeleteAll: 刪除全部
40
- RetryAll: 重試全部
41
- NoRetriesFound: 沒有發現可重試
41
+ DeleteAll: 全部刪除
42
+ RetryAll: 全部重試
43
+ KillAll: 全部取消
44
+ NoRetriesFound: 找無可重試的工作
42
45
  Error: 錯誤
43
46
  ErrorClass: 錯誤類別
44
47
  ErrorMessage: 錯誤訊息
45
- ErrorBacktrace: 錯誤的回調追踨
48
+ ErrorBacktrace: 詳細錯誤訊息
46
49
  GoBack: ← 返回
47
- NoScheduledFound: 沒有發現已排程的工作
50
+ NoScheduledFound: 找無已排程的工作
48
51
  When: 當
49
52
  ScheduledJobs: 已排程的工作
50
53
  idle: 閒置
@@ -62,7 +65,29 @@ zh-tw: # <---- change this to your locale code
62
65
  DeadJobs: 停滯工作
63
66
  NoDeadJobsFound: 沒有發現任何停滯的工作
64
67
  Dead: 停滯
68
+ Process: 程序
65
69
  Processes: 處理中
70
+ Name: 名稱
66
71
  Thread: 執行緒
67
72
  Threads: 執行緒
68
73
  Jobs: 工作
74
+ Paused: 已暫停
75
+ Stop: 強制暫停
76
+ Quiet: 暫停
77
+ StopAll: 全部強制暫停
78
+ QuietAll: 全部暫停
79
+ PollingInterval: 輪詢週期
80
+ Plugins: 套件
81
+ NotYetEnqueued: 尚未進入佇列
82
+ CreatedAt: 建立時間
83
+ BackToApp: 回首頁
84
+ Latency: 延時
85
+ Pause: 暫停
86
+ Unpause: 取消暫停
87
+ Metrics: 計量
88
+ NoDataFound: 找無資料
89
+ TotalExecutionTime: 總執行時間
90
+ AvgExecutionTime: 平均執行時間
91
+ Context: 上下文
92
+ Bucket: 桶
93
+ NoJobMetricsFound: 找無工作相關計量資料
data/web/views/_nav.erb CHANGED
@@ -1,7 +1,7 @@
1
1
  <div class="navbar navbar-default navbar-fixed-top">
2
2
  <div class="container-fluid">
3
3
  <div class="navbar-header" data-navbar="static">
4
- <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-menu">
4
+ <button type="button" class="navbar-toggle collapsed" data-toggle="navbar-menu" data-target="#navbar-menu">
5
5
  <span class="icon-bar"></span>
6
6
  <span class="icon-bar"></span>
7
7
  <span class="icon-bar"></span>
@@ -9,7 +9,7 @@
9
9
  </li>
10
10
  <li class="busy col-sm-1">
11
11
  <a href="<%= root_path %>busy">
12
- <span id="txtBusy" class="count"><%= number_with_delimiter(workers.size) %></span>
12
+ <span id="txtBusy" class="count"><%= number_with_delimiter(workset.size) %></span>
13
13
  <span class="desc"><%= t('Busy') %></span>
14
14
  </a>
15
15
  </li>
data/web/views/busy.erb CHANGED
@@ -15,7 +15,7 @@
15
15
  <p><%= t('Threads') %></p>
16
16
  </div>
17
17
  <div class="stat">
18
- <h3><%= ws = workers.size; number_with_delimiter(ws) %></h3>
18
+ <h3><%= ws = workset.size; number_with_delimiter(ws) %></h3>
19
19
  <p><%= t('Busy') %></p>
20
20
  </div>
21
21
  <div class="stat">
@@ -48,13 +48,13 @@
48
48
  <thead>
49
49
  <th><%= t('Name') %></th>
50
50
  <th><%= t('Started') %></th>
51
- <th class="col-sm-1"><%= t('RSS') %><a href="https://github.com/mperham/sidekiq/wiki/Memory#rss"><span class="info-circle" title="Click to learn more about RSS">?</span></a></th>
51
+ <th class="col-sm-1"><%= t('RSS') %><a target="blank" href="https://github.com/mperham/sidekiq/wiki/Memory#rss"><span class="info-circle" title="Click to learn more about RSS">?</span></a></th>
52
52
  <th class="col-sm-1"><%= t('Threads') %></th>
53
53
  <th class="col-sm-1"><%= t('Busy') %></th>
54
54
  <th>&nbsp;</th>
55
55
  </thead>
56
56
  <% lead = processes.leader %>
57
- <% processes.each do |process| %>
57
+ <% sorted_processes.each do |process| %>
58
58
  <tr>
59
59
  <td class="box">
60
60
  <%= "#{process['hostname']}:#{process['pid']}" %>
@@ -96,6 +96,11 @@
96
96
  <div class="col-sm-7">
97
97
  <h3><%= t('Jobs') %></h3>
98
98
  </div>
99
+ <% if @workset.size > 0 && @total_size > @count %>
100
+ <div class="col-sm-4">
101
+ <%= erb :_paging, locals: { url: "#{root_path}busy" } %>
102
+ </div>
103
+ <% end %>
99
104
  </div>
100
105
 
101
106
  <div class="table_container">
@@ -109,7 +114,7 @@
109
114
  <th><%= t('Arguments') %></th>
110
115
  <th><%= t('Started') %></th>
111
116
  </thead>
112
- <% workers.each do |process, thread, msg| %>
117
+ <% @workset.each do |process, thread, msg| %>
113
118
  <% job = Sidekiq::JobRecord.new(msg['payload']) %>
114
119
  <tr>
115
120
  <td><%= process %></td>
@@ -1,3 +1,4 @@
1
+ <script type="text/javascript" src="<%= root_path %>javascripts/graph.js"></script>
1
2
  <script type="text/javascript" src="<%= root_path %>javascripts/dashboard.js"></script>
2
3
  <div class= "dashboard clearfix">
3
4
  <h3 >
@@ -0,0 +1,69 @@
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/metrics.js"></script>
4
+
5
+ <h2>Total execution time</h2>
6
+
7
+ <%
8
+ table_limit = 20
9
+ chart_limit = 5
10
+ job_results = @query_result.job_results.sort_by { |(kls, jr)| jr.totals["s"] }.reverse.first(table_limit)
11
+ visible_kls = job_results.first(chart_limit).map(&:first)
12
+ %>
13
+
14
+ <canvas id="job-metrics-overview-chart"></canvas>
15
+
16
+ <script>
17
+ window.jobMetricsChart = new JobMetricsOverviewChart(
18
+ "job-metrics-overview-chart",
19
+ <%= Sidekiq.dump_json({
20
+ series: job_results.map { |(kls, jr)| [kls, jr.dig("series", "s")] }.to_h,
21
+ marks: @query_result.marks.map { |m| [m.bucket, m.label] },
22
+ visible: visible_kls,
23
+ labels: @query_result.buckets,
24
+ }) %>
25
+ )
26
+ </script>
27
+
28
+ <h2>Most Time-Consuming Jobs</h2>
29
+
30
+ <div class="table_container">
31
+ <table class="table table-bordered table-striped table-hover">
32
+ <tbody>
33
+ <tr>
34
+ <th><%= t('Name') %></th>
35
+ <th><%= t('Processed') %></th>
36
+ <th><%= t('Failed') %></th>
37
+ <th><%= t('ExecutionTime') %></th>
38
+ <th><%= t('AvgExecutionTime') %></th>
39
+ </tr>
40
+ <% if job_results.any? %>
41
+ <% job_results.each_with_index do |(kls, jr), i| %>
42
+ <tr>
43
+ <td>
44
+ <div class="metrics-swatch-wrapper">
45
+ <% id = "metrics-swatch-#{kls}" %>
46
+ <input
47
+ type="checkbox"
48
+ id="<%= id %>"
49
+ class="metrics-swatch"
50
+ value="<%= kls %>"
51
+ />
52
+ <code><a href="<%= root_path %>metrics/<%= kls %>"><%= kls %></a></code>
53
+ </div>
54
+ <script>jobMetricsChart.registerSwatch("<%= id %>")</script>
55
+ </td>
56
+ <td><%= jr.dig("totals", "p") %></td>
57
+ <td><%= jr.dig("totals", "f") %></td>
58
+ <td><%= jr.dig("totals", "s").round(2) %> seconds</td>
59
+ <td><%= jr.total_avg("s").round(2) %> seconds</td>
60
+ </tr>
61
+ <% end %>
62
+ <% else %>
63
+ <tr><td colspan=5><%= t("NoDataFound") %></td></tr>
64
+ <% end %>
65
+ </tbody>
66
+ </table>
67
+ </div>
68
+
69
+ <p><small>Data from <%= @query_result.starts_at %> to <%= @query_result.ends_at %></small></p>
@@ -0,0 +1,87 @@
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/metrics.js"></script>
4
+
5
+ <%
6
+ job_result = @query_result.job_results[@name]
7
+ hist_totals = job_result.hist.values.first.zip(*job_result.hist.values[1..-1]).map(&:sum)
8
+ bucket_labels =Sidekiq::Metrics::Histogram::LABELS
9
+ bucket_intervals =Sidekiq::Metrics::Histogram::BUCKET_INTERVALS.reverse
10
+
11
+ # Replace INFINITY since it can't be represented as JSON
12
+ bucket_intervals[0] = bucket_intervals[1] * 2
13
+ %>
14
+
15
+ <% if job_result.totals["s"] > 0 %>
16
+ <div class="header-with-subheader">
17
+ <h1>
18
+ <a href="<%= root_path %>/metrics"><%= t(:metrics).to_s.titleize %></a> /
19
+ <%= h @name %>
20
+ </h1>
21
+ <h2>Histogram summary</h2>
22
+ </div>
23
+
24
+ <canvas id="hist-totals-chart"></canvas>
25
+
26
+ <script>
27
+ window.histTotalsChart = new HistTotalsChart(
28
+ "hist-totals-chart",
29
+ <%= Sidekiq.dump_json({
30
+ series: hist_totals,
31
+ labels: bucket_labels,
32
+ }) %>
33
+ )
34
+ </script>
35
+
36
+ <h2>Performance over time</h2>
37
+
38
+ <canvas id="hist-bubble-chart"></canvas>
39
+
40
+ <script>
41
+ window.histBubbleChart = new HistBubbleChart(
42
+ "hist-bubble-chart",
43
+ <%= Sidekiq.dump_json({
44
+ hist: job_result.hist,
45
+ marks: @query_result.marks.map { |m| [m.bucket, m.label] },
46
+ labels: @query_result.buckets,
47
+ histIntervals: bucket_intervals,
48
+ }) %>
49
+ )
50
+ </script>
51
+
52
+ <div class="table_container">
53
+ <table class="table table-bordered table-striped table-hover">
54
+ <tbody>
55
+ <tr>
56
+ <th><%= t('Time') %></th>
57
+ <th><%= t('Processed') %></th>
58
+ <th><%= t('Failed') %></th>
59
+ <th><%= t('ExecutionTime') %></th>
60
+ <th><%= t('AvgExecutionTime') %></th>
61
+ </tr>
62
+ <% @query_result.buckets.reverse.each do |bucket| %>
63
+ <tr>
64
+ <td><%= bucket %></td>
65
+ <td><%= job_result.series.dig("p", bucket) %></td>
66
+ <td><%= job_result.series.dig("f", bucket) %></td>
67
+ <% if (total_sec = job_result.series.dig("s", bucket)) > 0 %>
68
+ <td><%= total_sec.round(2) %> seconds</td>
69
+ <td><%= job_result.series_avg("s")[bucket].round(2) %> seconds</td>
70
+ <% else %>
71
+ <td>&mdash;</td>
72
+ <td>&mdash;</td>
73
+ <% end %>
74
+ </tr>
75
+ <% end %>
76
+ </tbody>
77
+ </table>
78
+ </div>
79
+ <p><small>Data from <%= @query_result.starts_at %> to <%= @query_result.ends_at %></small></p>
80
+ <% else %>
81
+ <h1>
82
+ <a href="<%= root_path %>/metrics"><%= t(:metrics).to_s.titleize %></a> /
83
+ <%= h @name %>
84
+ </h1>
85
+
86
+ <div class="alert alert-success"><%= t('NoJobMetricsFound') %></div>
87
+ <% end %>
data/web/views/queue.erb CHANGED
@@ -18,6 +18,7 @@
18
18
  <th><a href="<%= url %>?direction=<%= params[:direction] == 'asc' ? 'desc' : 'asc' %>"># <%= sort_direction_label %></a></th>
19
19
  <th><%= t('Job') %></th>
20
20
  <th><%= t('Arguments') %></th>
21
+ <th><%= t('Context') %></th>
21
22
  <th></th>
22
23
  </thead>
23
24
  <% @jobs.each_with_index do |job, index| %>
@@ -35,12 +36,15 @@
35
36
  <% a = job.display_args %>
36
37
  <% if a.inspect.size > 100 %>
37
38
  <span id="job_<%= index %>"><%= h(a.inspect[0..100]) + "... " %></span>
38
- <button data-toggle="job_<%= index %>" class="btn btn-default btn-xs"><%= t('ShowAll') %></button>
39
+ <button data-toggle="job_<%= index %>_full" class="btn btn-default btn-xs"><%= t('ShowAll') %></button>
39
40
  <div class="toggle" id="job_<%= index %>_full"><%= display_args(a) %></div>
40
41
  <% else %>
41
42
  <%= display_args(job.display_args) %>
42
43
  <% end %>
43
44
  </td>
45
+ <td>
46
+ <%= h(job["cattr"].inspect) if job["cattr"]&.any? %>
47
+ </td>
44
48
  <td>
45
49
  <form action="<%= root_path %>queues/<%= CGI.escape(@name) %>/delete" method="post">
46
50
  <%= csrf_tag %>
metadata CHANGED
@@ -1,43 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.3.1
4
+ version: 6.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Perham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-07 00:00:00.000000000 Z
11
+ date: 2023-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
+ - - "<"
18
+ - !ruby/object:Gem::Version
19
+ version: '5'
17
20
  - - ">="
18
21
  - !ruby/object:Gem::Version
19
- version: 4.2.0
22
+ version: 4.5.0
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
27
+ - - "<"
28
+ - !ruby/object:Gem::Version
29
+ version: '5'
24
30
  - - ">="
25
31
  - !ruby/object:Gem::Version
26
- version: 4.2.0
32
+ version: 4.5.0
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: connection_pool
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
37
+ - - "<"
38
+ - !ruby/object:Gem::Version
39
+ version: '3'
31
40
  - - ">="
32
41
  - !ruby/object:Gem::Version
33
- version: 2.2.2
42
+ version: 2.2.5
34
43
  type: :runtime
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
47
+ - - "<"
48
+ - !ruby/object:Gem::Version
49
+ version: '3'
38
50
  - - ">="
39
51
  - !ruby/object:Gem::Version
40
- version: 2.2.2
52
+ version: 2.2.5
41
53
  - !ruby/object:Gem::Dependency
42
54
  name: rack
43
55
  requirement: !ruby/object:Gem::Requirement
@@ -67,16 +79,16 @@ files:
67
79
  - bin/sidekiq
68
80
  - bin/sidekiqload
69
81
  - bin/sidekiqmon
70
- - lib/generators/sidekiq/templates/worker.rb.erb
71
- - lib/generators/sidekiq/templates/worker_spec.rb.erb
72
- - lib/generators/sidekiq/templates/worker_test.rb.erb
73
- - lib/generators/sidekiq/worker_generator.rb
82
+ - lib/generators/sidekiq/job_generator.rb
83
+ - lib/generators/sidekiq/templates/job.rb.erb
84
+ - lib/generators/sidekiq/templates/job_spec.rb.erb
85
+ - lib/generators/sidekiq/templates/job_test.rb.erb
74
86
  - lib/sidekiq.rb
75
87
  - lib/sidekiq/api.rb
76
88
  - lib/sidekiq/cli.rb
77
89
  - lib/sidekiq/client.rb
90
+ - lib/sidekiq/component.rb
78
91
  - lib/sidekiq/delay.rb
79
- - lib/sidekiq/exception_handler.rb
80
92
  - lib/sidekiq/extensions/action_mailer.rb
81
93
  - lib/sidekiq/extensions/active_record.rb
82
94
  - lib/sidekiq/extensions/class_methods.rb
@@ -85,23 +97,31 @@ files:
85
97
  - lib/sidekiq/job.rb
86
98
  - lib/sidekiq/job_logger.rb
87
99
  - lib/sidekiq/job_retry.rb
100
+ - lib/sidekiq/job_util.rb
88
101
  - lib/sidekiq/launcher.rb
89
102
  - lib/sidekiq/logger.rb
90
103
  - lib/sidekiq/manager.rb
104
+ - lib/sidekiq/metrics/deploy.rb
105
+ - lib/sidekiq/metrics/query.rb
106
+ - lib/sidekiq/metrics/shared.rb
107
+ - lib/sidekiq/metrics/tracking.rb
91
108
  - lib/sidekiq/middleware/chain.rb
92
109
  - lib/sidekiq/middleware/current_attributes.rb
93
110
  - lib/sidekiq/middleware/i18n.rb
111
+ - lib/sidekiq/middleware/modules.rb
94
112
  - lib/sidekiq/monitor.rb
95
113
  - lib/sidekiq/paginator.rb
96
114
  - lib/sidekiq/processor.rb
97
115
  - lib/sidekiq/rails.rb
116
+ - lib/sidekiq/redis_client_adapter.rb
98
117
  - lib/sidekiq/redis_connection.rb
118
+ - lib/sidekiq/ring_buffer.rb
99
119
  - lib/sidekiq/scheduled.rb
100
120
  - lib/sidekiq/sd_notify.rb
101
121
  - lib/sidekiq/systemd.rb
102
122
  - lib/sidekiq/testing.rb
103
123
  - lib/sidekiq/testing/inline.rb
104
- - lib/sidekiq/util.rb
124
+ - lib/sidekiq/transaction_aware_client.rb
105
125
  - lib/sidekiq/version.rb
106
126
  - lib/sidekiq/web.rb
107
127
  - lib/sidekiq/web/action.rb
@@ -116,7 +136,11 @@ files:
116
136
  - web/assets/images/logo.png
117
137
  - web/assets/images/status.png
118
138
  - web/assets/javascripts/application.js
139
+ - web/assets/javascripts/chart.min.js
140
+ - web/assets/javascripts/chartjs-plugin-annotation.min.js
119
141
  - web/assets/javascripts/dashboard.js
142
+ - web/assets/javascripts/graph.js
143
+ - web/assets/javascripts/metrics.js
120
144
  - web/assets/stylesheets/application-dark.css
121
145
  - web/assets/stylesheets/application-rtl.css
122
146
  - web/assets/stylesheets/application.css
@@ -161,6 +185,8 @@ files:
161
185
  - web/views/dashboard.erb
162
186
  - web/views/dead.erb
163
187
  - web/views/layout.erb
188
+ - web/views/metrics.erb
189
+ - web/views/metrics_for_job.erb
164
190
  - web/views/morgue.erb
165
191
  - web/views/queue.erb
166
192
  - web/views/queues.erb
@@ -192,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
218
  - !ruby/object:Gem::Version
193
219
  version: '0'
194
220
  requirements: []
195
- rubygems_version: 3.1.4
221
+ rubygems_version: 3.4.7
196
222
  signing_key:
197
223
  specification_version: 4
198
224
  summary: Simple, efficient background processing for Ruby
@@ -1,57 +0,0 @@
1
- require "rails/generators/named_base"
2
-
3
- module Sidekiq
4
- module Generators # :nodoc:
5
- class WorkerGenerator < ::Rails::Generators::NamedBase # :nodoc:
6
- desc "This generator creates a Sidekiq Worker in app/workers and a corresponding test"
7
-
8
- check_class_collision suffix: "Worker"
9
-
10
- def self.default_generator_root
11
- File.dirname(__FILE__)
12
- end
13
-
14
- def create_worker_file
15
- template "worker.rb.erb", File.join("app/workers", class_path, "#{file_name}_worker.rb")
16
- end
17
-
18
- def create_test_file
19
- return unless test_framework
20
-
21
- if test_framework == :rspec
22
- create_worker_spec
23
- else
24
- create_worker_test
25
- end
26
- end
27
-
28
- private
29
-
30
- def create_worker_spec
31
- template_file = File.join(
32
- "spec/workers",
33
- class_path,
34
- "#{file_name}_worker_spec.rb"
35
- )
36
- template "worker_spec.rb.erb", template_file
37
- end
38
-
39
- def create_worker_test
40
- template_file = File.join(
41
- "test/workers",
42
- class_path,
43
- "#{file_name}_worker_test.rb"
44
- )
45
- template "worker_test.rb.erb", template_file
46
- end
47
-
48
- def file_name
49
- @_file_name ||= super.sub(/_?worker\z/i, "")
50
- end
51
-
52
- def test_framework
53
- ::Rails.application.config.generators.options[:rails][:test_framework]
54
- end
55
- end
56
- end
57
- end
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "sidekiq"
4
-
5
- module Sidekiq
6
- module ExceptionHandler
7
- class Logger
8
- def call(ex, ctx)
9
- Sidekiq.logger.warn(Sidekiq.dump_json(ctx)) unless ctx.empty?
10
- Sidekiq.logger.warn("#{ex.class.name}: #{ex.message}")
11
- Sidekiq.logger.warn(ex.backtrace.join("\n")) unless ex.backtrace.nil?
12
- end
13
-
14
- Sidekiq.error_handlers << Sidekiq::ExceptionHandler::Logger.new
15
- end
16
-
17
- def handle_exception(ex, ctx = {})
18
- Sidekiq.error_handlers.each do |handler|
19
- handler.call(ex, ctx)
20
- rescue => ex
21
- Sidekiq.logger.error "!!! ERROR HANDLER THREW AN ERROR !!!"
22
- Sidekiq.logger.error ex
23
- Sidekiq.logger.error ex.backtrace.join("\n") unless ex.backtrace.nil?
24
- end
25
- end
26
- end
27
- end