Re: [Tutor] CPU Utilization]

2006-01-12 Thread DS
Alan Gauld wrote: >> shell out to perform the top command, parse the results, and report >> those values to the job controller. > > > I'd use vmstat rather than top since top is intended to run > contuinuously whereas vmstat by default just returns a single line > snapshot. > > I don't know of an

Re: [Tutor] CPU Utilization

2006-01-12 Thread DS
Nico wrote: > I think that libgtop and its python binding (used in gdesklets for > example) would do the trick. > Thank you for your thoughts on that. I think in other applications this might have a shot. In this situation I am using diskless workstations with minimal configurations, so gnome li

Re: [Tutor] CPU Utilization

2006-01-12 Thread Alan Gauld
> shell out to perform the top command, parse the results, and report > those values to the job controller. I'd use vmstat rather than top since top is intended to run contuinuously whereas vmstat by default just returns a single line snapshot. I don't know of any native python mechanism for obt

Re: [Tutor] CPU Utilization

2006-01-11 Thread DS
Thanks for your responses. Michael Janssen wrote: >It's perhaps easier to read the information from the /proc filesystem >(this is where top gets it itself). "man proc" tells where the info is >stored (guess: /proc/stat). > > > stat does look in some ways easier. I will say that I found the st

Re: [Tutor] CPU Utilization

2006-01-11 Thread Hugo González Monteverde
Hi, top is very interactive so it would not be easy at all to parse. I can suggest reading /proc/loadavg if you're in Linux. proc(5) ('man 5 proc') says that /proc/loadavg is The load average numbers give the number of jobs in the run queue averaged over 1, 5 and 15 minutes. They