RailsMetrics is a new Rails engine which stores everything that is happening inside your application in the database, so you can profile each request, besides creating charts, statistics and extract useful information.

I’ve been working on it for the last couple months in parallel with ActiveSupport::Notifications, which is the foundation for RailsMetrics, and it was open sourced today by Engine Yard!

It was a challenging project due to its threaded nature and I will share a couple things I learned during the process in this blog later. For now, you can watch the screencast below to see what it does and how to install it:

Rails Metrics Screencast – Feb/2010 from PlataformaTec on Vimeo.

As said in the video, getting it released is just the first step and now it’s your turn to fork and improve it by providing a better layout, creating new reports, charts, etc!

In case you are interested here are some screenshots that I tweeted earlier: http://twitpic.com/13e7fn/full and http://twitpic.com/13e7h2/full.

The javascript novell

A week ago I asked what people uses to create charts in Rails so I could evaluate what would be the best library to use in RailsMetrics. There were three types of libraries: server side ones, flash and javascript. Since I don’t want to depend on having neither RMagick nor Flash installed on the developer machine, I chose the javascript kind.

After some research I ended up with three libraries: g.raphael, flot and jqplot.

For RailsMetrics, I chose to use g.raphael since I can easily manipulate the objects it creates and it is the one which looks better (at least imho ;)). However it has poor documentation and the default charts have poor customization options compared to the other two libraries, so you end up tweaking the chart by hand (which was fine in my experience).

I’m waiting for your pull requests, enjoy!

Tags: , , , , ,

This entry was posted on Tuesday, February 16th, 2010 at 4:18 pm and is filed under English. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

  • http://maraby.org/ Matt Todd

    I had my volume up to 100% and the video volume up to 100% and I couldn’t hear a single word that was said :(

  • http://maraby.org/ Matt Todd

    I had my volume up to 100% and the video volume up to 100% and I couldn’t hear a single word that was said :(

  • José Valim

    This is odd, I just tried here and I could hear nicely with the volume around 70%. :(

  • José Valim

    This is odd, I just tried here and I could hear nicely with the volume around 70%. :(

  • http://blin.cz Boblin

    Hi Jose,
    Rails Metrics looks promising. Thank’s for sharing.

    BTW Video volume is OK.

  • http://blin.cz Boblin

    Hi Jose,
    Rails Metrics looks promising. Thank’s for sharing.

    BTW Video volume is OK.

  • José Valim

    Awesome Boblin! Thanks for the feedback! :)

  • José Valim

    Awesome Boblin! Thanks for the feedback! :)

  • http://github.com/grimen grimen

    Nice, is this the same as “instrumentation” that’ve seen around in commits here and there?

    P.S. Nothing wrong with the sound.

  • http://github.com/grimen grimen

    Nice, is this the same as “instrumentation” that’ve seen around in commits here and there?

    P.S. Nothing wrong with the sound.

  • José Valim

    @grimen, yes, it’s!

    While we use “ActiveSupport::Notifications.subscribe” to consume notifications, we publish them this way:

    ActiveSupport::Notifications.instrument “my_gem.something_expensive” do
    # something expensive
    end

    Glad to know the sound works. :)

  • José Valim

    @grimen, yes, it’s!

    While we use “ActiveSupport::Notifications.subscribe” to consume notifications, we publish them this way:

    ActiveSupport::Notifications.instrument “my_gem.something_expensive” do
    # something expensive
    end

    Glad to know the sound works. :)

  • Jonathan Hicks

    Highcharts is a pretty good JS lib. Although, the licensing may not be to your liking.

    http://highcharts.com/

  • Jonathan Hicks

    Highcharts is a pretty good JS lib. Although, the licensing may not be to your liking.

    http://highcharts.com/

  • José Valim

    Yup! I took a look to highcharts and couldn’t choose it due to the licensing.

  • José Valim

    Yup! I took a look to highcharts and couldn’t choose it due to the licensing.

  • http://plentz.org Diego Plentz

    Same problem with sound here. I think that the problem happens because of my ~3 years old macbook pro :(

  • http://plentz.org Diego Plentz

    Same problem with sound here. I think that the problem happens because of my ~3 years old macbook pro :(