{"id":803,"date":"2010-02-16T16:18:29","date_gmt":"2010-02-16T18:18:29","guid":{"rendered":"http:\/\/blog.plataformatec.com.br\/?p=803"},"modified":"2010-02-16T16:19:12","modified_gmt":"2010-02-16T18:19:12","slug":"rails-metrics-know-what-is-happening-inside-your-rails-3-application","status":"publish","type":"post","link":"https:\/\/blog.plataformatec.com.br\/2010\/02\/rails-metrics-know-what-is-happening-inside-your-rails-3-application\/","title":{"rendered":"Rails Metrics: know what is happening inside your Rails 3 application"},"content":{"rendered":"

RailsMetrics<\/a> 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.<\/p>\n

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

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:<\/p>\n

<\/object><\/p>\n

Rails Metrics Screencast – Feb\/2010<\/a> from PlataformaTec<\/a> on Vimeo<\/a>.<\/p>\n<\/div>\n

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

In case you are interested here are some screenshots that I tweeted<\/a> earlier: http:\/\/twitpic.com\/13e7fn\/full<\/a> and http:\/\/twitpic.com\/13e7h2\/full<\/a>.<\/p>\n

The javascript novell<\/h3>\n

A week ago I asked<\/a> what people uses to create charts in Rails so I could evaluate what would be the best library to use in RailsMetrics<\/a>. 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.<\/p>\n

After some research I ended up with three libraries: g.raphael<\/a>, flot<\/a> and jqplot<\/a>.<\/p>\n

For RailsMetrics<\/a>, I chose to use g.raphael<\/a> 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).<\/p>\n

I’m waiting for your pull requests, enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"

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 … \u00bb<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[1],"tags":[78,67,77,75,76,7],"aioseo_notices":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/posts\/803"}],"collection":[{"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/comments?post=803"}],"version-history":[{"count":12,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/posts\/803\/revisions"}],"predecessor-version":[{"id":816,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/posts\/803\/revisions\/816"}],"wp:attachment":[{"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/media?parent=803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/categories?post=803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/tags?post=803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}