sidekiq 7.3.9 → 8.0.0.beta1

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.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/Changes.md +21 -4
  3. data/README.md +16 -13
  4. data/bin/sidekiqload +10 -10
  5. data/bin/webload +69 -0
  6. data/lib/active_job/queue_adapters/sidekiq_adapter.rb +5 -5
  7. data/lib/sidekiq/api.rb +108 -36
  8. data/lib/sidekiq/capsule.rb +1 -1
  9. data/lib/sidekiq/cli.rb +15 -19
  10. data/lib/sidekiq/client.rb +13 -16
  11. data/lib/sidekiq/component.rb +30 -2
  12. data/lib/sidekiq/config.rb +18 -15
  13. data/lib/sidekiq/embedded.rb +1 -0
  14. data/lib/sidekiq/job/iterable.rb +2 -4
  15. data/lib/sidekiq/job_retry.rb +2 -2
  16. data/lib/sidekiq/job_util.rb +5 -1
  17. data/lib/sidekiq/launcher.rb +1 -1
  18. data/lib/sidekiq/logger.rb +6 -10
  19. data/lib/sidekiq/manager.rb +0 -1
  20. data/lib/sidekiq/metrics/query.rb +1 -3
  21. data/lib/sidekiq/middleware/current_attributes.rb +5 -17
  22. data/lib/sidekiq/paginator.rb +8 -1
  23. data/lib/sidekiq/processor.rb +21 -14
  24. data/lib/sidekiq/profiler.rb +59 -0
  25. data/lib/sidekiq/redis_client_adapter.rb +0 -1
  26. data/lib/sidekiq/testing.rb +2 -2
  27. data/lib/sidekiq/version.rb +2 -2
  28. data/lib/sidekiq/web/action.rb +101 -85
  29. data/lib/sidekiq/web/application.rb +339 -333
  30. data/lib/sidekiq/web/config.rb +116 -0
  31. data/lib/sidekiq/web/helpers.rb +40 -15
  32. data/lib/sidekiq/web/router.rb +60 -76
  33. data/lib/sidekiq/web.rb +51 -156
  34. data/sidekiq.gemspec +5 -4
  35. data/web/assets/javascripts/application.js +6 -13
  36. data/web/assets/javascripts/base-charts.js +30 -18
  37. data/web/assets/javascripts/metrics.js +1 -1
  38. data/web/assets/stylesheets/style.css +750 -0
  39. data/web/locales/ar.yml +1 -0
  40. data/web/locales/cs.yml +1 -0
  41. data/web/locales/da.yml +1 -0
  42. data/web/locales/de.yml +1 -0
  43. data/web/locales/el.yml +1 -0
  44. data/web/locales/en.yml +6 -0
  45. data/web/locales/es.yml +24 -2
  46. data/web/locales/fa.yml +1 -0
  47. data/web/locales/fr.yml +1 -0
  48. data/web/locales/gd.yml +1 -0
  49. data/web/locales/he.yml +1 -0
  50. data/web/locales/hi.yml +1 -0
  51. data/web/locales/it.yml +1 -0
  52. data/web/locales/ja.yml +1 -0
  53. data/web/locales/ko.yml +1 -0
  54. data/web/locales/lt.yml +1 -0
  55. data/web/locales/nb.yml +1 -0
  56. data/web/locales/nl.yml +1 -0
  57. data/web/locales/pl.yml +1 -0
  58. data/web/locales/{pt-br.yml → pt-BR.yml} +2 -1
  59. data/web/locales/pt.yml +1 -0
  60. data/web/locales/ru.yml +1 -0
  61. data/web/locales/sv.yml +1 -0
  62. data/web/locales/ta.yml +1 -0
  63. data/web/locales/tr.yml +1 -0
  64. data/web/locales/uk.yml +1 -0
  65. data/web/locales/ur.yml +1 -0
  66. data/web/locales/vi.yml +1 -0
  67. data/web/locales/{zh-cn.yml → zh-CN.yml} +85 -73
  68. data/web/locales/{zh-tw.yml → zh-TW.yml} +2 -1
  69. data/web/views/_footer.erb +31 -33
  70. data/web/views/_job_info.erb +91 -89
  71. data/web/views/_metrics_period_select.erb +1 -1
  72. data/web/views/_nav.erb +14 -21
  73. data/web/views/_paging.erb +23 -21
  74. data/web/views/_poll_link.erb +2 -2
  75. data/web/views/_summary.erb +16 -16
  76. data/web/views/busy.erb +124 -122
  77. data/web/views/dashboard.erb +61 -66
  78. data/web/views/dead.erb +31 -27
  79. data/web/views/filtering.erb +3 -3
  80. data/web/views/layout.erb +5 -21
  81. data/web/views/metrics.erb +83 -80
  82. data/web/views/metrics_for_job.erb +39 -42
  83. data/web/views/morgue.erb +61 -70
  84. data/web/views/profiles.erb +43 -0
  85. data/web/views/queue.erb +54 -52
  86. data/web/views/queues.erb +43 -41
  87. data/web/views/retries.erb +66 -75
  88. data/web/views/retry.erb +32 -27
  89. data/web/views/scheduled.erb +58 -54
  90. data/web/views/scheduled_job_info.erb +1 -1
  91. metadata +31 -18
  92. data/web/assets/stylesheets/application-dark.css +0 -147
  93. data/web/assets/stylesheets/application-rtl.css +0 -163
  94. data/web/assets/stylesheets/application.css +0 -759
  95. data/web/assets/stylesheets/bootstrap-rtl.min.css +0 -9
  96. data/web/assets/stylesheets/bootstrap.css +0 -5
  97. data/web/views/_status.erb +0 -4
data/sidekiq.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
12
12
  gem.files = %w[sidekiq.gemspec README.md Changes.md LICENSE.txt] + `git ls-files | grep -E '^(bin|lib|web)'`.split("\n")
13
13
  gem.name = "sidekiq"
14
14
  gem.version = Sidekiq::VERSION
15
- gem.required_ruby_version = ">= 2.7.0"
15
+ gem.required_ruby_version = ">= 3.2.0"
16
16
 
17
17
  gem.metadata = {
18
18
  "homepage_uri" => "https://sidekiq.org",
@@ -23,9 +23,10 @@ Gem::Specification.new do |gem|
23
23
  "rubygems_mfa_required" => "true"
24
24
  }
25
25
 
26
- gem.add_dependency "redis-client", ">= 0.22.2"
27
- gem.add_dependency "connection_pool", ">= 2.3.0"
28
- gem.add_dependency "rack", ">= 2.2.4"
26
+ gem.add_dependency "redis-client", ">= 0.23.2"
27
+ gem.add_dependency "connection_pool", ">= 2.5.0"
28
+ gem.add_dependency "rack", ">= 3.1.0"
29
+ gem.add_dependency "json", ">= 2.9.0"
29
30
  gem.add_dependency "logger"
30
31
  gem.add_dependency "base64"
31
32
  end
@@ -31,7 +31,7 @@ function addListeners() {
31
31
  node.addEventListener("click", addDataToggleListeners)
32
32
  })
33
33
 
34
- addShiftClickListeners()
34
+ addShiftClickListeners();
35
35
  updateFuzzyTimes();
36
36
  updateNumbers();
37
37
  updateProgressBars();
@@ -69,11 +69,7 @@ function addDataToggleListeners(event) {
69
69
  var source = event.target || event.srcElement;
70
70
  var targName = source.getAttribute("data-toggle");
71
71
  var full = document.getElementById(targName);
72
- if (full.style.display == "block") {
73
- full.style.display = 'none';
74
- } else {
75
- full.style.display = 'block';
76
- }
72
+ full.classList.toggle("is-open");
77
73
  }
78
74
 
79
75
  function addShiftClickListeners() {
@@ -130,11 +126,11 @@ function setLivePollFromUrl() {
130
126
 
131
127
  function updateLivePollButton() {
132
128
  if (localStorage.sidekiqLivePoll == "enabled") {
133
- document.querySelectorAll('.live-poll-stop').forEach(box => { box.style.display = "inline-block" })
134
- document.querySelectorAll('.live-poll-start').forEach(box => { box.style.display = "none" })
129
+ document.querySelectorAll('.live-poll-stop').forEach(box => { box.classList.add("active") })
130
+ document.querySelectorAll('.live-poll-start').forEach(box => { box.classList.remove("active") })
135
131
  } else {
136
- document.querySelectorAll('.live-poll-start').forEach(box => { box.style.display = "inline-block" })
137
- document.querySelectorAll('.live-poll-stop').forEach(box => { box.style.display = "none" })
132
+ document.querySelectorAll('.live-poll-start').forEach(box => { box.classList.add("active") })
133
+ document.querySelectorAll('.live-poll-stop').forEach(box => { box.classList.remove("active") })
138
134
  }
139
135
  }
140
136
 
@@ -169,9 +165,6 @@ function replacePage(text) {
169
165
  var page = doc.querySelector('#page')
170
166
  document.querySelector("#page").replaceWith(page)
171
167
 
172
- var header_status = doc.querySelector('.status')
173
- document.querySelector('.status').replaceWith(header_status)
174
-
175
168
  addListeners();
176
169
  }
177
170
 
@@ -1,27 +1,33 @@
1
1
  if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
2
- Chart.defaults.borderColor = "#333";
3
- Chart.defaults.color = "#aaa";
2
+ Chart.defaults.borderColor = "oklch(22% 0.01 256)";
3
+ Chart.defaults.color = "oklch(65% 0.01 256)";
4
4
  }
5
5
 
6
6
  class Colors {
7
7
  constructor() {
8
8
  this.assignments = {};
9
- this.success = "#006f68";
10
- this.failure = "#af0014";
11
- this.fallback = "#999";
12
- this.primary = "#537bc4";
9
+ if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
10
+ this.light = "65%";
11
+ this.chroma = "0.15";
12
+ } else {
13
+ this.light = "48%";
14
+ this.chroma = "0.2";
15
+ }
16
+ this.success = "oklch(" + this.light + " " + this.chroma + " 179)";
17
+ this.failure = "oklch(" + this.light + " " + this.chroma + " 29)";
18
+ this.fallback = "oklch(" + this.light + " 0.02 269)";
19
+ this.primary = "oklch(" + this.light + " " + this.chroma + " 269)";
13
20
  this.available = [
14
- // Colors taken from https://www.chartjs.org/docs/latest/samples/utils.html
15
- "#537bc4",
16
- "#4dc9f6",
17
- "#f67019",
18
- "#f53794",
19
- "#acc236",
20
- "#166a8f",
21
- "#00a950",
22
- "#58595b",
23
- "#8549ba",
24
- "#991b1b",
21
+ "oklch(" + this.light + " " + this.chroma + " 256)",
22
+ "oklch(" + this.light + " " + this.chroma + " 196)",
23
+ "oklch(" + this.light + " " + this.chroma + " 46)",
24
+ "oklch(" + this.light + " " + this.chroma + " 316)",
25
+ "oklch(" + this.light + " " + this.chroma + " 106)",
26
+ "oklch(" + this.light + " " + this.chroma + " 226)",
27
+ "oklch(" + this.light + " " + this.chroma + " 136)",
28
+ "oklch(" + this.light + " 0.02 269)",
29
+ "oklch(" + this.light + " " + this.chroma + " 286)",
30
+ "oklch(" + this.light + " " + this.chroma + " 16)",
25
31
  ];
26
32
  }
27
33
 
@@ -90,12 +96,18 @@ class BaseChart {
90
96
  };
91
97
 
92
98
  if (this.options.marks) {
99
+ if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
100
+ this.Borderlight = "30%";
101
+ } else {
102
+ this.Borderlight = "65%";
103
+ }
104
+
93
105
  this.options.marks.forEach(([bucket, label], i) => {
94
106
  chartOptions.plugins.annotation.annotations[`deploy-${i}`] = {
95
107
  type: "line",
96
108
  xMin: bucket,
97
109
  xMax: bucket,
98
- borderColor: "rgba(220, 38, 38, 0.4)",
110
+ borderColor: "oklch(" + this.Borderlight + " 0.01 256)",
99
111
  borderWidth: 2,
100
112
  };
101
113
  });
@@ -39,7 +39,7 @@ class JobMetricsOverviewChart extends BaseChart {
39
39
  updateSwatch(kls, checked) {
40
40
  const el = this.swatches[kls];
41
41
  el.checked = checked;
42
- el.style.color = this.colors.assignments[kls] || "";
42
+ el.style.accentColor = this.colors.assignments[kls] || "";
43
43
  }
44
44
 
45
45
  toggleKls(kls, visible) {