Process usage

long ago i recall a library the collected process usage, memory and such, in a platform independent way (at least across unices). does anyone else recall this lib?

link?

cheers.

a @ http://drawohara.com/

···

--
we can deny everything, except that we have the possibility of being better. simply reflect on that.
h.h. the 14th dalai lama

gem install sys-proctable

http://www.rubyforge.org/projects/sysutils

Works on MS Windows, too.

Regards,

Dan

···

On Sep 27, 5:42 pm, "ara.t.howard" <ara.t.how...@gmail.com> wrote:

long ago i recall a library the collected process usage, memory and
such, in a platform independent way (at least across unices). does
anyone else recall this lib?

link?

thanks a million dan!

a @ http://drawohara.com/

···

On Sep 27, 2007, at 7:03 PM, Daniel Berger wrote:

gem install sys-proctable

http://www.rubyforge.org/projects/sysutils

Works on MS Windows, too.

Regards,

Dan

--
we can deny everything, except that we have the possibility of being better. simply reflect on that.
h.h. the 14th dalai lama

irb(main):005:0> ProcTable.ps(Process.pid)
=> #<struct Struct::ProcTableStruct pid=13848, ppid=22238, pgid=13848, ruid=501, rgid=501, comm="ruby", state="run", pctcpu=0.0, cpu_num=nil, tty_num=67108877, tty_dev="ttypd", wchan="", time=0, priority=24, usr_priority=0, nice=0, cmdline="", start_time=Fri Sep 28 11:19:38 -0600 2007, max_rss=nil, ix_rss=nil, id_rss=nil, is_rss=nil, minflt=nil, maxflt=nil, nswap=nil, inblock=nil, oublock=nil, msgsnd=nil, msgrcv=nil, nsignals=nil, nvcsw=nil, nivcsw=nil, user_time=nil, system_time=nil>

nothing memory-ish looking in there is there? i'm on darwin - no rss support there?

cheers.

a @ http://drawohara.com/

···

On Sep 27, 2007, at 7:03 PM, Daniel Berger wrote:

gem install sys-proctable

http://www.rubyforge.org/projects/sysutils

Works on MS Windows, too.

Regards,

Dan

--
we can deny everything, except that we have the possibility of being better. simply reflect on that.
h.h. the 14th dalai lama

Yes, they left a bunch of that stuff out, or don't supply it via the BSD-ish interfaces they've got.

Also, some limits you set will have no effect, notably the various memory size ones.

···

On Sep 28, 2007, at 10:22 , ara.t.howard wrote:

On Sep 27, 2007, at 7:03 PM, Daniel Berger wrote:

gem install sys-proctable

http://www.rubyforge.org/projects/sysutils

Works on MS Windows, too.

irb(main):005:0> ProcTable.ps(Process.pid)
=> #<struct Struct::ProcTableStruct pid=13848, ppid=22238, pgid=13848, ruid=501, rgid=501, comm="ruby", state="run", pctcpu=0.0, cpu_num=nil, tty_num=67108877, tty_dev="ttypd", wchan="", time=0, priority=24, usr_priority=0, nice=0, cmdline="", start_time=Fri Sep 28 11:19:38 -0600 2007, max_rss=nil, ix_rss=nil, id_rss=nil, is_rss=nil, minflt=nil, maxflt=nil, nswap=nil, inblock=nil, oublock=nil, msgsnd=nil, msgrcv=nil, nsignals=nil, nvcsw=nil, nivcsw=nil, user_time=nil, system_time=nil>

nothing memory-ish looking in there is there? i'm on darwin - no rss support there?

good to know. now i'm using this, which uses the same shell over and over rather than starting a new one:

cfp:~ > cat a.rb
require 'session' # gem install session

module Process
   def self.size pid = Process.pid
     @sh = Session.new
     @sh.execute "ps wwwaux -p #{ pid }", :stdout => stdout=
     vsize, rsize = stdout.last.split(%r/\s+/)[4,2]
   end
end

p Process.size

cfp:~ > ruby a.rb
["31052", "3388"]

a @ http://drawohara.com/

···

On Sep 28, 2007, at 2:05 PM, Eric Hodel wrote:

Yes, they left a bunch of that stuff out, or don't supply it via the BSD-ish interfaces they've got.

Also, some limits you set will have no effect, notably the various memory size ones.

--
we can deny everything, except that we have the possibility of being better. simply reflect on that.
h.h. the 14th dalai lama