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

[Feature Request] Get Individual Process Info/State on CLI #271

Closed
albertilagan opened this issue Oct 25, 2024 · 5 comments
Closed

[Feature Request] Get Individual Process Info/State on CLI #271

albertilagan opened this issue Oct 25, 2024 · 5 comments
Labels
done Done, awaiting release enhancement New feature or request

Comments

@albertilagan
Copy link

Feature Request

Use Case:

Similar to how doing a curl on /processes or /process/<name> can get you details about the process, e.g IsRunning, status, it would be nice to be able to do the same thing on cli

Proposed Change:

process-compose process state
process-compose process info

Who Benefits From The Change(s)?

  1. Integrators
  2. Users doing CI test

Alternative Approaches

Alternatively as mention above you can do this by doing a curl on the existing http server, problem is I want to use --unix-socket and afaik if it's enabled http server is disabled,

@F1bonacc1
Copy link
Owner

Hi @albertilagan,

Today we have:

>process-compose process list -owide
PID     NAME         NAMESPACE   STATUS      AGE     HEALTH   RESTARTS   EXITCODE   
80414   pc_log       default     Running     2h13m   -        0          0          
80415   postgresql   default     Launching   2h13m   Ready    0          0

or

process-compose process list -ojson
[
        {
                "name": "pc_log",
                "namespace": "default",
                "status": "Running",
                "system_time": "2h13m",
                "age": 7998211577174,
                "is_ready": "-",
                "restarts": 0,
                "exit_code": 0,
                "pid": 80414,
                "is_elevated": false,
                "password_provided": false,
                "mem": 2883584,
                "cpu": 0,
                "IsRunning": true
        },
        {
                "name": "postgresql",
                "namespace": "default",
                "status": "Launching",
                "system_time": "2h13m",
                "age": 7998211618472,
                "is_ready": "Ready",
                "restarts": 0,
                "exit_code": 0,
                "pid": 80415,
                "is_elevated": false,
                "password_provided": false,
                "mem": -1,
                "cpu": -1,
                "IsRunning": true
        }
]

Are you interested in a get command? Something like:

process-compose process get pc_log -owide
PID     NAME         NAMESPACE   STATUS      AGE     HEALTH   RESTARTS   EXITCODE   
80414   pc_log       default     Running     2h13m   -        0          0          

@F1bonacc1 F1bonacc1 added enhancement New feature or request need more info labels Oct 26, 2024
@albertilagan
Copy link
Author

Hi @albertilagan,

Today we have:

>process-compose process list -owide
PID     NAME         NAMESPACE   STATUS      AGE     HEALTH   RESTARTS   EXITCODE   
80414   pc_log       default     Running     2h13m   -        0          0          
80415   postgresql   default     Launching   2h13m   Ready    0          0

or

process-compose process list -ojson
[
        {
                "name": "pc_log",
                "namespace": "default",
                "status": "Running",
                "system_time": "2h13m",
                "age": 7998211577174,
                "is_ready": "-",
                "restarts": 0,
                "exit_code": 0,
                "pid": 80414,
                "is_elevated": false,
                "password_provided": false,
                "mem": 2883584,
                "cpu": 0,
                "IsRunning": true
        },
        {
                "name": "postgresql",
                "namespace": "default",
                "status": "Launching",
                "system_time": "2h13m",
                "age": 7998211618472,
                "is_ready": "Ready",
                "restarts": 0,
                "exit_code": 0,
                "pid": 80415,
                "is_elevated": false,
                "password_provided": false,
                "mem": -1,
                "cpu": -1,
                "IsRunning": true
        }
]

Are you interested in a get command? Something like:

process-compose process get pc_log -owide
PID     NAME         NAMESPACE   STATUS      AGE     HEALTH   RESTARTS   EXITCODE   
80414   pc_log       default     Running     2h13m   -        0          0          

Hi, thanks for you reply, yes as you said would be nice to have a get subcommand for getting specific process state.

@albertilagan albertilagan changed the title [Feature Request] Get Process Info/State on CLI [Feature Request] Get Individual Process Info/State on CLI Oct 26, 2024
@F1bonacc1
Copy link
Owner

Makes sense.
Will add it to the next release.

@F1bonacc1 F1bonacc1 added the done Done, awaiting release label Oct 26, 2024
@shivaraj-bh
Copy link
Contributor

Alternatively as mention above you can do this by doing a curl on the existing http server, problem is I want to use --unix-socket and afaik if it's enabled http server is disabled,

You can still use curl on a unix socket, like curl --unix-socket <path> http://localhost/process/<process-name>, only that the http://localhost is dummy and can be anything, its only purpose is to tell curl that it is a HTTP request.

Anyways, would be nice to have a CLI command too.

@F1bonacc1
Copy link
Owner

Added in v1.40.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done Done, awaiting release enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants