Skip to content

Commit

Permalink
Added changes to CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhian committed Feb 15, 2021
1 parent e9512cb commit 47ec16a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## HEAD

## v1.6.0
* 11.02.2021: Add a new endpoint (/sidekiq/api/statistic_by_last_job_status.json) *Rhian Moraes*
* 11.02.2021: /sidekiq/statistic: add two checkboxes to show/hide workers based on their last job status (#113) *Rhian Moraes*

## v1.5.1

* 06.02.2021: Generate new TAG to fix "version.rb" not updated in the previous one (#170) *Wender Freese*
Expand Down
12 changes: 5 additions & 7 deletions lib/sidekiq/statistic/statistic/workers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ def display
end

def display_by_last_status
{
passed: filter_last_job_status('passed'),
failed: filter_last_job_status('failed')
}
end
filtered_workers = display.group_by {|worker| worker[:last_job_status] }

filtered_workers['passed'] ||= []
filtered_workers['failed'] ||= []

def filter_last_job_status(status)
display.select { |worker| worker[:last_job_status] == status }
filtered_workers.transform_keys(&:to_sym)
end

def display_per_day(worker_name)
Expand Down
11 changes: 0 additions & 11 deletions test/test_sidekiq/statistic_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,6 @@ module Statistic
end
end

describe "#filter_last_job_status" do
it 'return array with worker when filtering by passed workers' do
middlewared {}

subject = statistic.filter_last_job_status('passed')

_(subject).must_be_instance_of Array
assert_equal subject[0][:name], worker
end
end

describe '#display_per_day' do
it 'return workers job per day' do
middlewared {}
Expand Down

0 comments on commit 47ec16a

Please sign in to comment.