[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

checking server load from ruby?

d c

2/20/2007 10:11:00 AM

hi -

are there any ruby library functions for checking server load and
general system status?
or should i just use something like `uptime` ?

tx!

/dc
-------------------------------------------
David "DC" Collier
mailto:dc@pikkle.com
+81 (0)80 6521 9559
skype: callto://d3ntaku
-------------------------------------------
Pikkle ????
http://www....
-------------------------------------------

3 Answers

Alexandru E. Ungur

2/20/2007 10:28:00 AM

0

>>> sender: "dc" date: "Tue, Feb 20, 2007 at 07:11:19PM +0900" <<<EOQ
> hi -
Hello,

> are there any ruby library functions for checking server load and
> general system status?
> or should i just use something like `uptime` ?
I for one just use this:
~>> irb
>> File.new('/proc/loadavg').read
=> "0.57 0.47 0.35 1/197 1862\n"

but a quick gem search reveals a gem that might be related to this:
~>> gem search -r uptime

*** REMOTE GEMS ***

sys-uptime (0.4.5, 0.4.4)
A Ruby interface for getting system uptime information.


Cheers,
Alex

M. Edward (Ed) Borasky

2/21/2007 3:43:00 AM

0

dc wrote:
> hi -
>
> are there any ruby library functions for checking server load and
> general system status?
> or should i just use something like `uptime` ?
It depends on whether you want to lock yourself into a specific OS or
not. Just out of curiosity, what's your goal here? What will you
application *do* with the information?

--
M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)
http://borasky-research.blo...

If God had meant for carrots to be eaten cooked, He would have given rabbits fire.


Zev Blut

2/21/2007 3:52:00 AM

0

Hi David,

On Tue, 20 Feb 2007 19:11:19 +0900, dc <lister@pikkle.com> wrote:

> are there any ruby library functions for checking server load and
> general system status?
> or should i just use something like `uptime` ?

Well calling `uptime` will certainly work and maybe the most simple.
Although, if you are looking for an API that abstracts this a bit,
take a look at Daniel Berger's sysutils projects at:

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

Cheers,
Zev