-
Notifications
You must be signed in to change notification settings - Fork 20
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
Changing ps() output format #71
Comments
But it already does that, no? It returns a data frame / tibble with all the processes.
You can write a function that formats the output differently.
In R it is pretty easy to select some columns of a data frame, that's why it is up to the end user to do it. This said, I am open to adding a different print method, that is more similar to a regular
ps does not calculate
Yeah, unfortunately, I don't think the approach of calling the external |
In the Linux terminal version of ps you can really specify the metrics you want, in the order you want. I think this feature would deserve an additionnal function on its own for allowing a user to give as a string using similar output codes as in a classic ps command, the metrics he wants and in which order he wants it.
The way I designed my function ps.to.df(), it just does internally a system() of the classic ps command.
Yes this approach would be limitated to UNIX system, but I think most of them have ps. In Windows the equivalent would be tasklist I guess. I saw that one of the function from your package is called ps_cmdline(). |
Right, I think that's the R way to do it. We can still allow customization, though.
That's fine for your script, but it is not for a tool like the ps R package, which is expected to work on macOS and Windows as well, at the very least. It should also work if the Your script already fails on macOS, because
I think you missed what
The ps R package does not use the |
Yes you are right. I wasn't even aware that MacOs was using ps honnestly. Then I guess another approach wouldn't fit your package expectations. One should just provide a way to do it in Linux only.
Thank you for your time and your answer, that's really nice of you. |
Yes, as I said, please open other issues. Thanks. |
Hi,
I was wondering how one could change the output format when using the ps() function to generate the table of processes ? when using ps command in a classic terminal you have an option to format the output, displaying the metrics you are interested in.
In my own specific case what I would be interested in would be to be able to have in ps() table the %CPU and also the ELAPSED TIME metrics for all processes.
I already made a function able to retrieve these metrics ( https://github.com/mathosi/cluster_check ), but since a dedicated package already exist I was wondering if it would be possible to have this feature here.
Thank you in advance for your help.
Best,
The text was updated successfully, but these errors were encountered: