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

Fetching Top Five Process ID's #3

Open
kgrvamsi opened this issue Jul 15, 2015 · 0 comments
Open

Fetching Top Five Process ID's #3

kgrvamsi opened this issue Jul 15, 2015 · 0 comments

Comments

@kgrvamsi
Copy link

Hi @mitchellh ,

Thanks for such a nice Library.Before this plugin i was trying for the following approaches.

1)Calling the C code which does the Command based logic in getting the top process.
2)Execute a os command and fetch the values and iterate them

Here is the sample output for 5 top process running on my pc
vagrant@vagrant-ubuntu-trusty-64:~/$ ps aux | awk '{print $2, $4, $11}' | sort -k2rn | head -n 5|awk '{print $1}'
1812
1847
925
2232
2286

Is there a possibility that i can do this through the library.I see there are two important functions available where one gets all the porcess pid's running on the machine and the other gets the information of a specific PID.

I was thinking if there is a way or a logic if i can get the top five process running from the library as a function.

Thanks again for the library
Vamsi KGR

daftaupe pushed a commit to daftaupe/go-ps that referenced this issue Jan 5, 2018
This is so we can get parent pid and processes that have been deleted while
running (on darwin).

Also,
- Test ps from exec process
- Support path on linux
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

No branches or pull requests

1 participant