sidekiq 6.1.1 → 6.5.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/Changes.md +250 -3
  3. data/LICENSE +3 -3
  4. data/README.md +10 -6
  5. data/bin/sidekiq +3 -3
  6. data/bin/sidekiqload +70 -66
  7. data/bin/sidekiqmon +1 -1
  8. data/lib/generators/sidekiq/job_generator.rb +57 -0
  9. data/lib/generators/sidekiq/templates/{worker.rb.erb → job.rb.erb} +2 -2
  10. data/lib/generators/sidekiq/templates/{worker_spec.rb.erb → job_spec.rb.erb} +1 -1
  11. data/lib/generators/sidekiq/templates/{worker_test.rb.erb → job_test.rb.erb} +1 -1
  12. data/lib/sidekiq/api.rb +352 -156
  13. data/lib/sidekiq/cli.rb +86 -41
  14. data/lib/sidekiq/client.rb +49 -73
  15. data/lib/sidekiq/{util.rb → component.rb} +12 -14
  16. data/lib/sidekiq/delay.rb +3 -1
  17. data/lib/sidekiq/extensions/action_mailer.rb +3 -2
  18. data/lib/sidekiq/extensions/active_record.rb +1 -1
  19. data/lib/sidekiq/extensions/generic_proxy.rb +4 -2
  20. data/lib/sidekiq/fetch.rb +31 -20
  21. data/lib/sidekiq/job.rb +13 -0
  22. data/lib/sidekiq/job_logger.rb +16 -28
  23. data/lib/sidekiq/job_retry.rb +79 -59
  24. data/lib/sidekiq/job_util.rb +71 -0
  25. data/lib/sidekiq/launcher.rb +126 -65
  26. data/lib/sidekiq/logger.rb +11 -20
  27. data/lib/sidekiq/manager.rb +35 -34
  28. data/lib/sidekiq/metrics/deploy.rb +47 -0
  29. data/lib/sidekiq/metrics/query.rb +153 -0
  30. data/lib/sidekiq/metrics/shared.rb +94 -0
  31. data/lib/sidekiq/metrics/tracking.rb +134 -0
  32. data/lib/sidekiq/middleware/chain.rb +88 -42
  33. data/lib/sidekiq/middleware/current_attributes.rb +63 -0
  34. data/lib/sidekiq/middleware/i18n.rb +6 -4
  35. data/lib/sidekiq/middleware/modules.rb +21 -0
  36. data/lib/sidekiq/monitor.rb +2 -2
  37. data/lib/sidekiq/paginator.rb +17 -9
  38. data/lib/sidekiq/processor.rb +47 -41
  39. data/lib/sidekiq/rails.rb +32 -4
  40. data/lib/sidekiq/redis_client_adapter.rb +154 -0
  41. data/lib/sidekiq/redis_connection.rb +84 -55
  42. data/lib/sidekiq/ring_buffer.rb +29 -0
  43. data/lib/sidekiq/scheduled.rb +96 -32
  44. data/lib/sidekiq/testing/inline.rb +4 -4
  45. data/lib/sidekiq/testing.rb +38 -39
  46. data/lib/sidekiq/transaction_aware_client.rb +45 -0
  47. data/lib/sidekiq/version.rb +1 -1
  48. data/lib/sidekiq/web/action.rb +3 -3
  49. data/lib/sidekiq/web/application.rb +41 -16
  50. data/lib/sidekiq/web/csrf_protection.rb +32 -5
  51. data/lib/sidekiq/web/helpers.rb +52 -30
  52. data/lib/sidekiq/web/router.rb +4 -1
  53. data/lib/sidekiq/web.rb +38 -78
  54. data/lib/sidekiq/worker.rb +142 -16
  55. data/lib/sidekiq.rb +114 -31
  56. data/sidekiq.gemspec +12 -4
  57. data/web/assets/images/apple-touch-icon.png +0 -0
  58. data/web/assets/javascripts/application.js +114 -60
  59. data/web/assets/javascripts/chart.min.js +13 -0
  60. data/web/assets/javascripts/chartjs-plugin-annotation.min.js +7 -0
  61. data/web/assets/javascripts/dashboard.js +50 -67
  62. data/web/assets/javascripts/graph.js +16 -0
  63. data/web/assets/javascripts/metrics.js +262 -0
  64. data/web/assets/stylesheets/application-dark.css +61 -51
  65. data/web/assets/stylesheets/application-rtl.css +0 -4
  66. data/web/assets/stylesheets/application.css +84 -243
  67. data/web/locales/ar.yml +8 -2
  68. data/web/locales/el.yml +43 -19
  69. data/web/locales/en.yml +11 -1
  70. data/web/locales/es.yml +18 -2
  71. data/web/locales/fr.yml +8 -1
  72. data/web/locales/ja.yml +10 -0
  73. data/web/locales/lt.yml +1 -1
  74. data/web/locales/pt-br.yml +27 -9
  75. data/web/locales/ru.yml +4 -0
  76. data/web/locales/zh-cn.yml +36 -11
  77. data/web/locales/zh-tw.yml +32 -7
  78. data/web/views/_footer.erb +1 -1
  79. data/web/views/_job_info.erb +1 -1
  80. data/web/views/_nav.erb +1 -1
  81. data/web/views/_poll_link.erb +2 -5
  82. data/web/views/_summary.erb +7 -7
  83. data/web/views/busy.erb +57 -21
  84. data/web/views/dashboard.erb +23 -14
  85. data/web/views/dead.erb +1 -1
  86. data/web/views/layout.erb +2 -1
  87. data/web/views/metrics.erb +69 -0
  88. data/web/views/metrics_for_job.erb +87 -0
  89. data/web/views/morgue.erb +6 -6
  90. data/web/views/queue.erb +15 -11
  91. data/web/views/queues.erb +4 -4
  92. data/web/views/retries.erb +7 -7
  93. data/web/views/retry.erb +1 -1
  94. data/web/views/scheduled.erb +1 -1
  95. metadata +52 -39
  96. data/.circleci/config.yml +0 -71
  97. data/.github/contributing.md +0 -32
  98. data/.github/issue_template.md +0 -11
  99. data/.gitignore +0 -13
  100. data/.standard.yml +0 -20
  101. data/3.0-Upgrade.md +0 -70
  102. data/4.0-Upgrade.md +0 -53
  103. data/5.0-Upgrade.md +0 -56
  104. data/6.0-Upgrade.md +0 -72
  105. data/COMM-LICENSE +0 -97
  106. data/Ent-2.0-Upgrade.md +0 -37
  107. data/Ent-Changes.md +0 -275
  108. data/Gemfile +0 -24
  109. data/Gemfile.lock +0 -208
  110. data/Pro-2.0-Upgrade.md +0 -138
  111. data/Pro-3.0-Upgrade.md +0 -44
  112. data/Pro-4.0-Upgrade.md +0 -35
  113. data/Pro-5.0-Upgrade.md +0 -25
  114. data/Pro-Changes.md +0 -795
  115. data/Rakefile +0 -10
  116. data/code_of_conduct.md +0 -50
  117. data/lib/generators/sidekiq/worker_generator.rb +0 -57
  118. data/lib/sidekiq/exception_handler.rb +0 -27
data/web/views/busy.erb CHANGED
@@ -1,8 +1,39 @@
1
1
  <div class="row header">
2
- <div class="col-sm-8 pull-left flip">
2
+ <div class="col-sm-4 pull-left flip">
3
+ <h3><%= t('Status') %></h3>
4
+ </div>
5
+ </div>
6
+
7
+ <div class="stats-wrapper">
8
+ <div class="stats-container">
9
+ <div class="stat">
10
+ <h3><%= s = processes.size; number_with_delimiter(s) %></h3>
11
+ <p><%= t('Processes') %></p>
12
+ </div>
13
+ <div class="stat">
14
+ <h3><%= x = processes.total_concurrency; number_with_delimiter(x) %></h3>
15
+ <p><%= t('Threads') %></p>
16
+ </div>
17
+ <div class="stat">
18
+ <h3><%= ws = workset.size; number_with_delimiter(ws) %></h3>
19
+ <p><%= t('Busy') %></p>
20
+ </div>
21
+ <div class="stat">
22
+ <h3><%= x == 0 ? 0 : ((ws / x.to_f) * 100).round(0) %>%</h3>
23
+ <p><%= t('Utilization') %></p>
24
+ </div>
25
+ <div class="stat">
26
+ <h3><%= format_memory(processes.total_rss) %></h3>
27
+ <p><%= t('RSS') %></p>
28
+ </div>
29
+ </div>
30
+ </div>
31
+
32
+ <div class="row header">
33
+ <div class="col-sm-4 pull-left flip">
3
34
  <h3><%= t('Processes') %></h3>
4
35
  </div>
5
- <div class="col-sm-4 pull-right flip">
36
+ <div class="col-sm-3 pull-right flip">
6
37
  <form method="POST" class="warning-messages">
7
38
  <%= csrf_tag %>
8
39
  <div class="btn-group pull-right flip">
@@ -12,18 +43,18 @@
12
43
  </form>
13
44
  </div>
14
45
  </div>
15
-
16
46
  <div class="table_container">
17
- <table class="processes table table-hover table-bordered table-striped table-white">
47
+ <table class="processes table table-hover table-bordered table-striped">
18
48
  <thead>
19
49
  <th><%= t('Name') %></th>
20
50
  <th><%= t('Started') %></th>
21
- <th><%= t('Threads') %></th>
22
- <th><%= t('Busy') %></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>
52
+ <th class="col-sm-1"><%= t('Threads') %></th>
53
+ <th class="col-sm-1"><%= t('Busy') %></th>
23
54
  <th>&nbsp;</th>
24
55
  </thead>
25
56
  <% lead = processes.leader %>
26
- <% processes.each do |process| %>
57
+ <% sorted_processes.each do |process| %>
27
58
  <tr>
28
59
  <td class="box">
29
60
  <%= "#{process['hostname']}:#{process['pid']}" %>
@@ -39,22 +70,22 @@
39
70
  <% end %>
40
71
  <br>
41
72
  <b><%= "#{t('Queues')}: " %></b>
42
- <%= process['queues'] * ", " %>
73
+ <%= process.queues.join(", ") %>
43
74
  </td>
44
75
  <td><%= relative_time(Time.at(process['started_at'])) %></td>
76
+ <td><%= format_memory(process['rss'].to_i) %></td>
45
77
  <td><%= process['concurrency'] %></td>
46
78
  <td><%= process['busy'] %></td>
47
79
  <td>
48
- <div class="btn-group pull-right flip">
49
- <form method="POST">
50
- <%= csrf_tag %>
51
- <input type="hidden" name="identity" value="<%= process['identity'] %>"/>
52
- <% unless process.stopping? %>
53
- <button class="btn btn-warn" type="submit" name="quiet" value="1"><%= t('Quiet') %></button>
54
- <% end %>
55
- <button class="btn btn-danger" type="submit" name="stop" value="1"><%= t('Stop') %></button>
56
- </form>
57
- </div>
80
+ <form method="POST">
81
+ <%= csrf_tag %>
82
+ <input type="hidden" name="identity" value="<%= process['identity'] %>"/>
83
+
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>
58
89
  </td>
59
90
  </tr>
60
91
  <% end %>
@@ -65,10 +96,15 @@
65
96
  <div class="col-sm-7">
66
97
  <h3><%= t('Jobs') %></h3>
67
98
  </div>
99
+ <% if @workset.size > 0 && @total_size > @count %>
100
+ <div class="col-sm-4">
101
+ <%= erb :_paging, locals: { url: "#{root_path}busy" } %>
102
+ </div>
103
+ <% end %>
68
104
  </div>
69
105
 
70
106
  <div class="table_container">
71
- <table class="workers table table-hover table-bordered table-striped table-white">
107
+ <table class="workers table table-hover table-bordered table-striped">
72
108
  <thead>
73
109
  <th><%= t('Process') %></th>
74
110
  <th><%= t('TID') %></th>
