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

status: Add --sort=start and --reverse options #590

Closed
wants to merge 1 commit into from

Conversation

msabramo
Copy link
Contributor

@msabramo msabramo commented Mar 9, 2015

Proof of concept and request for feedback on the idea.

This will conflict with #530, which also could use some new feedback.

This lets the status command sort by start time. I've often wished for this, because I deal with servers that are running tons of processes from different teams and when the system gets slow or wonky, it helps if I can see which processes were started most recently, as these are often ones that are flapping up and down and chewing up CPU (basically the issue in #584).

[marca@marca-mac2 supervisor]$ supervisorctl status --sort=start
cat:0                            RUNNING   pid 25747, uptime 1 day, 2:11:57
cat:1                            RUNNING   pid 25746, uptime 1 day, 2:11:57
cat:3                            RUNNING   pid 25748, uptime 1 day, 2:11:57
cat:4                            RUNNING   pid 25750, uptime 1 day, 2:11:57
hello                            RUNNING   pid 25744, uptime 1 day, 2:11:57
dog:0                            FATAL     can't find command 'dog'
dog:1                            FATAL     can't find command 'dog'
dog:2                            FATAL     can't find command 'dog'
dog:3                            FATAL     can't find command 'dog'
dog:4                            FATAL     can't find command 'dog'
cat:2                            RUNNING   pid 69455, uptime 0:17:32
foo                              RUNNING   pid 69866, uptime 0:17:07

[marca@marca-mac2 supervisor]$ supervisorctl status --sort=start --reverse
foo                              RUNNING   pid 69866, uptime 0:17:09
cat:2                            RUNNING   pid 69455, uptime 0:17:34
dog:0                            FATAL     can't find command 'dog'
dog:1                            FATAL     can't find command 'dog'
dog:2                            FATAL     can't find command 'dog'
dog:3                            FATAL     can't find command 'dog'
dog:4                            FATAL     can't find command 'dog'
cat:0                            RUNNING   pid 25747, uptime 1 day, 2:11:59
cat:1                            RUNNING   pid 25746, uptime 1 day, 2:11:59
cat:3                            RUNNING   pid 25748, uptime 1 day, 2:11:59
cat:4                            RUNNING   pid 25750, uptime 1 day, 2:11:59
hello                            RUNNING   pid 25744, uptime 1 day, 2:11:59

If the idea of adding more options to status is okay, then I would change this to use more robust and extensible option parsing and would add tests.

@mnaberez
Copy link
Member

This looks like a good addition to me. With the changes in 4.0, it will be possible to run many more processes than 3.x, so this will be even more useful. I'd be happy to merge this if you would like to finish it and add some tests.

@mnaberez
Copy link
Member

mnaberez commented Nov 5, 2016

Closing due to inactivity.

@mnaberez mnaberez closed this Nov 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants