[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

process usage

ara.t.howard

9/27/2007 11:43:00 PM


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://draw...
--
we can deny everything, except that we have the possibility of being
better. simply reflect on that.
h.h. the 14th dalai lama




5 Answers

Daniel Berger

9/28/2007 1:03:00 AM

0

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?

gem install sys-proctable

http://www.rubyforge.org/project...

Works on MS Windows, too.

Regards,

Dan


ara.t.howard

9/28/2007 5:12:00 PM

0


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

>
> gem install sys-proctable
>
> http://www.rubyforge.org/project...
>
> Works on MS Windows, too.
>
> Regards,
>
> Dan

thanks a million dan!

a @ http://draw...
--
we can deny everything, except that we have the possibility of being
better. simply reflect on that.
h.h. the 14th dalai lama




ara.t.howard

9/28/2007 5:22:00 PM

0


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

>
> gem install sys-proctable
>
> http://www.rubyforge.org/project...
>
> Works on MS Windows, too.
>
> Regards,
>
> Dan
>
>

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://draw...
--
we can deny everything, except that we have the possibility of being
better. simply reflect on that.
h.h. the 14th dalai lama




Eric Hodel

9/28/2007 8:06:00 PM

0

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/project...
>>
>> 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?

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.

ara.t.howard

9/28/2007 9:11:00 PM

0


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.

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://draw...
--
we can deny everything, except that we have the possibility of being
better. simply reflect on that.
h.h. the 14th dalai lama