@@ -78,8 +114,8 @@
78
114
  <th><%= t('Arguments') %></th>
79
115
  <th><%= t('Started') %></th>
80
116
  </thead>
81
- <% workers.each do |process, thread, msg| %>
82
- <% job = Sidekiq::Job.new(msg['payload']) %>
117
+ <% @workset.each do |process, thread, msg| %>
118
+ <% job = Sidekiq::JobRecord.new(msg['payload']) %>
83
119
  <tr>
84
120
  <td><%= process %></td>
85
121
  <td><%= thread %></td>
@@ -1,17 +1,18 @@
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 >
4
5
  <%= t('Dashboard') %>
5
- <span class="beacon">
6
+ <span id="beacon" class="beacon">
6
7
  <span class="ring"></span>
7
8
  <span class="dot"></span>
8
9
  </span>
9
10
  </h3>
10
11
  <div class="interval-slider ltr">
11
12
  <span class="interval-slider-label"><%= t('PollingInterval') %>:</span>
12
- <span class="current-interval">5 sec</span>
13
+ <span id="sldr-text" class="current-interval">5 sec</span>
13
14
  <br/>
14
- <input type="range" min="2000" max="20000" step="1000" value="5000"/>
15
+ <input id="sldr" type="range" min="2000" max="20000" step="1000" value="5000"/>
15
16
  </div>
16
17
  </div>
17
18
 
@@ -20,54 +21,62 @@
20
21
  <div id="realtime-legend"></div>
21
22
  </div>
22
23
 
23
- <div class="row chart">
24
- <h5>
25
- <span class="history-heading"><%= t('History') %></span>
24
+ <div class="row header">
25
+ <div class="col-sm-4 pull-left flip">
26
+ <h3><%= t('History') %></h3>
27
+ </div>
28
+ </div>
29
+ <div class="row chart">
30
+ <div>
26
31
  <a href="<%= root_path %>?days=7" class="history-graph <%= "active" if params[:days] == "7" %>"><%= t('OneWeek') %></a>
27
32
  <a href="<%= root_path %>" class="history-graph <%= "active" if params[:days].nil? || params[:days] == "30" %>"><%= t('OneMonth') %></a>
28
33
  <a href="<%= root_path %>?days=90" class="history-graph <%= "active" if params[:days] == "90" %>"><%= t('ThreeMonths') %></a>
29
34
  <a href="<%= root_path %>?days=180" class="history-graph <%= "active" if params[:days] == "180" %>"><%= t('SixMonths') %></a>
30
- </h5>
35
+ </div>
31
36
 
32
37
  <div id="history" data-processed-label="<%= t('Processed') %>" data-failed-label="<%= t('Failed') %>" data-processed="<%= h Sidekiq.dump_json(@processed_history) %>" data-failed="<%= h Sidekiq.dump_json(@failed_history) %>" data-update-url="<%= root_path %>stats"></div>
33
38
  <div id="history-legend"></div>
34
39
  </div>
35
40
 
36
41
  <br/>
37
- <h5>Redis</h5>
38
- <div class="redis-wrapper">
42
+ <div class="row header">
43
+ <div class="col-sm-4 pull-left flip">
44
+ <h3>Redis</h3>
45
+ </div>
46
+ </div>
47
+ <div class="stats-wrapper">
39
48
  <div class="stats-container">
40
49
  <% if @redis_info.fetch("redis_version", nil) %>
41
50
  <div class="stat">
42
- <h3 class="redis_version"><%= @redis_info.fetch("redis_version") %></h3>
51
+ <h3 id="redis_version"><%= @redis_info.fetch("redis_version") %></h3>
43
52
  <p><%= t('Version') %></p>
44
53
  </div>
45
54
  <% end %>
46
55
 
47
56
  <% if @redis_info.fetch("uptime_in_days", nil) %>
48
57
  <div class="stat">
49
- <h3 class="uptime_in_days"><%= @redis_info.fetch("uptime_in_days") %></h3>
58
+ <h3 id="uptime_in_days"><%= @redis_info.fetch("uptime_in_days") %></h3>
50
59
  <p><%= t('Uptime') %></p>
