sidekiq 7.0.1 → 7.0.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.

Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/Changes.md +69 -9
  3. data/README.md +29 -22
  4. data/bin/sidekiqload +186 -109
  5. data/bin/sidekiqmon +3 -0
  6. data/lib/sidekiq/api.rb +43 -4
  7. data/lib/sidekiq/capsule.rb +17 -0
  8. data/lib/sidekiq/cli.rb +3 -2
  9. data/lib/sidekiq/client.rb +1 -1
  10. data/lib/sidekiq/component.rb +2 -0
  11. data/lib/sidekiq/config.rb +2 -3
  12. data/lib/sidekiq/deploy.rb +3 -3
  13. data/lib/sidekiq/embedded.rb +1 -1
  14. data/lib/sidekiq/fetch.rb +3 -5
  15. data/lib/sidekiq/job.rb +2 -2
  16. data/lib/sidekiq/job_logger.rb +1 -1
  17. data/lib/sidekiq/job_retry.rb +5 -4
  18. data/lib/sidekiq/job_util.rb +48 -14
  19. data/lib/sidekiq/launcher.rb +13 -7
  20. data/lib/sidekiq/metrics/query.rb +1 -1
  21. data/lib/sidekiq/metrics/tracking.rb +2 -0
  22. data/lib/sidekiq/middleware/chain.rb +12 -9
  23. data/lib/sidekiq/middleware/current_attributes.rb +5 -7
  24. data/lib/sidekiq/monitor.rb +17 -4
  25. data/lib/sidekiq/paginator.rb +2 -2
  26. data/lib/sidekiq/processor.rb +4 -1
  27. data/lib/sidekiq/rails.rb +2 -1
  28. data/lib/sidekiq/redis_client_adapter.rb +3 -6
  29. data/lib/sidekiq/scheduled.rb +1 -1
  30. data/lib/sidekiq/version.rb +1 -1
  31. data/lib/sidekiq/web/application.rb +20 -5
  32. data/lib/sidekiq/web/helpers.rb +15 -7
  33. data/lib/sidekiq/web.rb +4 -0
  34. data/sidekiq.gemspec +11 -22
  35. data/web/assets/javascripts/application.js +18 -0
  36. data/web/assets/javascripts/metrics.js +30 -2
  37. data/web/assets/stylesheets/application-dark.css +4 -0
  38. data/web/assets/stylesheets/application.css +3 -3
  39. data/web/locales/da.yml +11 -4
  40. data/web/locales/ja.yml +3 -1
  41. data/web/views/_footer.erb +2 -2
  42. data/web/views/_job_info.erb +18 -2
  43. data/web/views/_metrics_period_select.erb +12 -0
  44. data/web/views/_paging.erb +2 -0
  45. data/web/views/busy.erb +37 -26
  46. data/web/views/metrics.erb +6 -4
  47. data/web/views/metrics_for_job.erb +9 -7
  48. data/web/views/morgue.erb +5 -9
  49. data/web/views/queue.erb +10 -14
  50. data/web/views/queues.erb +3 -1
  51. data/web/views/retries.erb +5 -9
  52. data/web/views/scheduled.erb +12 -13
  53. metadata +17 -26
@@ -54,7 +54,7 @@ module Sidekiq
54
54
  @lua_zpopbyscore_sha = conn.script(:load, LUA_ZPOPBYSCORE)
55
55
  end
56
56
 
57
- conn.evalsha(@lua_zpopbyscore_sha, keys, argv)
57
+ conn.call("EVALSHA", @lua_zpopbyscore_sha, keys.size, *keys, *argv)
58
58
  rescue RedisClient::CommandError => e
59
59
  raise unless e.message.start_with?("NOSCRIPT")
60
60
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sidekiq
4
- VERSION = "7.0.1"
4
+ VERSION = "7.0.8"
5
5
  MAJOR = 7
6
6
  end
@@ -20,6 +20,12 @@ module Sidekiq
20
20
  "worker-src 'self'",
21
21
  "base-uri 'self'"
22
22
  ].join("; ").freeze
23
+ METRICS_PERIODS = {
24
+ "1h" => 60,
25
+ "2h" => 120,
26
+ "4h" => 240,
27
+ "8h" => 480
28
+ }
23
29
 
24
30
  def initialize(klass)
25
31
  @klass = klass
@@ -62,14 +68,20 @@ module Sidekiq
62
68
 
63
69
  get "/metrics" do
64
70
  q = Sidekiq::Metrics::Query.new
65
- @query_result = q.top_jobs
71
+ @period = h((params[:period] || "")[0..1])
72
+ @periods = METRICS_PERIODS
73
+ minutes = @periods.fetch(@period, @periods.values.first)
74
+ @query_result = q.top_jobs(minutes: minutes)
66
75
  erb(:metrics)
67
76
  end
68
77
 
69
78
  get "/metrics/:name" do
70
79
  @name = route_params[:name]
80
+ @period = h((params[:period] || "")[0..1])
71
81
  q = Sidekiq::Metrics::Query.new
72
- @query_result = q.for_job(@name)
82
+ @periods = METRICS_PERIODS
83
+ minutes = @periods.fetch(@period, @periods.values.first)
84
+ @query_result = q.for_job(@name, minutes: minutes)
73
85
  erb(:metrics_for_job)
74
86
  end
75
87
 
@@ -82,11 +94,14 @@ module Sidekiq
82
94
 
83
95
  post "/busy" do
84
96
  if params["identity"]
85
- p = Sidekiq::Process.new("identity" => params["identity"])
86
- p.quiet! if params["quiet"]
87
- p.stop! if params["stop"]
97
+ pro = Sidekiq::ProcessSet[params["identity"]]
98
+
99
+ pro.quiet! if params["quiet"]
100
+ pro.stop! if params["stop"]
88
101
  else
89
102
  processes.each do |pro|
103
+ next if pro.embedded?
104
+
90
105
  pro.quiet! if params["quiet"]
91
106
  pro.stop! if params["stop"]
92
107
  end
@@ -15,7 +15,7 @@ module Sidekiq
15
15
  # so extensions can be localized
16
16
  @strings[lang] ||= settings.locales.each_with_object({}) do |path, global|
17
17
  find_locale_files(lang).each do |file|
18
- strs = YAML.safe_load(File.open(file))
18
+ strs = YAML.safe_load(File.read(file))
19
19
  global.merge!(strs[lang])
20
20
  end
21
21
  end
@@ -118,7 +118,7 @@ module Sidekiq
118
118
  }.join(" ")
119
119
  end
120
120
 
121
- # mperham/sidekiq#3243
121
+ # sidekiq/sidekiq#3243
122
122
  def unfiltered?
123
123
  yield unless env["PATH_INFO"].start_with?("/filter/")
124
124
  end
@@ -137,7 +137,7 @@ module Sidekiq
137
137
  end
138
138
 
139
139
  def sort_direction_label
140
- params[:direction] == "asc" ? "↑" : "↓"
140
+ (params[:direction] == "asc") ? "↑" : "↓"
141
141
  end
142
142
 
143
143
  def workset
@@ -161,13 +161,21 @@ module Sidekiq
161
161
  end
162
162
  end
163
163
 
164
+ def busy_weights(capsule_weights)
165
+ # backwards compat with 7.0.0, remove in 7.1
166
+ cw = [capsule_weights].flatten
167
+ cw.map { |hash|
168
+ hash.map { |name, weight| (weight > 0) ? +name << ": " << weight.to_s : name }.join(", ")
169
+ }.join("; ")
170
+ end
171
+
164
172
  def stats
165
173
  @stats ||= Sidekiq::Stats.new
166
174
  end
167
175
 
168
176
  def redis_url
169
177
  Sidekiq.redis do |conn|
170
- conn._config.server_url
178
+ conn.config.server_url
171
179
  end
172
180
  end
173
181
 
@@ -184,7 +192,7 @@ module Sidekiq
184
192
  end
185
193
 
186
194
  def current_status
187
- workset.size == 0 ? "idle" : "active"
195
+ (workset.size == 0) ? "idle" : "active"
188
196
  end
189
197
 
190
198
  def relative_time(time)
@@ -217,7 +225,7 @@ module Sidekiq
217
225
  end
218
226
 
219
227
  def truncate(text, truncate_after_chars = 2000)
220
- truncate_after_chars && text.size > truncate_after_chars ? "#{text[0..truncate_after_chars]}..." : text
228
+ (truncate_after_chars && text.size > truncate_after_chars) ? "#{text[0..truncate_after_chars]}..." : text
221
229
  end
222
230
 
223
231
  def display_args(args, truncate_after_chars = 2000)
@@ -324,7 +332,7 @@ module Sidekiq
324
332
  end
325
333
 
326
334
  def pollable?
327
- !(current_path == "" || current_path.starts_with?("metrics"))
335
+ !(current_path == "" || current_path.start_with?("metrics"))
328
336
  end
329
337
 
330
338
  def retry_or_delete_or_kill(job, params)
data/lib/sidekiq/web.rb CHANGED
@@ -48,6 +48,10 @@ module Sidekiq
48
48
  end
49
49
  alias_method :tabs, :custom_tabs
50
50
 
51
+ def custom_job_info_rows
52
+ @custom_job_info_rows ||= []
53
+ end
54
+
51
55
  def locales
52
56
  @locales ||= LOCALES
53
57
  end
data/sidekiq.gemspec CHANGED
@@ -2,7 +2,7 @@ require_relative "lib/sidekiq/version"
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.authors = ["Mike Perham"]
5
- gem.email = ["mperham@gmail.com"]
5
+ gem.email = ["info@contribsys.com"]
6
6
  gem.summary = "Simple, efficient background processing for Ruby"
7
7
  gem.description = "Simple, efficient background processing for Ruby."
8
8
  gem.homepage = "https://sidekiq.org"
@@ -16,35 +16,24 @@ Gem::Specification.new do |gem|
16
16
 
17
17
  gem.metadata = {
18
18
  "homepage_uri" => "https://sidekiq.org",
19
- "bug_tracker_uri" => "https://github.com/mperham/sidekiq/issues",
20
- "documentation_uri" => "https://github.com/mperham/sidekiq/wiki",
21
- "changelog_uri" => "https://github.com/mperham/sidekiq/blob/main/Changes.md",
22
- "source_code_uri" => "https://github.com/mperham/sidekiq"
19
+ "bug_tracker_uri" => "https://github.com/sidekiq/sidekiq/issues",
20
+ "documentation_uri" => "https://github.com/sidekiq/sidekiq/wiki",
21
+ "changelog_uri" => "https://github.com/sidekiq/sidekiq/blob/main/Changes.md",
22
+ "source_code_uri" => "https://github.com/sidekiq/sidekiq",
23
+ "rubygems_mfa_required" => "true"
23
24
  }
24
25
 
25
- gem.add_dependency "redis-client", ">= 0.9.0"
26
+ gem.add_dependency "redis-client", ">= 0.11.0"
26
27
  gem.add_dependency "connection_pool", ">= 2.3.0"
27
28
  gem.add_dependency "rack", ">= 2.2.4"
28
29
  gem.add_dependency "concurrent-ruby", "< 2"
29
30
  gem.post_install_message = <<~EOM
30
31
 
31
- ####################################################
32
-
33
-
34
- █████████ █████ ██████████ ██████████ █████ ████ █████ ██████ ██████████ █████
35
- ███░░░░░███░░███ ░░███░░░░███ ░░███░░░░░█░░███ ███░ ░░███ ███░░░░███ ░███░░░░███ ███░░░███
36
- ░███ ░░░ ░███ ░███ ░░███ ░███ █ ░ ░███ ███ ░███ ███ ░░███ ░░░ ███ ███ ░░███
37
- ░░█████████ ░███ ░███ ░███ ░██████ ░███████ ░███ ░███ ░███ ███ ░███ ░███
38
- ░░░░░░░░███ ░███ ░███ ░███ ░███░░█ ░███░░███ ░███ ░███ ██░███ ███ ░███ ░███
39
- ███ ░███ ░███ ░███ ███ ░███ ░ █ ░███ ░░███ ░███ ░░███ ░░████ ███ ░░███ ███
40
- ░░█████████ █████ ██████████ ██████████ █████ ░░████ █████ ░░░██████░██ ███ ██ ░░░█████░
41
- ░░░░░░░░░ ░░░░░ ░░░░░░░░░░ ░░░░░░░░░░ ░░░░░ ░░░░ ░░░░░ ░░░░░░ ░░ ░░░ ░░ ░░░░░░
42
-
32
+ Welcome to Sidekiq 7.0!
43
33
 
44
34
  1. Use `gem 'sidekiq', '<7'` in your Gemfile if you don't want this new version.
45
- 2. Read the release notes at https://github.com/mperham/sidekiq/blob/main/docs/7.0-Upgrade.md
46
- 3. Search for open/closed issues at https://github.com/mperham/sidekiq/issues/
47
-
48
- ####################################################
35
+ 2. Read the release notes at https://github.com/sidekiq/sidekiq/blob/main/docs/7.0-Upgrade.md
36
+ 3. If you have problems, search for open/closed issues at https://github.com/sidekiq/sidekiq/issues/
37
+
49
38
  EOM
50
39
  end
@@ -31,6 +31,7 @@ function addListeners() {
31
31
  node.addEventListener("click", addDataToggleListeners)
32
32
  })
33
33
 
34
+ addShiftClickListeners()
34
35
  updateFuzzyTimes();
35
36
  setLivePollFromUrl();
36
37
 
@@ -71,6 +72,23 @@ function addDataToggleListeners(event) {
71
72
  }
72
73
  }
73
74
 
75
+ function addShiftClickListeners() {
76
+ let checkboxes = Array.from(document.querySelectorAll(".shift_clickable"));
77
+ let lastChecked = null;
78
+ checkboxes.forEach(checkbox => {
79
+ checkbox.addEventListener("click", (e) => {
80
+ if (e.shiftKey && lastChecked) {
81
+ let myIndex = checkboxes.indexOf(checkbox);
82
+ let lastIndex = checkboxes.indexOf(lastChecked);
83
+ let [min, max] = [myIndex, lastIndex].sort();
84
+ let newState = checkbox.checked;
85
+ checkboxes.slice(min, max).forEach(c => c.checked = newState);
86
+ }
87
+ lastChecked = checkbox;
88
+ });
89
+ });
90
+ }
91
+
74
92
  function updateFuzzyTimes() {
75
93
  var locale = document.body.getAttribute("data-locale");
76
94
  var parts = locale.split('-');
@@ -4,6 +4,14 @@ class JobMetricsOverviewChart extends BaseChart {
4
4
  this.swatches = [];
5
5
  this.visibleKls = options.visibleKls;
6
6
 
7
+ const countBuckets = this.options.labels.length / 60;
8
+ this.labelBuckets = this.options.labels.reduce((acc, label, index) => {
9
+ const bucket = Math.floor(index / countBuckets);
10
+ acc[bucket] = acc[bucket] || [];
11
+ acc[bucket].push(label);
12
+ return acc;
13
+ }, []);
14
+
7
15
  this.init();
8
16
  }
9
17
 
@@ -52,7 +60,7 @@ class JobMetricsOverviewChart extends BaseChart {
52
60
 
53
61
  return {
54
62
  label: kls,
55
- data: this.options.series[kls],
63
+ data: this.buildSeries(kls),
56
64
  borderColor: color,
57
65
  backgroundColor: color,
58
66
  borderWidth: 2,
@@ -60,6 +68,26 @@ class JobMetricsOverviewChart extends BaseChart {
60
68
  };
61
69
  }
62
70
 
71
+ buildSeries(kls) {
72
+ // `series` is an object that maps labels to counts => { "20:15" => 2, "20:16" => 3, ... }
73
+ const series = this.options.series[kls];
74
+ return this.labelBuckets.reduce((acc, labels) => {
75
+ const bucketValues = labels.map(label => series[label]).filter(v => v);
76
+ if (bucketValues.length > 0) {
77
+ // Sum up the values for each bucket that has data.
78
+ // The new label is the bucket's first label, its start time.
79
+ acc[labels[0]] = bucketValues.reduce((a, b) => a + b, 0);
80
+ }
81
+ return acc;
82
+ }, {});
83
+ }
84
+
85
+ buildTooltipTitle(items) {
86
+ const [first, ...rest] = this.labelBuckets.find((labels) => labels[0] === items[0].label);
87
+ const title = [first, rest[rest.length - 1]].filter(v => v).join(" - ");
88
+ return `${title} UTC`
89
+ }
90
+
63
91
  get chartOptions() {
64
92
  return {
65
93
  ...super.chartOptions,
@@ -80,7 +108,7 @@ class JobMetricsOverviewChart extends BaseChart {
80
108
  tooltip: {
81
109
  ...super.chartOptions.plugins.tooltip,
82
110
  callbacks: {
83
- title: (items) => `${items[0].label} UTC`,
111
+ title: (items) => this.buildTooltipTitle(items),
84
112
  label: (item) =>
85
113
  `${item.dataset.label}: ${item.parsed.y.toFixed(1)} ` +
86
114
  `${this.options.units}`,
@@ -72,6 +72,10 @@ table {
72
72
  background-color: #31708f;
73
73
  }
74
74
 
75
+ .alert-warning {
76
+ background-color: #c47612;
77
+ }
78
+
75
79
  a:link, a:active, a:hover, a:visited {
76
80
  color: #ddd;
77
81
  }
@@ -72,7 +72,7 @@ h1, h2, h3 {
72
72
  line-height: 45px;
73
73
  }
74
74
 
75
- .header-container {
75
+ .header-container, .header-container .page-title-container {
76
76
  display: flex;
77
77
  justify-content: space-between;
78
78
  align-items: center;
@@ -676,8 +676,8 @@ div.interval-slider input {
676
676
  }
677
677
 
678
678
  .info-circle {
679
- color: #ccc;
680
- background-color: #000;
679
+ color: #333;
680
+ background-color: #ccc;
681
681
  border-radius: 50%;
682
682
  text-align: center;
683
683
  vertical-align: middle;
data/web/locales/da.yml CHANGED
@@ -1,11 +1,12 @@
1
1
  # elements like %{queue} are variables and should not be translated
2
2
  da:
3
- Actions: Actions
3
+ Actions: Handlinger
4
4
  AddToQueue: Tilføj til kø
5
5
  AreYouSure: Er du sikker?
6
6
  AreYouSureDeleteJob: Er du sikker på at du vil slette dette job?
7
7
  AreYouSureDeleteQueue: Er du sikker på at du vil slette %{queue} køen?
8
8
  Arguments: Argumenter
9
+ AvgExecutionTime: Gennemsnitlig eksekveringstid
9
10
  Busy: Travl
10
11
  Class: Klasse
11
12
  Connections: Forbindelser
@@ -18,21 +19,25 @@ da:
18
19
  Enqueued: I kø
19
20
  Error: Fejl
20
21
  ErrorBacktrace: Fejl backtrace
21
- ErrorClass: Fejl klasse
22
- ErrorMessage: Fejl besked
22
+ ErrorClass: Fejlklasse
23
+ ErrorMessage: Fejlbesked
23
24
  Extras: Ekstra
24
25
  Failed: Fejlet
26
+ Failure: Fejl
25
27
  Failures: Fejl
26
28
  GoBack: ← Tilbage
27
29
  History: Historik
28
30
  Job: Job
29
31
  Jobs: Jobs
32
+ Latency: Forsinkelse
30
33
  LastRetry: Sidste forsøg
31
34
  LivePoll: Live Poll
32
35
  MemoryUsage: RAM forbrug
36
+ Name: Navn
33
37
  Namespace: Namespace
34
38
  NextRetry: Næste forsøg
35
39
  NoDeadJobsFound: Ingen døde jobs fundet
40
+ NoJobMetricsFound: Ingen nylig job-metrics blev fundet
36
41
  NoRetriesFound: Ingen gen-forsøg var fundet
37
42
  NoScheduledFound: Ingen jobs i kø fundet
38
43
  OneMonth: 1 måned
@@ -43,7 +48,7 @@ da:
43
48
  Processes: Processer
44
49
  Queue: Kø
45
50
  Queues: Køer
46
- Realtime: Real-time
51
+ Realtime: Realtid
47
52
  Retries: Forsøg
48
53
  RetryAll: Forsøg alle
49
54
  RetryCount: Antal forsøg
@@ -56,10 +61,12 @@ da:
56
61
  Started: Startet
57
62
  Status: Status
58
63
  StopPolling: Stop Polling
64
+ Success: Succes
59
65
  Thread: Tråd
60
66
  Threads: Tråde
61
67
  ThreeMonths: 3 måneder
62
68
  Time: Tid
69
+ TotalExecutionTime: Total eksekveringstid
63
70
  Uptime: Oppetid (dage)
64
71
  Version: Version
65
72
  When: Når
data/web/locales/ja.yml CHANGED
@@ -27,6 +27,7 @@ ja:
27
27
  Extras: エクストラ
28
28
  Failed: 失敗
29
29
  Failures: 失敗
30
+ Failure: 失敗
30
31
  GoBack: ← 戻る
31
32
  History: 履歴
32
33
  Job: ジョブ
@@ -75,6 +76,7 @@ ja:
75
76
  Stop: 停止
76
77
  StopAll: すべて停止
77
78
  StopPolling: ポーリング停止
79
+ Success: 成功
78
80
  Thread: スレッド
79
81
  Threads: スレッド
80
82
  ThreeMonths: 3 ヶ月
@@ -82,7 +84,7 @@ ja:
82
84
  Unpause: 一時停止を解除
83
85
  Metrics: メトリクス
84
86
  NoDataFound: データが見つかりませんでした
85
- ExecutionTime: 合計実行時間
87
+ TotalExecutionTime: 合計実行時間
86
88
  AvgExecutionTime: 平均実行時間
87
89
  Context: コンテキスト
88
90
  Bucket: バケット
@@ -12,10 +12,10 @@
12
12
  <p id="serverUtcTime" class="navbar-text server-utc-time"><%= server_utc_time %></p>
13
13
  </li>
14
14
  <li>
15
- <p class="navbar-text"><a rel=help href="https://github.com/mperham/sidekiq/wiki">docs</a></p>
15
+ <p class="navbar-text"><a rel=help href="https://github.com/sidekiq/sidekiq/wiki">docs</a></p>
16
16
  </li>
17
17
  <li>
18
- <p class="navbar-text"><a rel=external href="https://github.com/mperham/sidekiq/tree/main/web/locales"><%= locale %></a></p>
18
+ <p class="navbar-text"><a rel=external href="https://github.com/sidekiq/sidekiq/tree/main/web/locales"><%= locale %></a></p>
19
19
  </li>
20
20
  </ul>
21
21
  </div>
@@ -1,6 +1,6 @@
1
- <header>
1
+ <div class="header-container">
2
2
  <h3><%= t('Job') %></h3>
3
- </header>
3
+ </div>
4
4
 
5
5
  <div class="table_container">
6
6
  <table class="table table-bordered table-striped table-hover">
@@ -33,6 +33,14 @@
33
33
  <code><%= job.jid %></code>
34
34
  </td>
35
35
  </tr>
36
+ <% if job.bid %>
37
+ <tr>
38
+ <th>BID</th>
39
+ <td>
40
+ <a href="<%= root_path %>batches/<%= job.bid %>"><%= job.bid %>
41
+ </td>
42
+ </tr>
43
+ <% end %>
36
44
  <tr>
37
45
  <th><%= t('CreatedAt') %></th>
38
46
  <td><%= relative_time(job.created_at) %></td>
@@ -84,6 +92,14 @@
84
92
  <td><%= relative_time(job.at) if job['retry_count'] %></td>
85
93
  </tr>
86
94
  <% end %>
95
+ <% Sidekiq::Web.custom_job_info_rows.each do |helper| %>
96
+ <% helper.add_pair(job) do |name, value| %>
97
+ <tr>
98
+ <th><%= name %></th>
99
+ <td><%= value %></td>
100
+ </tr>
101
+ <% end %>
102
+ <% end %>
87
103
  </tbody>
88
104
  </table>
89
105
  </div>
@@ -0,0 +1,12 @@
1
+ <div>
2
+ <select class="form-control" onchange="window.location.href = '<%= path %>?period=' + event.target.value">
3
+ <% periods.each_key do |code| %>
4
+
5
+ <% if code == period %>
6
+ <option selected value="<%= code %>"><%= code %></option>
7
+ <% else %>
8
+ <option value="<%= code %>"><%= code %></option>
9
+ <% end %>
10
+ <% end %>
11
+ </select>
12
+ </div>
@@ -1,3 +1,4 @@
1
+ <div>
1
2
  <% if @total_size > @count %>
2
3
  <ul class="pagination pull-right flip">
3
4
  <li class="<%= 'disabled' if @current_page == 1 %>">
@@ -21,3 +22,4 @@
21
22
  </li>
22
23
  </ul>
23
24
  <% end %>
25
+ </div>
data/web/views/busy.erb CHANGED
@@ -1,7 +1,5 @@
1
- <div class="row header">
2
- <div class="col-sm-4 pull-left flip">
3
- <h3><%= t('Status') %></h3>
4
- </div>
1
+ <div class="header-container">
2
+ <h1><%= t('Status') %></h1>
5
3
  </div>
6
4
 
7
5
  <div class="stats-wrapper">
@@ -29,11 +27,9 @@
29
27
  </div>
30
28
  </div>
31
29
 
32
- <div class="row header">
33
- <div class="col-sm-4 pull-left flip">
34
- <h3><%= t('Processes') %></h3>
35
- </div>
36
- <div class="col-sm-3 pull-right flip">
30
+ <div class="header-container">
31
+ <h1><%= t('Processes') %></h1>
32
+ <div>
37
33
  <form method="POST" class="warning-messages">
38
34
  <%= csrf_tag %>
39
35
  <div class="btn-group pull-right flip">
@@ -43,12 +39,13 @@
43
39
  </form>
44
40
  </div>
45
41
  </div>
42
+
46
43
  <div class="table_container">
47
44
  <table class="processes table table-hover table-bordered table-striped">
48
45
  <thead>
49
46
  <th><%= t('Name') %></th>
50
47
  <th><%= t('Started') %></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>
48
+ <th class="col-sm-1"><%= t('RSS') %><a target="blank" href="https://github.com/sidekiq/sidekiq/wiki/Memory#rss"><span class="info-circle" title="Click to learn more about RSS">?</span></a></th>
52
49
  <th class="col-sm-1"><%= t('Threads') %></th>
53
50
  <th class="col-sm-1"><%= t('Busy') %></th>
54
51
  <th>&nbsp;</th>
@@ -62,6 +59,9 @@
62
59
  <% process.labels.each do |label| %>
63
60
  <span class="label label-info"><%= label %></span>
64
61
  <% end %>
62
+ <% if process.embedded? %>
63
+ <span class="label label-default">embedded</span>
64
+ <% end %>
65
65
  <% if process.stopping? %>
66
66
  <span class="label label-danger">quiet</span>
67
67
  <% end %>
@@ -70,36 +70,47 @@
70
70
  <% end %>
71
71
  <br>
72
72
  <b><%= "#{t('Queues')}: " %></b>
73
- <%= process.queues.join(", ") %>
73
+ <% if process.weights %>
74
+ <%= busy_weights(process.weights) %>
75
+ <% else %>
76
+ <%= process.queues.sort.join(", ") %>
77
+ <% end %>
78
+ <% if process.version != Sidekiq::VERSION %>
79
+ <br>
80
+ <b><%= "#{t('Version')}: " %></b>
81
+ <% if process.version %>
82
+ <%= process.version %>
83
+ <% else %>
84
+ <%= t('Unknown') %>
85
+ <% end %>
86
+ <% end %>
74
87
  </td>
75
88
  <td><%= relative_time(Time.at(process['started_at'])) %></td>
76
89
  <td><%= format_memory(process['rss'].to_i) %></td>
77
90
  <td><%= process['concurrency'] %></td>
78
91
  <td><%= process['busy'] %></td>
79
92
  <td>
80
- <form method="POST">
81
- <%= csrf_tag %>
82
- <input type="hidden" name="identity" value="<%= process['identity'] %>"/>
93
+ <% unless process.embedded? %>
94
+ <form method="POST">
95
+ <%= csrf_tag %>
96
+ <input type="hidden" name="identity" value="<%= process['identity'] %>"/>
83
97
 
84
- <div class="btn-group pull-right flip">
85
- <% unless process.stopping? %><button class="btn btn-xs btn-warn" type="submit" name="quiet" value="1"><%= t('Quiet') %></button><% end %>
86
- <button class="btn btn-xs btn-danger" type="submit" name="stop" value="1"><%= t('Stop') %></button>
87
- </div>
88
- </form>
98
+ <div class="btn-group pull-right flip">
99
+ <% unless process.stopping? %><button class="btn btn-xs btn-warn" type="submit" name="quiet" value="1"><%= t('Quiet') %></button><% end %>
100
+ <button class="btn btn-xs btn-danger" type="submit" name="stop" value="1"><%= t('Stop') %></button>
101
+ </div>
102
+ </form>
103
+ <% end %>
89
104
  </td>
90
105
  </tr>
91
106
  <% end %>
92
107
  </table>
93
108
  </div>
94
109
 
95
- <div class="row header">
96
- <div class="col-sm-7">
97
- <h3><%= t('Jobs') %></h3>
98
- </div>
110
+ <div class="header-container">
111
+ <h1><%= t('Jobs') %></h1>
99
112
  <% if @workset.size > 0 && @total_size > @count %>
100
- <div class="col-sm-4">
101
- <%= erb :_paging, locals: { url: "#{root_path}busy" } %>
102
- </div>
113
+ <%= erb :_paging, locals: { url: "#{root_path}busy" } %>
103
114
  <% end %>
104
115
  </div>
105
116
 
@@ -4,11 +4,13 @@
4
4
  <script type="text/javascript" src="<%= root_path %>javascripts/metrics.js"></script>
5
5
 
6
6
  <div class="header-container">
7
- <h1><%= t('Metrics') %></h1>
7
+ <div class="page-title-container">
8
+ <h1><%= t('Metrics') %></h1>
8
9
 
9
- <div>
10
- <a target="blank" href="https://github.com/mperham/sidekiq/wiki/Metrics"><span class="info-circle" title="Click to learn more about metrics">?</span></a>
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
11
  </div>
12
+
13
+ <%= erb :_metrics_period_select, locals: { periods: @periods, period: @period, path: "#{root_path}metrics" } %>
12
14
  </div>
13
15
 
14
16
  <%
@@ -60,7 +62,7 @@
60
62
  value="<%= kls %>"
61
63
  <%= visible_kls.include?(kls) ? 'checked' : '' %>
62
64
  />
63
- <code><a href="<%= root_path %>metrics/<%= kls %>"><%= kls %></a></code>
65
+ <code><a href="<%= root_path %>metrics/<%= kls %>?period=<%= @period %>"><%= kls %></a></code>
64
66
  </div>
65
67
  <script>jobMetricsChart.registerSwatch("<%= id %>")</script>
66
68
  </td>