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

Set process title of command-executor from its command #77

Merged
merged 1 commit into from
Jul 5, 2017

Conversation

eagletmt
Copy link
Member

@eagletmt eagletmt commented Jul 4, 2017

It clarifies which command is running in each process.

Before

% ps auxf | grep rails
eagletmt 14149 27.8  0.5 634760 86608 pts/2    Sl+  01:18   0:01  |   | \_ ruby ./bin/rails runner Kuroko2::Servers::CommandExecutor.new.run
eagletmt 14262  0.5  0.5 636820 81064 pts/2    Sl+  01:18   0:00  |   | |   \_ ruby ./bin/rails runner Kuroko2::Servers::CommandExecutor.new.run
eagletmt 14268  0.2  0.4 637104 79348 pts/2    Sl+  01:18   0:00  |   | |   \_ ruby ./bin/rails runner Kuroko2::Servers::CommandExecutor.new.run
eagletmt 14274  0.2  0.4 637248 79412 pts/2    Sl+  01:18   0:00  |   | |   \_ ruby ./bin/rails runner Kuroko2::Servers::CommandExecutor.new.run
eagletmt 14280  0.0  0.4 637084 79264 pts/2    Sl+  01:18   0:00  |   | |   \_ ruby ./bin/rails runner Kuroko2::Servers::CommandExecutor.new.run
eagletmt 14286  0.0  0.4 637120 79452 pts/2    Sl+  01:18   0:00  |   | |   \_ ruby ./bin/rails runner Kuroko2::Servers::CommandExecutor.new.run
eagletmt 14292  0.0  0.4 636816 77304 pts/2    Sl+  01:18   0:00  |   | |   \_ ruby ./bin/rails runner Kuroko2::Servers::CommandExecutor.new.run
eagletmt 14150 28.0  0.5 627236 80992 pts/2    Sl+  01:18   0:01  |   | \_ ruby ./bin/rails runner Kuroko2::Servers::JobScheduler.new.run
eagletmt 14151 27.2  0.5 631720 85532 pts/2    Sl+  01:18   0:01  |   | \_ ruby ./bin/rails runner Kuroko2::Servers::WorkflowProcessor.new.run

After

% ps auxf | egrep 'rails|command-executor'
eagletmt 15988  5.9  0.5 633776 85868 pts/2    Sl+  01:24   0:01  |   | \_ ruby ./bin/rails runner Kuroko2::Servers::CommandExecutor.new.run
eagletmt 16107  0.3  0.5 636264 80800 pts/2    Sl+  01:24   0:00  |   | |   \_ command-executor (worker_id=0 command=Kuroko2::Command::Kill)
eagletmt 16113  0.3  0.4 636584 80408 pts/2    Sl+  01:24   0:00  |   | |   \_ command-executor (worker_id=1 command=Kuroko2::Command::Shell)
eagletmt 16119  0.2  0.4 636548 79148 pts/2    Sl+  01:24   0:00  |   | |   \_ command-executor (worker_id=2 command=Kuroko2::Command::Shell)
eagletmt 16125  0.3  0.4 636552 79116 pts/2    Sl+  01:24   0:00  |   | |   \_ command-executor (worker_id=3 command=Kuroko2::Command::Shell)
eagletmt 16131  0.3  0.4 636592 79104 pts/2    Sl+  01:24   0:00  |   | |   \_ command-executor (worker_id=4 command=Kuroko2::Command::Shell)
eagletmt 16137  0.2  0.4 636380 79056 pts/2    Sl+  01:24   0:00  |   | |   \_ command-executor (worker_id=5 command=Kuroko2::Command::Monitor)
eagletmt 15989  5.8  0.4 626096 80340 pts/2    Sl+  01:24   0:01  |   | \_ ruby ./bin/rails runner Kuroko2::Servers::JobScheduler.new.run
eagletmt 15990  5.7  0.5 627704 82056 pts/2    Sl+  01:24   0:01  |   | \_ ruby ./bin/rails runner Kuroko2::Servers::WorkflowProcessor.new.run

@cookpad/dev-infra What do you think of this?

It clarifies which command is running in each process.

Before

```
% ps auxf | grep rails
eagletmt 14149 27.8  0.5 634760 86608 pts/2    Sl+  01:18   0:01  |   | \_ ruby ./bin/rails runner Kuroko2::Servers::CommandExecutor.new.run
eagletmt 14262  0.5  0.5 636820 81064 pts/2    Sl+  01:18   0:00  |   | |   \_ ruby ./bin/rails runner Kuroko2::Servers::CommandExecutor.new.run
eagletmt 14268  0.2  0.4 637104 79348 pts/2    Sl+  01:18   0:00  |   | |   \_ ruby ./bin/rails runner Kuroko2::Servers::CommandExecutor.new.run
eagletmt 14274  0.2  0.4 637248 79412 pts/2    Sl+  01:18   0:00  |   | |   \_ ruby ./bin/rails runner Kuroko2::Servers::CommandExecutor.new.run
eagletmt 14280  0.0  0.4 637084 79264 pts/2    Sl+  01:18   0:00  |   | |   \_ ruby ./bin/rails runner Kuroko2::Servers::CommandExecutor.new.run
eagletmt 14286  0.0  0.4 637120 79452 pts/2    Sl+  01:18   0:00  |   | |   \_ ruby ./bin/rails runner Kuroko2::Servers::CommandExecutor.new.run
eagletmt 14292  0.0  0.4 636816 77304 pts/2    Sl+  01:18   0:00  |   | |   \_ ruby ./bin/rails runner Kuroko2::Servers::CommandExecutor.new.run
eagletmt 14150 28.0  0.5 627236 80992 pts/2    Sl+  01:18   0:01  |   | \_ ruby ./bin/rails runner Kuroko2::Servers::JobScheduler.new.run
eagletmt 14151 27.2  0.5 631720 85532 pts/2    Sl+  01:18   0:01  |   | \_ ruby ./bin/rails runner Kuroko2::Servers::WorkflowProcessor.new.run
```

After

```
% ps auxf | egrep 'rails|command-executor'
eagletmt 15988  5.9  0.5 633776 85868 pts/2    Sl+  01:24   0:01  |   | \_ ruby ./bin/rails runner Kuroko2::Servers::CommandExecutor.new.run
eagletmt 16107  0.3  0.5 636264 80800 pts/2    Sl+  01:24   0:00  |   | |   \_ command-executor (worker_id=0 command=Kuroko2::Command::Kill)
eagletmt 16113  0.3  0.4 636584 80408 pts/2    Sl+  01:24   0:00  |   | |   \_ command-executor (worker_id=1 command=Kuroko2::Command::Shell)
eagletmt 16119  0.2  0.4 636548 79148 pts/2    Sl+  01:24   0:00  |   | |   \_ command-executor (worker_id=2 command=Kuroko2::Command::Shell)
eagletmt 16125  0.3  0.4 636552 79116 pts/2    Sl+  01:24   0:00  |   | |   \_ command-executor (worker_id=3 command=Kuroko2::Command::Shell)
eagletmt 16131  0.3  0.4 636592 79104 pts/2    Sl+  01:24   0:00  |   | |   \_ command-executor (worker_id=4 command=Kuroko2::Command::Shell)
eagletmt 16137  0.2  0.4 636380 79056 pts/2    Sl+  01:24   0:00  |   | |   \_ command-executor (worker_id=5 command=Kuroko2::Command::Monitor)
eagletmt 15989  5.8  0.4 626096 80340 pts/2    Sl+  01:24   0:01  |   | \_ ruby ./bin/rails runner Kuroko2::Servers::JobScheduler.new.run
eagletmt 15990  5.7  0.5 627704 82056 pts/2    Sl+  01:24   0:01  |   | \_ ruby ./bin/rails runner Kuroko2::Servers::WorkflowProcessor.new.run
```
Copy link
Member

@eisuke eisuke left a comment

Choose a reason for hiding this comment

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

👍

@eagletmt eagletmt merged commit 57f6ea5 into cookpad:master Jul 5, 2017
@eagletmt eagletmt deleted the executor-proctitle branch July 5, 2017 01:58
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