51
60
  </div>
52
61
  <% end %>
53
62
 
54
63
  <% if @redis_info.fetch("connected_clients", nil) %>
55
64
  <div class="stat">
56
- <h3 class="connected_clients"><%= @redis_info.fetch("connected_clients") %></h3>
65
+ <h3 id="connected_clients"><%= @redis_info.fetch("connected_clients") %></h3>
57
66
  <p><%= t('Connections') %></p>
58
67
  </div>
59
68
  <% end %>
60
69
 
61
70
  <% if @redis_info.fetch("used_memory_human", nil) %>
62
71
  <div class="stat">
63
- <h3 class="used_memory_human"><%= @redis_info.fetch("used_memory_human") %></h3>
72
+ <h3 id="used_memory_human"><%= @redis_info.fetch("used_memory_human") %></h3>
64
73
  <p><%= t('MemoryUsage') %></p>
65
74
  </div>
66
75
  <% end %>
67
76
 
68
77
  <% if @redis_info.fetch("used_memory_peak_human", nil) %>
69
78
  <div class="stat">
70
- <h3 class="used_memory_peak_human"><%= @redis_info.fetch("used_memory_peak_human") %></h3>
79
+ <h3 id="used_memory_peak_human"><%= @redis_info.fetch("used_memory_peak_human") %></h3>
71
80
  <p><%= t('PeakMemoryUsage') %></p>
72
81
  </div>
73
82
  <% end %>
data/web/views/dead.erb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <h3><%= t('Error') %></h3>
4
4
  <div class="table_container">
5
- <table class="error table table-bordered table-striped">
5
+ <table class="error table table-bordered table-striped table-hover">
6
6
  <tbody>
7
7
  <tr>
8
8
  <th><%= t('ErrorClass') %></th>
data/web/views/layout.erb CHANGED
@@ -16,12 +16,13 @@
16
16
  <link href="<%= root_path %>stylesheets/application-rtl.css" media="screen" rel="stylesheet" type="text/css" />
17
17
  <% end %>
18
18
 
19
+ <link rel="apple-touch-icon" href="<%= root_path %>images/apple-touch-icon.png">
19
20
  <link rel="shortcut icon" type="image/ico" href="<%= root_path %>images/favicon.ico" />
20
21
  <script type="text/javascript" src="<%= root_path %>javascripts/application.js"></script>
21
22
  <meta name="google" content="notranslate" />
22
23
  <%= display_custom_head %>
23
24
  </head>
24
- <body class="admin" data-poll-path="<%= poll_path %>" data-locale="<%= locale %>">
25
+ <body class="admin" data-locale="<%= locale %>">
25
26
  <%= erb :_nav %>
26
27
  <div id="page">
27
28
  <div class="container">
@@ -0,0 +1,69 @@
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>
4
+
5
+ <h2>Total execution time</h2>
6
+
7
+ <%
8
+ table_limit = 20
9
+ chart_limit = 5
10
+ job_results = @query_result.job_results.sort_by { |(kls, jr)| jr.totals["s"] }.reverse.first(table_limit)
11
+ visible_kls = job_results.first(chart_limit).map(&:first)
12
+ %>
13
+
14
+ <canvas id="job-metrics-overview-chart"></canvas>
15
+
16
+ <script>
17
+ window.jobMetricsChart = new JobMetricsOverviewChart(
18
+ "job-metrics-overview-chart",
19
+ <%= Sidekiq.dump_json({
20
+ series: job_results.map { |(kls, jr)| [kls, jr.dig("series", "s")] }.to_h,
21
+ marks: @query_result.marks.map { |m| [m.bucket, m.label] },
22
+ visible: visible_kls,
23
+ labels: @query_result.buckets,
24
+ }) %>
25
+ )
26
+ </script>
27
+
28
+ <h2>Most Time-Consuming Jobs</h2>
29
+
30
+ <div class="table_container">
31
+ <table class="table table-bordered table-striped table-hover">
32
+ <tbody>
33
+ <tr>
34
+ <th><%= t('Name') %></th>
35
+ <th><%= t('Processed') %></th>
36
+ <th><%= t('Failed') %></th>
37
+ <th><%= t('ExecutionTime') %></th>
38
+ <th><%= t('AvgExecutionTime') %></th>
39
+ </tr>
40
+ <% if job_results.any? %>
41
+ <% job_results.each_with_index do |(kls, jr), i| %>
42
+ <tr>
43
+ <td>
44
+ <div class="metrics-swatch-wrapper">
45
+ <% id = "metrics-swatch-#{kls}" %>
46
+ <input
47
+ type="checkbox"
48
+ id="<%= id %>"
49
+ class="metrics-swatch"
50
+ value="<%= kls %>"
51
+ />
52
+ <code><a href="<%= root_path %>metrics/<%= kls %>"><%= kls %></a></code>
53
+ </div>
54
+ <script>jobMetricsChart.registerSwatch("<%= id %>")</script>
55
+ </td>
56
+ <td><%= jr.dig("totals", "p") %></td>
57
+ <td><%= jr.dig("totals", "f") %></td>
58
+ <td><%= jr.dig("totals", "s").round(2) %> seconds</td>
59
+ <td><%= jr.total_avg("s").round(2) %> seconds</td>
60
+ </tr>
61
+ <% end %>
62
+ <% else %>
63
+ <tr><td colspan=5><%= t("NoDataFound") %></td></tr>
64
+ <% end %>
65
+ </tbody>
66
+ </table>
67
+ </div>
68
+
69
+ <p><small>Data from <%= @query_result.starts_at %> to <%= @query_result.ends_at %></small></p>
@@ -0,0 +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>
4
+
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
10
+
11
+ # Replace INFINITY since it can't be represented as JSON
12
+ bucket_intervals[0] = bucket_intervals[1] * 2
13
+ %>
14
+
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>
23
+
24
+ <canvas id="hist-totals-chart"></canvas>
25
+
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>
35
+
36
+ <h2>Performance over time</h2>
37
+
38
+ <canvas id="hist-bubble-chart"></canvas>
39
+
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>
51
+
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>
85
+
86
+ <div class="alert alert-success"><%= t('NoJobMetricsFound') %></div>
87
+ <% end %>
data/web/views/morgue.erb CHANGED
@@ -14,7 +14,7 @@
14
14
  <form action="<%= root_path %>morgue" method="post">
15
15
  <%= csrf_tag %>
16
16
  <div class="table_container">
17
- <table class="table table-striped table-bordered table-white">
17
+ <table class="table table-striped table-bordered table-hover">
18
18
  <thead>
19
19
  <tr>
20
20
  <th class="table-checkbox checkbox-column">
@@ -44,7 +44,7 @@
44
44
  </td>
45
45
  <td>
46
46
  <%= entry.display_class %>
47
- <%= display_tags(entry, "morgue") %>
47
+ <%= display_tags(entry, "dead") %>
48
48
  </td>
49
49
  <td>
50
50
  <div class="args"><%= display_args(entry.display_args) %></div>
@@ -58,18 +58,18 @@
58
58
  <% end %>
59
59
  </table>
60
60
  </div>
61
- <input class="btn btn-primary btn-xs pull-left flip" type="submit" name="retry" value="<%= t('RetryNow') %>" />
62
- <input class="btn btn-danger btn-xs pull-left flip" type="submit" name="delete" value="<%= t('Delete') %>" />
61
+ <input class="btn btn-primary pull-left flip" type="submit" name="retry" value="<%= t('RetryNow') %>" />
62
+ <input class="btn btn-danger pull-left flip" type="submit" name="delete" value="<%= t('Delete') %>" />
63
63
  </form>
64
64
 
65
65
  <% unfiltered? do %>
66
66
  <form action="<%= root_path %>morgue/all/delete" method="post">
67
67
  <%= csrf_tag %>
68
- <input class="btn btn-danger btn-xs pull-right flip" type="submit" name="delete" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" />
68
+ <input class="btn btn-danger pull-right flip" type="submit" name="delete" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" />
69
69
  </form>
70
70
  <form action="<%= root_path %>morgue/all/retry" method="post">
71
71
  <%= csrf_tag %>
72
- <input class="btn btn-danger btn-xs pull-right flip" type="submit" name="retry" value="<%= t('RetryAll') %>" data-confirm="<%= t('AreYouSure') %>" />
72
+ <input class="btn btn-danger pull-right flip" type="submit" name="retry" value="<%= t('RetryAll') %>" data-confirm="<%= t('AreYouSure') %>" />
73
73
  </form>
74
74
  <% end %>
75
75
 
data/web/views/queue.erb CHANGED
@@ -18,33 +18,37 @@
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
- <% @messages.each_with_index do |msg, index| %>
24
- <tr>
24
+ <% @jobs.each_with_index do |job, index| %>
25
+ <tr title="<%= job.jid %>">
25
26
  <% if params[:direction] == 'asc' %>
26
27
  <td><%= @count * (@current_page - 1) + index + 1 %></td>
27
28
  <% else %>
28
29
  <td><%= @total_size - (@count * (@current_page - 1) + index) %></td>
29
30
  <% end %>
30
31
  <td>
31
- <%= h(msg.display_class) %>
32
- <%= display_tags(msg, nil) %>
32
+ <%= h(job.display_class) %>
33
+ <%= display_tags(job, nil) %>
33
34
  </td>
34
35
  <td>
35
- <% a = msg.display_args %>
36
+ <% a = job.display_args %>
36
37
  <% if a.inspect.size > 100 %>
37
- <span class="worker_<%= index %>"><%= h(a.inspect[0..100]) + "... " %></span>
38
- <button data-toggle="collapse" data-target=".worker_<%= index %>" class="btn btn-default btn-xs"><%= t('ShowAll') %></button>
39
- <div class="toggle worker_<%= index %>"><%= display_args(a) %></div>
38
+ <span id="job_<%= index %>"><%= h(a.inspect[0..100]) + "... " %></span>
39
+ <button data-toggle="job_<%= index %>_full" class="btn btn-default btn-xs"><%= t('ShowAll') %></button>
40
+ <div class="toggle" id="job_<%= index %>_full"><%= display_args(a) %></div>
40
41
  <% else %>
41
- <%= display_args(msg.display_args) %>
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 %>
47
- <input name="key_val" value="<%= h msg.value %>" type="hidden" />
51
+ <input name="key_val" value="<%= h job.value %>" type="hidden" />
48
52
  <input class="btn btn-danger btn-xs" type="submit" name="delete" value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSure') %>" />
49
53
  </form>
50
54
  </td>
@@ -52,4 +56,4 @@
52
56
  <% end %>
53
57
  </table>
54
58
  </div>
55
- <%= erb :_paging, locals: { url: "#{root_path}queues/#{@name}" } %>
59
+ <%= erb :_paging, locals: { url: "#{root_path}queues/#{CGI.escape(@name)}" } %>
data/web/views/queues.erb CHANGED
@@ -1,7 +1,7 @@
1
1
  <h3><%= t('Queues') %></h3>
2
2
 
3
3
  <div class="table_container">
4
- <table class="queues table table-hover table-bordered table-striped table-white">
4
+ <table class="queues table table-hover table-bordered table-striped">
5
5
  <thead>
6
6
  <th><%= t('Queue') %></th>
7
7
  <th><%= t('Size') %></th>
@@ -21,13 +21,13 @@
21
21
  <td class="delete-confirm">
22
22
  <form action="<%=root_path %>queues/<%= CGI.escape(queue.name) %>" method="post">
23
23
  <%= csrf_tag %>
24
- <input class="btn btn-danger btn-xs" type="submit" name="delete" value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSureDeleteQueue', :queue => h(queue.name)) %>" />
24
+ <input class="btn btn-danger" type="submit" name="delete" title="This will delete all jobs within the queue, it will reappear if you push more jobs to it in the future." value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSureDeleteQueue', :queue => h(queue.name)) %>" />
25
25
 
26
26
  <% if Sidekiq.pro? %>
27
27
  <% if queue.paused? %>
28
- <input class="btn btn-danger btn-xs" type="submit" name="unpause" value="<%= t('Unpause') %>" />
28
+ <input class="btn btn-danger" type="submit" name="unpause" value="<%= t('Unpause') %>" />
29
29
  <% else %>
30
- <input class="btn btn-danger btn-xs" type="submit" name="pause" value="<%= t('Pause') %>" />
30
+ <input class="btn btn-danger" type="submit" name="pause" value="<%= t('Pause') %>" />
31
31
  <% end %>
32
32
  <% end %>
33
33
  </form>
@@ -14,7 +14,7 @@
14
14
  <form action="<%= root_path %>retries" method="post">
15
15
  <%= csrf_tag %>
16
16
  <div class="table_container">
17
- <table class="table table-striped table-bordered table-white">
17
+ <table class="table table-striped table-bordered table-hover">
18
18
  <thead>
19
19
  <tr>
20
20
  <th class="table-checkbox checkbox-column">
@@ -58,23 +58,23 @@
58
58
  <% end %>
59
59
  </table>
60
60
  </div>
61
- <input class="btn btn-primary btn-xs pull-left flip" type="submit" name="retry" value="<%= t('RetryNow') %>" />
62
- <input class="btn btn-danger btn-xs pull-left flip" type="submit" name="delete" value="<%= t('Delete') %>" />
63
- <input class="btn btn-danger btn-xs pull-left flip" type="submit" name="kill" value="<%= t('Kill') %>" />
61
+ <input class="btn btn-primary pull-left flip" type="submit" name="retry" value="<%= t('RetryNow') %>" />
62
+ <input class="btn btn-danger pull-left flip" type="submit" name="delete" value="<%= t('Delete') %>" />
63
+ <input class="btn btn-danger pull-left flip" type="submit" name="kill" value="<%= t('Kill') %>" />
64
64
  </form>
65
65
 
66
66
  <% unfiltered? do %>
67
67
  <form action="<%= root_path %>retries/all/delete" method="post">
68
68
  <%= csrf_tag %>
69
- <input class="btn btn-danger btn-xs pull-right flip" type="submit" name="delete" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" />
69
+ <input class="btn btn-danger pull-right flip" type="submit" name="delete" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" />
70
70
  </form>
71
71
  <form action="<%= root_path %>retries/all/retry" method="post">
72
72
  <%= csrf_tag %>
73
- <input class="btn btn-danger btn-xs pull-right flip" type="submit" name="retry" value="<%= t('RetryAll') %>" data-confirm="<%= t('AreYouSure') %>" />
73
+ <input class="btn btn-danger pull-right flip" type="submit" name="retry" value="<%= t('RetryAll') %>" data-confirm="<%= t('AreYouSure') %>" />
74
74
  </form>
75
75
  <form action="<%= root_path %>retries/all/kill" method="post">
76
76
  <%= csrf_tag %>
77
- <input class="btn btn-danger btn-xs pull-right flip" type="submit" name="kill" value="<%= t('KillAll') %>" data-confirm="<%= t('AreYouSure') %>" />
77
+ <input class="btn btn-danger pull-right flip" type="submit" name="kill" value="<%= t('KillAll') %>" data-confirm="<%= t('AreYouSure') %>" />
78
78
  </form>
79
79
  <% end %>
80
80
 
data/web/views/retry.erb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <h3><%= t('Error') %></h3>
4
4
  <div class="table_container">
5
- <table class="error table table-bordered table-striped">
5
+ <table class="error table table-bordered table-striped table-hover">
6
6
  <tbody>
7
7
  <tr>
8
8
  <th><%= t('ErrorClass') %></th>
@@ -15,7 +15,7 @@
15
15
  <form action="<%= root_path %>scheduled" method="post">
16
16
  <%= csrf_tag %>
17
17
  <div class="table_container">
18
- <table class="table table-striped table-bordered table-white">
18
+ <table class="table table-striped table-bordered table-hover">
19
19
  <thead>
20
20
  <tr>
21
21
  <th class="checkbox-column">