sidekiq 6.5.1 → 6.5.2

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.

data/web/locales/en.yml CHANGED
@@ -84,3 +84,7 @@ en: # <---- change this to your locale code
84
84
  Latency: Latency
85
85
  Pause: Pause
86
86
  Unpause: Unpause
87
+ Metrics: Metrics
88
+ NoDataFound: No data found
89
+ ExecutionTime: Execution Time
90
+ Context: Context
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>
data/web/views/busy.erb CHANGED
@@ -54,7 +54,7 @@
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']}" %>
@@ -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,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.1
4
+ version: 6.5.2
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-06-15 00:00:00.000000000 Z
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.2.0
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.2.0
26
+ version: 4.5.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: connection_pool
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -72,7 +72,6 @@ files:
72
72
  - lib/generators/sidekiq/templates/job_spec.rb.erb
73
73
  - lib/generators/sidekiq/templates/job_test.rb.erb
74
74
  - lib/sidekiq.rb
75
- - lib/sidekiq/.DS_Store
76
75
  - lib/sidekiq/api.rb
77
76
  - lib/sidekiq/cli.rb
78
77
  - lib/sidekiq/client.rb
@@ -90,6 +89,10 @@ files:
90
89
  - lib/sidekiq/launcher.rb
91
90
  - lib/sidekiq/logger.rb
92
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
93
96
  - lib/sidekiq/middleware/chain.rb
94
97
  - lib/sidekiq/middleware/current_attributes.rb
95
98
  - lib/sidekiq/middleware/i18n.rb
@@ -122,6 +125,7 @@ files:
122
125
  - web/assets/images/status.png
123
126
  - web/assets/javascripts/application.js
124
127
  - web/assets/javascripts/dashboard.js
128
+ - web/assets/javascripts/graph.js
125
129
  - web/assets/stylesheets/application-dark.css
126
130
  - web/assets/stylesheets/application-rtl.css
127
131
  - web/assets/stylesheets/application.css
@@ -166,6 +170,8 @@ files:
166
170
  - web/views/dashboard.erb
167
171
  - web/views/dead.erb
168
172
  - web/views/layout.erb
173
+ - web/views/metrics.erb
174
+ - web/views/metrics_for_job.erb
169
175
  - web/views/morgue.erb
170
176
  - web/views/queue.erb
171
177
  - web/views/queues.erb
Binary file