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

Don't process command outputs for system knowledge #2

Open
h6w opened this issue May 11, 2016 · 0 comments · May be fixed by #3
Open

Don't process command outputs for system knowledge #2

h6w opened this issue May 11, 2016 · 0 comments · May be fixed by #3

Comments

@h6w
Copy link

h6w commented May 11, 2016

top output can be quite unpredictable.

e.g. on Alpine Linux there is no "-i" switch.

Furthermore, the output is different on each system and version so processing the output can result in unexpected crashes.

e.g. Without the "-i" switch, on my Ubuntu box:
$ top -b -n 1
top - 13:06:51 up 43 days, 4:32, 17 users, load average: 0.52, 0.58, 0.87
Tasks: 290 total, 1 running, 287 sleeping, 0 stopped, 2 zombie
%Cpu(s): 8.5 us, 1.7 sy, 0.0 ni, 89.3 id, 0.4 wa, 0.0 hi, 0.0 si, 0.0 st

On Alpine Linux:

top -b -n 1

Mem: 2015520K used, 32164K free, 14400K shrd, 123468K buff, 452536K cached
CPU: 0% usr 0% sys 0% nic 100% idle 0% io 0% irq 0% sirq
Load average: 0.16 0.28 0.31 3/380 442

I don't think we should be using top output to get these values.

@h6w h6w linked a pull request May 12, 2016 that will close this issue
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 a pull request may close this issue.

1 participant