sidekiq 6.5.0 → 6.5.3
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 +4 -4
- data/Changes.md +22 -2
- data/lib/sidekiq/api.rb +146 -27
- data/lib/sidekiq/cli.rb +2 -1
- data/lib/sidekiq/client.rb +1 -1
- data/lib/sidekiq/component.rb +3 -2
- data/lib/sidekiq/delay.rb +1 -1
- data/lib/sidekiq/fetch.rb +1 -1
- data/lib/sidekiq/job_retry.rb +46 -31
- data/lib/sidekiq/launcher.rb +4 -2
- data/lib/sidekiq/metrics/deploy.rb +47 -0
- data/lib/sidekiq/metrics/query.rb +124 -0
- data/lib/sidekiq/metrics/shared.rb +94 -0
- data/lib/sidekiq/metrics/tracking.rb +134 -0
- data/lib/sidekiq/middleware/chain.rb +70 -35
- data/lib/sidekiq/middleware/current_attributes.rb +6 -4
- data/lib/sidekiq/middleware/modules.rb +2 -0
- data/lib/sidekiq/processor.rb +1 -1
- data/lib/sidekiq/version.rb +1 -1
- data/lib/sidekiq/web/application.rb +13 -0
- data/lib/sidekiq/web/helpers.rb +24 -1
- data/lib/sidekiq/web.rb +4 -0
- data/lib/sidekiq.rb +9 -1
- data/sidekiq.gemspec +1 -1
- data/web/assets/javascripts/application.js +1 -1
- data/web/assets/javascripts/dashboard.js +0 -17
- data/web/assets/javascripts/graph.js +16 -0
- data/web/locales/en.yml +4 -0
- data/web/views/_nav.erb +1 -1
- data/web/views/busy.erb +1 -1
- data/web/views/dashboard.erb +1 -0
- data/web/views/metrics.erb +59 -0
- data/web/views/metrics_for_job.erb +92 -0
- data/web/views/queue.erb +5 -1
- metadata +11 -4
data/web/locales/en.yml
CHANGED
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="
|
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>
|
data/web/views/busy.erb
CHANGED
data/web/views/dashboard.erb
CHANGED
@@ -0,0 +1,59 @@
|
|
1
|
+
|
2
|
+
<h1><%= t('Metrics') %></h1>
|
3
|
+
|
4
|
+
<h3>Top Jobs by Processed Count</h3>
|
5
|
+
<% top = @resultset[:top_classes] %>
|
6
|
+
|
7
|
+
<% topp = top["p"]&.first(10) %>
|
8
|
+
<div class="table_container">
|
9
|
+
<table class="table table-bordered table-striped table-hover">
|
10
|
+
<tbody>
|
11
|
+
<tr>
|
12
|
+
<th><%= t('Name') %></th>
|
13
|
+
<th><%= t('Processed') %></th>
|
14
|
+
<th><%= t('ExecutionTime') %></th>
|
15
|
+
</tr>
|
16
|
+
<% if topp %>
|
17
|
+
<% topp.each do |kls, val| %>
|
18
|
+
<tr>
|
19
|
+
<td><code><a href="<%= root_path %>metrics/<%= kls %>"><%= kls %></a></code></td>
|
20
|
+
<td><%= val %></td>
|
21
|
+
<td><%= top.dig("ms", kls) %></td>
|
22
|
+
</tr>
|
23
|
+
<% end %>
|
24
|
+
<% else %>
|
25
|
+
<tr><td colspan=3><%= t("NoDataFound") %></td></tr>
|
26
|
+
<% end %>
|
27
|
+
</tbody>
|
28
|
+
</table>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<h3>Top Jobs by Execution Time</h3>
|
32
|
+
|
33
|
+
<% topms = top["ms"]&.first(10) %>
|
34
|
+
<div class="table_container">
|
35
|
+
<table class="table table-bordered table-striped table-hover">
|
36
|
+
<tbody>
|
37
|
+
<tr>
|
38
|
+
<th><%= t('Name') %></th>
|
39
|
+
<th><%= t('Processed') %></th>
|
40
|
+
<th><%= t('ExecutionTime') %></th>
|
41
|
+
</tr>
|
42
|
+
<% if topms %>
|
43
|
+
<% topms.each do |kls, val| %>
|
44
|
+
<tr>
|
45
|
+
<td><code><a href="<%= root_path %>metrics/<%= kls %>"><%= kls %></a></code></td>
|
46
|
+
<td><%= top.dig("p", kls) %></td>
|
47
|
+
<td><%= val %></td>
|
48
|
+
</tr>
|
49
|
+
<% end %>
|
50
|
+
<% else %>
|
51
|
+
<tr><td colspan=3><%= t("NoDataFound") %></td></tr>
|
52
|
+
<% end %>
|
53
|
+
</tbody>
|
54
|
+
</table>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<p>
|
58
|
+
Data from <%= @resultset[:starts_at] %> to <%= @resultset[:ends_at] %>
|
59
|
+
</p>
|
@@ -0,0 +1,92 @@
|
|
1
|
+
|
2
|
+
<h2><%= t('Metrics') %> / <%= h @name %></h2>
|
3
|
+
|
4
|
+
<div class="row chart">
|
5
|
+
<div id="realtime" data-processed-label="<%= t('Processed') %>" data-failed-label="<%= t('Failed') %>"></div>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<% data = @resultset[:data] %>
|
9
|
+
<div class="table_container">
|
10
|
+
<table class="table table-bordered table-striped table-hover">
|
11
|
+
<tbody>
|
12
|
+
<tr>
|
13
|
+
<th><%= t('Time') %></th>
|
14
|
+
<th><%= t('Processed') %></th>
|
15
|
+
<th><%= t('ExecutionTime') %></th>
|
16
|
+
<th><%= t('Failed') %></th>
|
17
|
+
<th><%= t('Deploy') %></th>
|
18
|
+
<th><%= t('Histogram') %></th>
|
19
|
+
</tr>
|
20
|
+
<% data.each do |hash| %>
|
21
|
+
<tr><td><%= hash[:time] %></td><td><%= hash[:p] %></td><td><%= hash[:ms] %></td><td><%= hash[:f] %></td><td><%= hash[:mark] %></td><td><%= hash[:hist] %></td></tr>
|
22
|
+
<% end %>
|
23
|
+
</tbody>
|
24
|
+
</table>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<p>
|
28
|
+
Data from <%= @resultset[:starts_at] %> to <%= @resultset[:ends_at] %>
|
29
|
+
</p>
|
30
|
+
|
31
|
+
<% atad = data.reverse %>
|
32
|
+
<script type="text/javascript" src="<%= root_path %>javascripts/graph.js"></script>
|
33
|
+
<script>
|
34
|
+
var palette = new Rickshaw.Color.Palette();
|
35
|
+
var data = [ {
|
36
|
+
name: "Processed",
|
37
|
+
color: palette.color(),
|
38
|
+
data: [ <% atad.each do |hash| %>
|
39
|
+
{ x: <%= hash[:epoch] %>, y: <%= hash[:p] %> },
|
40
|
+
<% end %> ]
|
41
|
+
}, {
|
42
|
+
name: "Failed",
|
43
|
+
color: palette.color(),
|
44
|
+
data: [ <% atad.each do |hash| %>
|
45
|
+
{ x: <%= hash[:epoch] %>, y: <%= hash[:f] %> },
|
46
|
+
<% end %>
|
47
|
+
]
|
48
|
+
}, {
|
49
|
+
name: "Execution Time",
|
50
|
+
color: palette.color(),
|
51
|
+
data: [ <% atad.each do |hash| %>
|
52
|
+
{ x: <%= hash[:epoch] %>, y: <%= hash[:ms] %> },
|
53
|
+
<% end %>
|
54
|
+
]
|
55
|
+
} ];
|
56
|
+
|
57
|
+
// TODO What to do with this? Minutely hover detail with a histogram bar chart?
|
58
|
+
var histogramData = [ <% atad.each do |hash| %>
|
59
|
+
{ x: <%= hash[:epoch] %>, hist: <%= hash[:hist] %> },
|
60
|
+
<% end %> ]
|
61
|
+
var histogramLabels = <%= Sidekiq::Metrics::Histogram::LABELS.inspect %>;
|
62
|
+
|
63
|
+
var timeInterval = 60000;
|
64
|
+
var graphElement = document.getElementById("realtime");
|
65
|
+
|
66
|
+
var graph = new Rickshaw.Graph({
|
67
|
+
element: graphElement,
|
68
|
+
width: responsiveWidth(),
|
69
|
+
renderer: 'line',
|
70
|
+
interpolation: 'linear',
|
71
|
+
series: data,
|
72
|
+
});
|
73
|
+
var x_axis = new Rickshaw.Graph.Axis.Time( { graph: graph } );
|
74
|
+
|
75
|
+
var y_axis = new Rickshaw.Graph.Axis.Y( {
|
76
|
+
graph: graph,
|
77
|
+
tickFormat: Rickshaw.Fixtures.Number.formatKMBT,
|
78
|
+
ticksTreatment: 'glow'
|
79
|
+
});
|
80
|
+
|
81
|
+
graph.render();
|
82
|
+
|
83
|
+
var hoverDetail = new Rickshaw.Graph.HoverDetail( {
|
84
|
+
graph: graph,
|
85
|
+
// formatter: function(series, x, y) {
|
86
|
+
// var date = '<span class="date">' + new Date(x * 1000).toUTCString() + '</span>';
|
87
|
+
// var swatch = '<span class="detail_swatch" style="background-color: ' + series.color + '"></span>';
|
88
|
+
// var content = swatch + series.name + ": " + parseInt(y) + '<br>' + date;
|
89
|
+
// return content;
|
90
|
+
// }
|
91
|
+
} );
|
92
|
+
</script>
|
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,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.5.
|
4
|
+
version: 6.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Perham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.
|
19
|
+
version: 4.5.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.
|
26
|
+
version: 4.5.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: connection_pool
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -89,6 +89,10 @@ files:
|
|
89
89
|
- lib/sidekiq/launcher.rb
|
90
90
|
- lib/sidekiq/logger.rb
|
91
91
|
- lib/sidekiq/manager.rb
|
92
|
+
- lib/sidekiq/metrics/deploy.rb
|
93
|
+
- lib/sidekiq/metrics/query.rb
|
94
|
+
- lib/sidekiq/metrics/shared.rb
|
95
|
+
- lib/sidekiq/metrics/tracking.rb
|
92
96
|
- lib/sidekiq/middleware/chain.rb
|
93
97
|
- lib/sidekiq/middleware/current_attributes.rb
|
94
98
|
- lib/sidekiq/middleware/i18n.rb
|
@@ -121,6 +125,7 @@ files:
|
|
121
125
|
- web/assets/images/status.png
|
122
126
|
- web/assets/javascripts/application.js
|
123
127
|
- web/assets/javascripts/dashboard.js
|
128
|
+
- web/assets/javascripts/graph.js
|
124
129
|
- web/assets/stylesheets/application-dark.css
|
125
130
|
- web/assets/stylesheets/application-rtl.css
|
126
131
|
- web/assets/stylesheets/application.css
|
@@ -165,6 +170,8 @@ files:
|
|
165
170
|
- web/views/dashboard.erb
|
166
171
|
- web/views/dead.erb
|
167
172
|
- web/views/layout.erb
|
173
|
+
- web/views/metrics.erb
|
174
|
+
- web/views/metrics_for_job.erb
|
168
175
|
- web/views/morgue.erb
|
169
176
|
- web/views/queue.erb
|
170
177
|
- web/views/queues.erb
|