# Gauge

**URL:** <https://www.ruby-forum.com/t/gauge/69052>\
**Category:** Rails\
**Created:** [November 26, 2005, 4:26pm UTC](https://www.ruby-forum.com/t/gauge/69052 "2005-11-26T16:26:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cole.jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/8e7dd6/32.png) [@cole.jeff](https://www.ruby-forum.com/u/cole.jeff)\
**Post date:** [November 26, 2005, 4:26pm UTC](https://www.ruby-forum.com/t/gauge/69052/1 "2005-11-26T16:26:06Z")

</div>

I would love to have some performance monitoring for my production  
site. Does anyone know what the status of gauge is? I’ve  
downloaded the subversion repository for it. Is it possible to  
somehow deploy it in whatever state it is in?

thanks,  
Jeff

---

<div class="post-metadata">

**Author:** ![cole.jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/8e7dd6/32.png) [@cole.jeff](https://www.ruby-forum.com/u/cole.jeff)\
**Post date:** [November 26, 2005, 10:57pm UTC](https://www.ruby-forum.com/t/gauge/69052/2 "2005-11-26T22:57:35Z")

</div>

I’d recommend one of the packages built on “rrdtool”. The home page is

[http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/](http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/)

There’s a pretty good front end called Cacti, written in PHP (I think it  
also uses Apache and MySql, so you might not be running the right web  
server and DBMS):

[http://www.cacti.net/](http://www.cacti.net/)

I think Cacti could easily be ported to Ruby and integrated with Rails  
but I haven’t taken a look at what’s involved. I don’t speak PHP so  
someone else would have a better shot at it.

There is a small utility called “ruby-rrd” that is supposed to provide  
Ruby bindings for rrdtool, but it doesn’t work with the latest rrdtool  
release.

Jeff C. wrote:

> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
M. Edward (Ed) Borasky

> **[世界杯竞猜彩票-世界杯官网竞猜（集团）有限公司](http://www.linuxcapacityplanning.com/)**
>
> 世界杯竞猜彩票一直以来遵守商业道德，世界杯官网竞猜坚持诚信为本，保证诚实经营。世界杯竞猜彩票先后成为安徽省电子商务协会理事单位、安徽省网商协会会员单位、合肥市电子商务协会理事单位、合肥市服务外包行业协会会员单位、安徽省云计算产业促进会会员单位。世界杯官网竞猜一直保持良好的技术及服务态度，更好地为客户服务。

---

<div class="post-metadata">

**Author:** ![cole.jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/8e7dd6/32.png) [@cole.jeff](https://www.ruby-forum.com/u/cole.jeff)\
**Post date:** [August 28, 2009, 4:42pm UTC](https://www.ruby-forum.com/t/gauge/69052/3 "2009-08-28T16:42:40Z")

</div>

Bonjour SÃ©bastien,

Il ya une faÃ§on pour vous dans lequel exÃ©cuter plusieurs tÃ¢ches en  
arriÃ¨re-plan que vous affichez une jauge qui affiche la progression de  
la  
prÃ©sente. On a parlÃ© Ã quelques reprises sur la liste de diffusion, et  
j’ai  
Ã©galement crÃ©Ã© une page wiki pour elle, si elle existe encore.

Si vous utilisez Ruby 1.9.x, puis utiliser Ruby’s Native OS Threads,  
dans  
lequel crÃ©er un thread, qui fera de votre traitement, et au-dessus du  
signal  
vers le thread principal du programme, les progrÃ¨s rÃ©alisÃ©s. EG: Pour  
chaque  
itÃ©ration du fil, le rendement simplement un rÃ©sultat au thread  
principal,  
car c’est de ramasser lorsque votre thread a couru c’est itÃ©ration  
courante.

Tous les Ã©vÃ©nements GUI sont si limitÃ©s pour le thread principal du  
programme. En d’autres termes, vous ne pouvez pas faire de mises Ã jour  
un  
composant graphique Ã partir d’un 1.9.x Ruby thread (EG: set\_scroll\_pos  
Calling, set\_text, etc, etc)

Si vous utilisez Ruby 1.8.x ligne d’interprÃ¨te, il vous sera nÃ©cessaire  
de  
crÃ©er un Ã©vÃ©nement Timer qui dÃ©clenche tout montant x de secondes, ce  
qui ne  
la simple tÃ¢che de faire appel Thread.pass. En d’autres termes, vous  
utilisez encore des fils vert de Ruby en 1.8, mais d’assurer que le  
traitement du thread principal et les Ã©vÃ©nements interface graphique qui  
se  
produisent dans le thread principal obtenir traitÃ©es, d’une minuterie  
doit  
Ãªtre exÃ©cutÃ© pour permettre Thread.pass de se produire.

Quelque chose comme cela devrait Ãªtre utilisÃ© en Ruby 1.8.x seulement,  
comme  
Ruby 1.9 utilise les threads natifs, et travaille beaucoup mieux:

Timer.every (55) ne  
Thread.pass  
fin

evt\_click (MY\_EXECUTE\_BUTTON) ne  
Thread.new ne  
# Ne vos tÃ¢ches ici.  
# AprÃ¨s l’ensemble de vos tÃ¢ches sont accomplies, ajoutez ceci:  
Thread.pass # contrÃ´le Pass Ã fil d’attente pour la prochaine fois,  
ou  
retourner Ã la thread principal.  
fin  
fin

hth,

Mario

* * *

Hello Sebastien,

There is a way for you in which to run multiple tasks in the background  
as  
you are displaying a guage in which to show the progress of this. It  
has  
been talked about a few times on the Mailing list, and I’ve also created  
a  
wiki page for it, if it still exists.

If you use Ruby 1.9.x, then utilize Ruby’s Native OS Threads, in which  
to  
create a thread, that will do your processing, and signal upwards to the  
main program thread, the progress. EG: for each iteration of the  
Thread,  
simply yield a result to the main thread, for it to pick up when your  
thread  
has ran it’s current iteration.

All GUI events are limited though to the Main thread of the program. In  
other words, you can’t do any updates to a GUI component from within a  
Ruby  
1.9.x thread (EG: Calling set\_scroll\_pos, set\_text, etc, etc.)

If you are using Ruby 1.8.x line of interpreter, then you will need to  
create a Timer event that triggers every x amount of seconds which does  
the  
simple task of calling Thread.pass. In other words, you still use  
Ruby’s  
Green Threads in 1.8, but to ensure that processing of the main thread  
and  
GUI events that occur in the main thread get processed, a Timer needs to  
be  
executed to allow Thread.pass to occur.

Something like this should be used in Ruby 1.8.x only, as Ruby 1.9 uses  
native threads, and works a lot better:

Timer.every(55) do  
Thread.pass  
end

evt\_click(MY\_EXECUTE\_BUTTON) do  
Thread.new do  
# Do your tasks here.  
# After all of your tasks are done, add this:  
Thread.pass # Pass control to next thread waiting for time, or back  
to  
the main thread.  
end  
end

hth,

Mario

2009/8/13 sebastien [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
