-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugin: track number of running jobs per-queue
Problem: The priority plugin has no way to keep track of the number of jobs an association is running under each queue. Add a new member to the Association class: queue_usage, a map whose key-value pairs consist of a string representing the queue name and an integer representing the number of running jobs the association has under that queue. In the callback for job.state.run, increment the number of running jobs the association has for a given queue if one is specified. In the callback for job.state.inactive, decrement the number of running jobs the association has for a given queue if one is specified. Adjust the unit tests for the Association class to account for the addition of the "queue_usage" member.
- Loading branch information
Showing
4 changed files
with
61 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters