sidekiq-undertaker 1.3.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby-build.yml +30 -2
- data/.rubocop.yml +4 -0
- data/.rubocop_codeclimate.yml +9 -0
- data/CHANGELOG.md +21 -0
- data/README.md +2 -1
- data/lib/sidekiq/undertaker/dead_job.rb +10 -2
- data/lib/sidekiq/undertaker/job_distributor.rb +4 -0
- data/lib/sidekiq/undertaker/job_filter.rb +7 -2
- data/lib/sidekiq/undertaker/version.rb +1 -1
- data/lib/sidekiq/undertaker/web_extension/api_helpers.rb +42 -21
- data/lib/sidekiq/undertaker/web_extension.rb +11 -9
- data/lib/sidekiq/undertaker.rb +16 -0
- data/sidekiq-undertaker.gemspec +5 -6
- data/spec/fixtures/approvals/sidekiq_undertaker_webextension/show_filter/when_filter_page_is_called/behaves_like_a_page/the_displayed_page_is_correct_for_sidekiqv6.approved.txt +4 -4
- data/spec/fixtures/approvals/sidekiq_undertaker_webextension/show_filter/when_job_classbucket_page_is_called/behaves_like_a_page/the_displayed_page_is_correct_for_sidekiqv6.approved.txt +25 -25
- data/spec/fixtures/approvals/sidekiq_undertaker_webextension/show_filter/when_job_classbucket_page_is_polled/behaves_like_a_page/the_displayed_page_is_correct_for_sidekiqv6.approved.txt +25 -25
- data/spec/fixtures/approvals/sidekiq_undertaker_webextension/show_filter/when_job_classerror_classbucket_page_is_called/behaves_like_a_page/the_displayed_page_is_correct_for_sidekiqv6.approved.txt +231 -0
- data/spec/fixtures/approvals/sidekiq_undertaker_webextension/show_filter/when_job_classerror_classbucket_page_is_polled/behaves_like_a_page/the_displayed_page_is_correct_for_sidekiqv6.approved.txt +231 -0
- data/spec/fixtures/approvals/sidekiq_undertaker_webextension/show_morgue/when_job_classerrorbucket_is_called/with_all_failures_and_errors/behaves_like_a_page/the_displayed_page_is_correct_for_sidekiqv6.approved.txt +9 -8
- data/spec/fixtures/approvals/sidekiq_undertaker_webextension/show_morgue/when_job_classerrorbucket_is_called/with_job_class_error_and_specific_error_message/behaves_like_a_page/the_displayed_page_is_correct_for_sidekiqv6.approved.txt +284 -0
- data/spec/fixtures/approvals/sidekiq_undertaker_webextension/show_morgue/when_job_classerrorbucket_is_called/with_job_class_error_and_specific_error_message/with_pagination/behaves_like_a_page/the_displayed_page_is_correct_for_sidekiqv6.approved.txt +1310 -0
- data/spec/fixtures/approvals/sidekiq_undertaker_webextension/show_morgue/when_job_classerrorbucket_is_called/with_specific_job_class_and_a_specific_error/behaves_like_a_page/the_displayed_page_is_correct_for_sidekiqv6.approved.txt +7 -6
- data/spec/fixtures/approvals/sidekiq_undertaker_webextension/show_morgue/when_job_classerrorbucket_is_called/with_specific_job_class_and_a_specific_error/with_pagination/behaves_like_a_page/the_displayed_page_is_correct_for_sidekiqv6.approved.txt +55 -54
- data/spec/sidekiq/undertaker/dead_jobs_spec.rb +7 -4
- data/spec/sidekiq/undertaker/job_distributor_spec.rb +38 -16
- data/spec/sidekiq/undertaker/job_filter_spec.rb +26 -9
- data/spec/sidekiq/undertaker/web_extension_spec.rb +60 -17
- data/spec/sidekiq/undertaker_spec.rb +26 -0
- data/spec/spec_helper.rb +4 -0
- data/web/views/filter.erb +1 -1
- data/web/views/filter_job_class.erb +8 -8
- data/web/views/filter_job_class_error_class.erb +36 -0
- data/web/views/morgue.erb +4 -3
- metadata +63 -70
- data/.travis.yml +0 -51
@@ -3,40 +3,45 @@
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
5
|
module Sidekiq
|
6
|
+
# rubocop:disable Metrics/ModuleLength
|
6
7
|
module Undertaker
|
7
8
|
describe JobDistributor do
|
8
9
|
let(:job1) do
|
9
10
|
instance_double(Sidekiq::JobRecord, item: {
|
10
|
-
"class"
|
11
|
-
"failed_at"
|
12
|
-
"error_class"
|
11
|
+
"class" => "A",
|
12
|
+
"failed_at" => 1,
|
13
|
+
"error_class" => "E1",
|
14
|
+
"error_message" => "M1"
|
13
15
|
})
|
14
16
|
end
|
15
17
|
let(:job2) do
|
16
18
|
instance_double(Sidekiq::JobRecord, item: {
|
17
|
-
"class"
|
18
|
-
"failed_at"
|
19
|
-
"error_class"
|
19
|
+
"class" => "A",
|
20
|
+
"failed_at" => 1,
|
21
|
+
"error_class" => "E1",
|
22
|
+
"error_message" => "M1"
|
20
23
|
})
|
21
24
|
end
|
22
25
|
let(:job3) do
|
23
26
|
instance_double(Sidekiq::JobRecord, item: {
|
24
|
-
"class"
|
25
|
-
"failed_at"
|
26
|
-
"error_class"
|
27
|
+
"class" => "B",
|
28
|
+
"failed_at" => 1,
|
29
|
+
"error_class" => "E1",
|
30
|
+
"error_message" => "M2"
|
27
31
|
})
|
28
32
|
end
|
29
33
|
let(:job4) do
|
30
34
|
instance_double(Sidekiq::JobRecord, item: {
|
31
|
-
"class"
|
32
|
-
"failed_at"
|
33
|
-
"error_class"
|
35
|
+
"class" => "B",
|
36
|
+
"failed_at" => 1,
|
37
|
+
"error_class" => "E2",
|
38
|
+
"error_message" => "M1"
|
34
39
|
})
|
35
40
|
end
|
36
41
|
|
37
42
|
let(:dead_job1) do
|
38
43
|
DeadJob.new(
|
39
|
-
job: job1, # 'A', 'E1'
|
44
|
+
job: job1, # 'A', 'E1', 'M1'
|
40
45
|
time_elapsed_since_failure: 10,
|
41
46
|
bucket_name: "1_hour"
|
42
47
|
)
|
@@ -44,21 +49,21 @@ module Sidekiq
|
|
44
49
|
|
45
50
|
let(:dead_job2) do
|
46
51
|
DeadJob.new(
|
47
|
-
job: job2, # 'A', 'E1'
|
52
|
+
job: job2, # 'A', 'E1', 'M1'
|
48
53
|
time_elapsed_since_failure: 10 + (60 * 60),
|
49
54
|
bucket_name: "3_hours"
|
50
55
|
)
|
51
56
|
end
|
52
57
|
let(:dead_job3) do
|
53
58
|
DeadJob.new(
|
54
|
-
job: job3, # 'B', 'E1'
|
59
|
+
job: job3, # 'B', 'E1', 'M2'
|
55
60
|
time_elapsed_since_failure: 10 + (60 * 60),
|
56
61
|
bucket_name: "3_hours"
|
57
62
|
)
|
58
63
|
end
|
59
64
|
let(:dead_job4) do
|
60
65
|
DeadJob.new(
|
61
|
-
job: job4, # 'B', 'E2'
|
66
|
+
job: job4, # 'B', 'E2', 'M1'
|
62
67
|
time_elapsed_since_failure: 10 + (60 * 60 * 24),
|
63
68
|
bucket_name: "1_day"
|
64
69
|
)
|
@@ -98,7 +103,24 @@ module Sidekiq
|
|
98
103
|
expect(distribution).to eq expected_distribution
|
99
104
|
end
|
100
105
|
end
|
106
|
+
|
107
|
+
describe "#group_by_error_msg" do
|
108
|
+
subject(:distribution) { described_class.new(dead_jobs).group_by_error_msg }
|
109
|
+
|
110
|
+
let(:expected_distribution) do
|
111
|
+
[
|
112
|
+
["all", { "1_hour" => 1, "3_hours" => 2, "1_day" => 1, "3_days" => 0, "1_week" => 0, "older" => 0, "total_dead" => 4 }],
|
113
|
+
["M1", { "1_hour" => 1, "3_hours" => 1, "1_day" => 1, "3_days" => 0, "1_week" => 0, "older" => 0, "total_dead" => 3 }],
|
114
|
+
["M2", { "1_hour" => 0, "3_hours" => 1, "1_day" => 0, "3_days" => 0, "1_week" => 0, "older" => 0, "total_dead" => 1 }]
|
115
|
+
]
|
116
|
+
end
|
117
|
+
|
118
|
+
it "distributes the dead jobs into buckets and groups them by error_msg" do
|
119
|
+
expect(distribution).to eq expected_distribution
|
120
|
+
end
|
121
|
+
end
|
101
122
|
# rubocop:enable Layout/LineLength
|
102
123
|
end
|
103
124
|
end
|
125
|
+
# rubocop:enable Metrics/ModuleLength
|
104
126
|
end
|
@@ -8,25 +8,28 @@ module Sidekiq
|
|
8
8
|
describe ".filter_dead_jobs" do
|
9
9
|
let(:job1) do
|
10
10
|
instance_double(Sidekiq::JobRecord, item: {
|
11
|
-
"class"
|
12
|
-
"failed_at"
|
13
|
-
"error_class"
|
11
|
+
"class" => "HardWorkTask",
|
12
|
+
"failed_at" => Time.now.to_i - (5 * 60),
|
13
|
+
"error_class" => "NoMethodError",
|
14
|
+
"error_message" => "undefined method `pause` for H..."
|
14
15
|
})
|
15
16
|
end
|
16
17
|
|
17
18
|
let(:job2) do
|
18
19
|
instance_double(Sidekiq::JobRecord, item: {
|
19
|
-
"class"
|
20
|
-
"failed_at"
|
21
|
-
"error_class"
|
20
|
+
"class" => "HardWorkTask",
|
21
|
+
"failed_at" => Time.now.to_i - (2 * 60 * 60),
|
22
|
+
"error_class" => "RandomError",
|
23
|
+
"error_message" => "random error message"
|
22
24
|
})
|
23
25
|
end
|
24
26
|
|
25
27
|
let(:job3) do
|
26
28
|
instance_double(Sidekiq::JobRecord, item: {
|
27
|
-
"class"
|
28
|
-
"failed_at"
|
29
|
-
"error_class"
|
29
|
+
"class" => "LazyWorkTask",
|
30
|
+
"failed_at" => Time.now.to_i - (2 * 60 * 60),
|
31
|
+
"error_class" => "NoMethodError",
|
32
|
+
"error_message" => "undefined method `work_hard` for LazyWork:Class"
|
30
33
|
})
|
31
34
|
end
|
32
35
|
|
@@ -85,6 +88,20 @@ module Sidekiq
|
|
85
88
|
it { expect(dead_jobs.size).to eq 2 }
|
86
89
|
end
|
87
90
|
|
91
|
+
context "when the error_msg filter is given" do
|
92
|
+
subject(:dead_jobs) do
|
93
|
+
described_class.filter_dead_jobs("error_msg" => "undefined method `pause` for H...")
|
94
|
+
end
|
95
|
+
|
96
|
+
it "filters jobs based on error_message" do
|
97
|
+
dead_jobs.each do |dead_job|
|
98
|
+
expect(dead_job.error_msg).to eq "undefined method `pause` for H..."
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
it { expect(dead_jobs.size).to eq 1 }
|
103
|
+
end
|
104
|
+
|
88
105
|
context "when no filters are applied" do
|
89
106
|
subject(:dead_jobs) { described_class.filter_dead_jobs }
|
90
107
|
|
@@ -33,13 +33,15 @@ module Sidekiq
|
|
33
33
|
"class" => "HardWorker",
|
34
34
|
"args" => ["asdf", 1234],
|
35
35
|
"queue" => "foo",
|
36
|
-
"error_message" => "
|
36
|
+
"error_message" => "Option 'data/file_name' is required! This is an extra long error message.",
|
37
37
|
"error_class" => "RuntimeError",
|
38
38
|
"retry_count" => 0,
|
39
39
|
"failed_at" => Time.now.utc
|
40
40
|
}
|
41
41
|
end
|
42
42
|
|
43
|
+
let(:encoded_error_msg) { "T3B0aW9uICdkYXRhL2ZpbGVfbmFtZScgaXMgcmVxLi4u" }
|
44
|
+
|
43
45
|
# rubocop:disable RSpec/AnyInstance
|
44
46
|
before do
|
45
47
|
Timecop.freeze(Time.gm(2018, 12, 16, 20, 57))
|
@@ -101,6 +103,20 @@ module Sidekiq
|
|
101
103
|
|
102
104
|
it_behaves_like "a page"
|
103
105
|
end
|
106
|
+
|
107
|
+
# /undertaker/filter/:job_class/:error_class/:bucket_name
|
108
|
+
context "when job-class/error-class/bucket page is called" do
|
109
|
+
subject { get "/undertaker/filter/HardWorker/RuntimeError/1_hour" }
|
110
|
+
|
111
|
+
it_behaves_like "a page"
|
112
|
+
end
|
113
|
+
|
114
|
+
# /undertaker/filter/:job_class/:error_class/:bucket_name?poll=true
|
115
|
+
context "when job-class/error-class/bucket page is polled" do
|
116
|
+
subject { get "/undertaker/filter/HardWorker/RuntimeError/1_hour?poll=true" }
|
117
|
+
|
118
|
+
it_behaves_like "a page"
|
119
|
+
end
|
104
120
|
end
|
105
121
|
|
106
122
|
describe "show morgue" do
|
@@ -108,10 +124,28 @@ module Sidekiq
|
|
108
124
|
allow_any_instance_of(Sidekiq::Web::CsrfProtection).to receive(:mask_token).and_return("stubbed-csrf-token")
|
109
125
|
end
|
110
126
|
|
111
|
-
# /undertaker/morgue/:job_class/:error_class/:bucket_name
|
127
|
+
# /undertaker/morgue/:job_class/:error_class/:error_msg/:bucket_name
|
112
128
|
context "when job-class/error/bucket is called" do
|
113
129
|
context "with specific job-class and a specific error" do
|
114
|
-
subject { get "/undertaker/morgue/HardWorker/RuntimeError/1_hour" }
|
130
|
+
subject { get "/undertaker/morgue/HardWorker/RuntimeError/all/1_hour" }
|
131
|
+
|
132
|
+
it_behaves_like "a page"
|
133
|
+
|
134
|
+
context "with pagination" do
|
135
|
+
before do
|
136
|
+
50.times do |i|
|
137
|
+
job_refs.push add_dead("jid" => i.to_s)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
it_behaves_like "a page"
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
context "with job-class, error and specific error message" do
|
146
|
+
subject do
|
147
|
+
get "/undertaker/morgue/HardWorker/RuntimeError/#{encoded_error_msg}/1_hour"
|
148
|
+
end
|
115
149
|
|
116
150
|
it_behaves_like "a page"
|
117
151
|
|
@@ -127,7 +161,7 @@ module Sidekiq
|
|
127
161
|
end
|
128
162
|
|
129
163
|
context "with all failures and errors" do
|
130
|
-
subject { get "/undertaker/morgue/all/all/total_dead" }
|
164
|
+
subject { get "/undertaker/morgue/all/all/all/total_dead" }
|
131
165
|
|
132
166
|
it_behaves_like "a page"
|
133
167
|
end
|
@@ -136,12 +170,17 @@ module Sidekiq
|
|
136
170
|
# rubocop:enable RSpec/AnyInstance
|
137
171
|
|
138
172
|
describe "delete" do
|
139
|
-
context "when job-class, error and bucket are given" do
|
140
|
-
subject
|
173
|
+
context "when job-class, error, error message and bucket are given" do
|
174
|
+
subject do
|
175
|
+
post "/undertaker/morgue/HardWorker/RuntimeError/#{encoded_error_msg}/1_hour/delete"
|
176
|
+
end
|
141
177
|
|
142
|
-
let(:expected_redirect_url) { "http://example.org/undertaker/morgue/HardWorker/RuntimeError/1_hour" }
|
178
|
+
let(:expected_redirect_url) { "http://example.org/undertaker/morgue/HardWorker/RuntimeError/#{encoded_error_msg}/1_hour" }
|
143
179
|
|
144
|
-
let(:params)
|
180
|
+
let(:params) do
|
181
|
+
{ "job_class" => "HardWorker", "error_class" => "RuntimeError", "bucket_name" => "1_hour",
|
182
|
+
"error_msg" => "Option 'data/file_name' is req..." }
|
183
|
+
end
|
145
184
|
let(:dead_jobs_set) { [dead_job1, dead_job2] }
|
146
185
|
let(:dead_job1) { Sidekiq::Undertaker::DeadJob.to_dead_job(Sidekiq::DeadSet.new.find_job(jid1)) }
|
147
186
|
let(:dead_job2) { Sidekiq::Undertaker::DeadJob.to_dead_job(Sidekiq::DeadSet.new.find_job(jid2)) }
|
@@ -161,7 +200,7 @@ module Sidekiq
|
|
161
200
|
expect { subject }.to change { Sidekiq::DeadSet.new.size }.from(4).to(2)
|
162
201
|
end
|
163
202
|
|
164
|
-
it "redirects to
|
203
|
+
it "redirects to morgue view after the delete" do
|
165
204
|
subject
|
166
205
|
expect(last_response.status).to eq 302
|
167
206
|
|
@@ -269,11 +308,14 @@ module Sidekiq
|
|
269
308
|
|
270
309
|
describe "retry" do
|
271
310
|
context "when job class, error and bucket are given" do
|
272
|
-
subject { post "/undertaker/morgue/HardWorker/RuntimeError/1_hour/retry" }
|
311
|
+
subject { post "/undertaker/morgue/HardWorker/RuntimeError/all/1_hour/retry" }
|
273
312
|
|
274
|
-
let(:expected_redirect_url) { "http://example.org/undertaker/morgue/HardWorker/RuntimeError/1_hour" }
|
313
|
+
let(:expected_redirect_url) { "http://example.org/undertaker/morgue/HardWorker/RuntimeError/all/1_hour" }
|
275
314
|
|
276
|
-
let(:params)
|
315
|
+
let(:params) do
|
316
|
+
{ "job_class" => "HardWorker", "error_class" => "RuntimeError", "bucket_name" => "1_hour",
|
317
|
+
"error_msg" => "all" }
|
318
|
+
end
|
277
319
|
let(:dead_jobs_set) { [dead_job1, dead_job2] }
|
278
320
|
let(:dead_job1) { Sidekiq::Undertaker::DeadJob.to_dead_job(Sidekiq::DeadSet.new.find_job(jid1)) }
|
279
321
|
let(:dead_job2) { Sidekiq::Undertaker::DeadJob.to_dead_job(Sidekiq::DeadSet.new.find_job(jid2)) }
|
@@ -326,13 +368,14 @@ module Sidekiq
|
|
326
368
|
|
327
369
|
describe "export" do
|
328
370
|
context "when job class, error and bucket are given" do
|
329
|
-
subject { post "/undertaker/morgue/HardWorker/RuntimeError/1_hour/export" }
|
371
|
+
subject { post "/undertaker/morgue/HardWorker/RuntimeError/all/1_hour/export" }
|
330
372
|
|
331
|
-
let(:expected_redirect_url) { "http://example.org/undertaker/morgue/HardWorker/RuntimeError/1_hour" }
|
373
|
+
let(:expected_redirect_url) { "http://example.org/undertaker/morgue/HardWorker/RuntimeError/all/1_hour" }
|
332
374
|
let(:expected_content_disposition_header) { "attachment; filename=\"2018-12-16_20-57.json\"" }
|
333
375
|
|
334
376
|
let(:params) do
|
335
|
-
{ "job_class" => "HardWorker", "error_class" => "RuntimeError", "bucket_name" => "1_hour"
|
377
|
+
{ "job_class" => "HardWorker", "error_class" => "RuntimeError", "bucket_name" => "1_hour",
|
378
|
+
"error_msg" => "all" }
|
336
379
|
end
|
337
380
|
let(:dead_jobs_set) { [dead_job1, dead_job2] }
|
338
381
|
let(:dead_job1) { Sidekiq::Undertaker::DeadJob.to_dead_job(Sidekiq::DeadSet.new.find_job(jid1)) }
|
@@ -400,9 +443,9 @@ module Sidekiq
|
|
400
443
|
it "redirects on specific retry post" do
|
401
444
|
post("/undertaker/morgue",
|
402
445
|
"key[]=#{job_refs[0]}&retry=Retry+Now",
|
403
|
-
"HTTP_REFERER" => "/undertaker/morgue/all/all/total_dead")
|
446
|
+
"HTTP_REFERER" => "/undertaker/morgue/all/all/all/total_dead")
|
404
447
|
expect(last_response.status).to eq 302
|
405
|
-
expect(last_response.header["Location"]).to include("/undertaker/morgue/all/all/total_dead")
|
448
|
+
expect(last_response.header["Location"]).to include("/undertaker/morgue/all/all/all/total_dead")
|
406
449
|
end
|
407
450
|
end
|
408
451
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
describe Sidekiq::Undertaker do
|
6
|
+
describe ".max_error_msg_length" do
|
7
|
+
around do |example|
|
8
|
+
memo = described_class.max_error_msg_length
|
9
|
+
example.run
|
10
|
+
described_class.max_error_msg_length = memo
|
11
|
+
end
|
12
|
+
|
13
|
+
it "returns the default max_error_msg_length" do
|
14
|
+
expect(described_class.max_error_msg_length).to eq(30)
|
15
|
+
end
|
16
|
+
|
17
|
+
it "updates the max_error_msg_length" do
|
18
|
+
new_value = 99
|
19
|
+
expect { described_class.max_error_msg_length = new_value }
|
20
|
+
.to change(described_class, :max_error_msg_length)
|
21
|
+
.from(30).to(new_value)
|
22
|
+
|
23
|
+
expect(described_class.max_error_msg_length).to eq(new_value)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/spec/spec_helper.rb
CHANGED
data/web/views/filter.erb
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
</thead>
|
22
22
|
<% @distribution.each do |group, bucket_counts| %>
|
23
23
|
<tr>
|
24
|
-
<td><a href='<%= "#{root_path}undertaker/morgue/#{group}/all/total_dead" %>'> <%= group %></a></td>
|
24
|
+
<td><a href='<%= "#{root_path}undertaker/morgue/#{group}/all/all/total_dead" %>'> <%= group %></a></td>
|
25
25
|
<td><a href='<%= "#{root_path}undertaker/filter/#{group}/total_dead" %>'><%= bucket_counts['total_dead']%></a></td>
|
26
26
|
<td><a href='<%= "#{root_path}undertaker/filter/#{group}/1_hour" %>'><%= bucket_counts['1_hour']%></a></td>
|
27
27
|
<td><a href='<%= "#{root_path}undertaker/filter/#{group}/3_hours" %>'><%= bucket_counts['3_hours']%></a></td>
|
@@ -22,14 +22,14 @@
|
|
22
22
|
</thead>
|
23
23
|
<% @distribution.each do |group, bucket_counts| %>
|
24
24
|
<tr>
|
25
|
-
<td><a href='<%= "#{root_path}undertaker/morgue/#{@req_job_class}/#{group}/total_dead" %>'><%= group %></a></td>
|
26
|
-
<td><a href='<%= "#{root_path}undertaker/
|
27
|
-
<td><a href='<%= "#{root_path}undertaker/
|
28
|
-
<td><a href='<%= "#{root_path}undertaker/
|
29
|
-
<td><a href='<%= "#{root_path}undertaker/
|
30
|
-
<td><a href='<%= "#{root_path}undertaker/
|
31
|
-
<td><a href='<%= "#{root_path}undertaker/
|
32
|
-
<td><a href='<%= "#{root_path}undertaker/
|
25
|
+
<td><a href='<%= "#{root_path}undertaker/morgue/#{@req_job_class}/#{group}/all/total_dead" %>'><%= group %></a></td>
|
26
|
+
<td><a href='<%= "#{root_path}undertaker/filter/#{@req_job_class}/#{group}/total_dead" %>'><%= bucket_counts['total_dead'] %></a></td>
|
27
|
+
<td><a href='<%= "#{root_path}undertaker/filter/#{@req_job_class}/#{group}/1_hour" %>'><%= bucket_counts['1_hour']%></a></td>
|
28
|
+
<td><a href='<%= "#{root_path}undertaker/filter/#{@req_job_class}/#{group}/3_hours" %>'><%= bucket_counts['3_hours']%></a></td>
|
29
|
+
<td><a href='<%= "#{root_path}undertaker/filter/#{@req_job_class}/#{group}/1_day" %>'><%= bucket_counts['1_day']%></a></td>
|
30
|
+
<td><a href='<%= "#{root_path}undertaker/filter/#{@req_job_class}/#{group}/3_days" %>'><%= bucket_counts['3_days']%></a></td>
|
31
|
+
<td><a href='<%= "#{root_path}undertaker/filter/#{@req_job_class}/#{group}/1_week" %>'><%= bucket_counts['1_week']%></a></td>
|
32
|
+
<td><a href='<%= "#{root_path}undertaker/filter/#{@req_job_class}/#{group}/older" %>'><%= bucket_counts['older']%></a></td>
|
33
33
|
</tr>
|
34
34
|
<% end %>
|
35
35
|
</table>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<header class="row header">
|
2
|
+
<div class="col-sm-12">
|
3
|
+
<h3>
|
4
|
+
<%= "<b>#{@total_dead}</b> dead #{@total_dead == 1 ? 'job' : 'jobs'}" %>
|
5
|
+
<%= " of <b>#{@req_job_class}</b> class" unless @req_job_class == "all" %>
|
6
|
+
<%= " with <b>#{@req_error_class}</b> exception" unless @req_error_class == "all" %>
|
7
|
+
</h3>
|
8
|
+
</div>
|
9
|
+
</header>
|
10
|
+
|
11
|
+
<table class="table table-striped table-bordered table-white">
|
12
|
+
<thead>
|
13
|
+
<tr>
|
14
|
+
<th style="width: 20%"><%= t('Error Message') %></th>
|
15
|
+
<th style="width: 10%"><%= t('All') %></th>
|
16
|
+
<th style="width: 10%"><%= t('1 hour') %></th>
|
17
|
+
<th style="width: 10%"><%= t('3 hours') %></th>
|
18
|
+
<th style="width: 10%"><%= t('1 day') %></th>
|
19
|
+
<th style="width: 10%"><%= t('3 days') %></th>
|
20
|
+
<th style="width: 10%"><%= t('1 week') %></th>
|
21
|
+
<th style="width: 10%"><%= t('Older') %></th>
|
22
|
+
</tr>
|
23
|
+
</thead>
|
24
|
+
<% @distribution.each do |group, bucket_counts| %>
|
25
|
+
<tr>
|
26
|
+
<td><a href='<%= "#{root_path}undertaker/morgue/#{@req_job_class}/#{@req_error_class}/#{Base64.urlsafe_encode64(group)}/total_dead" %>'><%= group %></a></td>
|
27
|
+
<td><a href='<%= "#{root_path}undertaker/morgue/#{@req_job_class}/#{@req_error_class}/#{Base64.urlsafe_encode64(group)}/total_dead" %>'><%= bucket_counts['total_dead'] %></a></td>
|
28
|
+
<td><a href='<%= "#{root_path}undertaker/morgue/#{@req_job_class}/#{@req_error_class}/#{Base64.urlsafe_encode64(group)}/1_hour" %>'><%= bucket_counts['1_hour']%></a></td>
|
29
|
+
<td><a href='<%= "#{root_path}undertaker/morgue/#{@req_job_class}/#{@req_error_class}/#{Base64.urlsafe_encode64(group)}/3_hours" %>'><%= bucket_counts['3_hours']%></a></td>
|
30
|
+
<td><a href='<%= "#{root_path}undertaker/morgue/#{@req_job_class}/#{@req_error_class}/#{Base64.urlsafe_encode64(group)}/1_day" %>'><%= bucket_counts['1_day']%></a></td>
|
31
|
+
<td><a href='<%= "#{root_path}undertaker/morgue/#{@req_job_class}/#{@req_error_class}/#{Base64.urlsafe_encode64(group)}/3_days" %>'><%= bucket_counts['3_days']%></a></td>
|
32
|
+
<td><a href='<%= "#{root_path}undertaker/morgue/#{@req_job_class}/#{@req_error_class}/#{Base64.urlsafe_encode64(group)}/1_week" %>'><%= bucket_counts['1_week']%></a></td>
|
33
|
+
<td><a href='<%= "#{root_path}undertaker/morgue/#{@req_job_class}/#{@req_error_class}/#{Base64.urlsafe_encode64(group)}/older" %>'><%= bucket_counts['older']%></a></td>
|
34
|
+
</tr>
|
35
|
+
<% end %>
|
36
|
+
</table>
|
data/web/views/morgue.erb
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
<%= "<b>#{@total_dead}</b> dead #{@total_dead == 1 ? 'job' : 'jobs'}" %>
|
5
5
|
<%= " of <b>#{@req_job_class}</b> class" unless @req_job_class == "all" %>
|
6
6
|
<%= " with <b>#{@req_error_class}</b> exception" unless @req_error_class == "all" %>
|
7
|
+
<%= " with <b>#{@req_error_msg}</b> message" unless @req_error_msg == "all" %>
|
7
8
|
<%= " in <b>#{@req_bucket_name}</b> bucket" %>
|
8
9
|
</h3>
|
9
10
|
</div>
|
@@ -60,17 +61,17 @@
|
|
60
61
|
<input class="btn btn-danger btn-xs pull-left" type="submit" name="delete" value="<%= t('UndertakerBury') %>" />
|
61
62
|
</form>
|
62
63
|
|
63
|
-
<form action="<%= "#{root_path}undertaker/morgue/#{@req_job_class}/#{@req_error_class}/#{@req_bucket_name}/delete" %>" method="post">
|
64
|
+
<form action="<%= "#{root_path}undertaker/morgue/#{@req_job_class}/#{@req_error_class}/#{Base64.urlsafe_encode64(@req_error_msg)}/#{@req_bucket_name}/delete" %>" method="post">
|
64
65
|
<%= respond_to?(:csrf_tag) && csrf_tag %>
|
65
66
|
<input class="btn btn-danger btn-xs pull-right" type="submit" name="delete" value="<%= t('UndertakerBuryAll') %>" data-confirm="<%= t('AreYouSure') %>" />
|
66
67
|
</form>
|
67
68
|
|
68
|
-
<form action="<%= "#{root_path}undertaker/morgue/#{@req_job_class}/#{@req_error_class}/#{@req_bucket_name}/export" %>" method="post">
|
69
|
+
<form action="<%= "#{root_path}undertaker/morgue/#{@req_job_class}/#{@req_error_class}/#{Base64.urlsafe_encode64(@req_error_msg)}/#{@req_bucket_name}/export" %>" method="post">
|
69
70
|
<%= respond_to?(:csrf_tag) && csrf_tag %>
|
70
71
|
<input class="btn btn-secondary btn-xs pull-right" type="submit" name="export" value="<%= t('UndertakerExportAll') %>" />
|
71
72
|
</form>
|
72
73
|
|
73
|
-
<form action="<%= "#{root_path}undertaker/morgue/#{@req_job_class}/#{@req_error_class}/#{@req_bucket_name}/retry" %>" method="post">
|
74
|
+
<form action="<%= "#{root_path}undertaker/morgue/#{@req_job_class}/#{@req_error_class}/#{Base64.urlsafe_encode64(@req_error_msg)}/#{@req_bucket_name}/retry" %>" method="post">
|
74
75
|
<%= respond_to?(:csrf_tag) && csrf_tag %>
|
75
76
|
<input class="btn btn-danger btn-xs pull-right" type="submit" name="retry" value="<%= t('UndertakerReviveAll') %>" data-confirm="<%= t('AreYouSure') %>" />
|
76
77
|
</form>
|