Forum: Ruby on Rails gauge

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
cole.jeff (Guest)
on 2005-11-26 17:26
(Received via mailing list)
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
znmeb (Guest)
on 2005-11-26 23:57
(Received via mailing list)
I'd recommend one of the packages built on "rrdtool". The home page is

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/

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
>

--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com
Mario S. (Guest)
on 2009-08-28 18:42
(Received via mailing list)
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>
This topic is locked and can not be replied to.