Running ruby scripts from rails

First, I am new to rails.
I have written a Ruby script to test some perf issues in socket calls.
The Ruby code spins up some server threads listening on localhost, and
then starts a client on the main thread, and measures the performance.
(note, this is on Windows).

My primary goal is to get this perf data into a nice format, and
secondary goal is to:

  • execute the scripts from a rails application
  • feeding it parameters
  • getting feedback while executing (it takes minutes to
  • report the perf numbers back to a page

So, because the servers report info, and they are on separate threads,
I thought I would use a DB to dump the data into (instead of dealing
with synchronization and merging issues of passing data between

My script currently prints info to STDOUT as it progresses. I am not
sure the best way to approach feedback to the rails app here. As well,
I would like to be able to cancel the script as well.

So, my questions are:

  1. What are some ways I can run this ruby script and get real time
    feedback from it, updating a webpage with that info. I am not looking
    for “use ajax” but maybe some specific examples out there that do
    things like this.

  2. And how would I go about canceling it.

Pointers to sites/examples with code would be great. Or even pointers
to keywords to search for would be helpful.

Thanks for your help.