-
Notifications
You must be signed in to change notification settings - Fork 188
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
Add endpoint and client call to retrieve scheduled tasks info #2260
Conversation
SingularityService/src/main/java/com/hubspot/singularity/resources/StateResource.java
Show resolved
Hide resolved
|
||
final long start = System.currentTimeMillis(); | ||
|
||
Map<String, Boolean> queryParams = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style nit, we can just put Collections.emptyMap() in the args to executeRequest for this if we aren't actually adding any params
@Test | ||
public void testScheduledTasksInfoEndpoint(SingularityClient singularityClient) { | ||
final SingularityScheduledTasksInfo scheduledTasksInfo = singularityClient.getScheduledTasksInfo(); | ||
// TODO: assertion | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't actually have any real unit tests set up for the SingularityClient at the moment (yes... shame on us...). If you are trying to fit unit tests in for this PR, better bet would be to write one for the stateManager.getScheduledTasksInfo();
method. The SingularityClient methods you'll likely end up testing in our staging environment instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good - I'll test the new client method in staging then and won't add the unit test here as stateManager.getScheduledTasksInfo()
is not the functionality being added in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
This PR adds an endpoint to
StateResource
and client call toSingularityClient
that enable retrieval of the currentSingularityScheduledTasksInfo
.SingularityScheduledTasksInfo
contains the number of late task and maximum task lag, both of which will be checked in Serenity before decommissioning agents in order to implement a slow drain and prevent decommissioning too quickly.issue: https://git.hubteam.com/HubSpot/PaaS-Run/issues/1588
context: https://hubspot.slack.com/archives/CD13L0XCY/p1642617864005200