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

Order tasks in verbose paasta status #295

Merged
merged 2 commits into from
Mar 10, 2016

Conversation

drolando
Copy link
Contributor

@drolando drolando commented Mar 4, 2016

paasta status -v returns the list of Non-Running Tasks in a random
order. Also it only shows the last 10, so you might see old runs but not
the more recent ones.

This change orders the not_running_tasks list by start time. Since
they're reversed in status_mesos_tasks_verbose they'll be printed from
the latest one to the oldest one.

AFAICT this script is run directly on the mesos master, so I wasn't able to really try it.

@solarkennedy
Copy link
Contributor

lgtm. Ship if tests pass.

@@ -127,6 +127,8 @@ def get_running_tasks_from_active_frameworks(job_id):
def get_non_running_tasks_from_active_frameworks(job_id):
active_framework_tasks = get_current_tasks(job_id)
not_running_tasks = filter_not_running_tasks(active_framework_tasks)
# Order the tasks by timestamp
not_running_tasks.sort(key=lambda task: get_first_status_timestamp(task))
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather you moved this to the caller (paasta/tools:mesos_tools.py:251) - fixnship

`paasta status -v` returns the list of Non-Running Tasks in a random
order. Also it only shows the last 10, so you might see old runs but not
the more recent ones.

This change orders the not_running_tasks list by start time. Since
they're reversed in status_mesos_tasks_verbose they'll be printed from
the latest one to the oldest one.
@drolando drolando force-pushed the order_tasks_in_paasta_status branch from aadaf28 to 4eb72ec Compare March 10, 2016 14:32
@Rob-Johnson
Copy link
Contributor

thanks @drolando

Rob-Johnson added a commit that referenced this pull request Mar 10, 2016
@Rob-Johnson Rob-Johnson merged commit 0d5c028 into master Mar 10, 2016
giuliano108 added a commit that referenced this pull request Mar 14, 2016
PR #295 teaches `paasta status -v` to sort/truncate the list of non
running Mesos tasks. It introduces the bug fixed by this commit.
@asottile asottile deleted the order_tasks_in_paasta_status branch May 31, 2016 21:46
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