Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#113] Filter workers by their last job status #173

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

rhian-cs
Copy link

Added a way to filter workers by their last_job_status properties (as requested in #113) both in the API and in the statistics web page. Tests for the API and the called methods are also included.

API:

  • Added a new endpoint: /sidekiq/api/statistic_by_last_job_status.json
  • It returns a JSON object with the following template:
{
  "status": {
    "passed": [worker_array...],
    "failed": [worker_array...]
  }
}

Web page

In /sidekiq/statistic Worker's table I added two checkboxes (Passed and Failed) to show/hide the workers in the table depending on their last job status.

Copy link

@dieggofaustino dieggofaustino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wenderjean
Copy link
Collaborator

@rhian-cs Would u mind posting a print screen of the final result?

Copy link
Collaborator

@wenderjean wenderjean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhian-cs Can u add the changes you're adding in the CHANGELOG.md file?

/* === INPUT LIST === */

#status_filters_checkboxes {
display: flex;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind keeping an indentation of 2 spaces?

end

def filter_last_job_status(status)
display.select { |worker| worker[:last_job_status] == status }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can u try to feed a huge number of data into Redis just to allow us to identify performance issues here?

@rhian-cs
Copy link
Author

Screenshots

Showing only the workers table and the difference when each checkbox is ticked.

Both Passed and Failed workers

Screenshot01_WokersTable_PassedAndFailed

Only Passed workers

Screenshot02_WokersTable_PassedOnly

Only Failed workers

Screenshot03_WokersTable_FailedOnly

No checkboxes ticked

Screenshot04_WokersTable_NoOptions

@rhian-cs rhian-cs requested a review from wenderjean May 28, 2021 00:07
@rhian-cs
Copy link
Author

@wenderjean @davydovanton Hey everyone! I just rebased this PR and fixed the conflicts. When you have a bit of time, would you mind reviewing it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants