sidekiq 6.5.3 → 6.5.6

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.

@@ -1,92 +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>
1
4
 
2
- <h2><%= t('Metrics') %> / <%= h @name %></h2>
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
3
10
 
4
- <div class="row chart">
5
- <div id="realtime" data-processed-label="<%= t('Processed') %>" data-failed-label="<%= t('Failed') %>"></div>
6
- </div>
11
+ # Replace INFINITY since it can't be represented as JSON
12
+ bucket_intervals[0] = bucket_intervals[1] * 2
13
+ %>
7
14
 
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>
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>
26
23
 
27
- <p>
28
- Data from <%= @resultset[:starts_at] %> to <%= @resultset[:ends_at] %>
29
- </p>
24
+ <canvas id="hist-totals-chart"></canvas>
30
25
 
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
- } ];
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>
56
35
 
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 %>;
36
+ <h2>Performance over time</h2>
62
37
 
63
- var timeInterval = 60000;
64
- var graphElement = document.getElementById("realtime");
38
+ <canvas id="hist-bubble-chart"></canvas>
65
39
 
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 } );
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>
74
51
 
75
- var y_axis = new Rickshaw.Graph.Axis.Y( {
76
- graph: graph,
77
- tickFormat: Rickshaw.Fixtures.Number.formatKMBT,
78
- ticksTreatment: 'glow'
79
- });
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>
80
85
 
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>
86
+ <div class="alert alert-success"><%= t('NoJobMetricsFound') %></div>
87
+ <% end %>
metadata CHANGED
@@ -1,19 +1,22 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.5.3
4
+ version: 6.5.6
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-08-04 00:00:00.000000000 Z
11
+ date: 2022-08-29 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
22
  version: 4.5.0
@@ -21,6 +24,9 @@ dependencies:
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
32
  version: 4.5.0
@@ -30,14 +36,14 @@ dependencies:
30
36
  requirements:
31
37
  - - ">="
32
38
  - !ruby/object:Gem::Version
33
- version: 2.2.2
39
+ version: 2.2.5
34
40
  type: :runtime
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
44
  - - ">="
39
45
  - !ruby/object:Gem::Version
40
- version: 2.2.2
46
+ version: 2.2.5
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: rack
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -124,8 +130,11 @@ files:
124
130
  - web/assets/images/logo.png
125
131
  - web/assets/images/status.png
126
132
  - web/assets/javascripts/application.js
133
+ - web/assets/javascripts/chart.min.js
134
+ - web/assets/javascripts/chartjs-plugin-annotation.min.js
127
135
  - web/assets/javascripts/dashboard.js
128
136
  - web/assets/javascripts/graph.js
137
+ - web/assets/javascripts/metrics.js
129
138
  - web/assets/stylesheets/application-dark.css
130
139
  - web/assets/stylesheets/application-rtl.css
131
140
  - web/assets/stylesheets/application.css