Measuring it up

There are different ways to start your application out right. Some work on TDD methods, some equip their teams with good QAs, the others rely on extremely efficient project management and strong system administration. But the building of a good rails application does not only depend on code alone and its processes.

In my experience and opinion, building an application entails the following:

  • Assemble a competent team of developers
  • Designate a product manager that is separate from the developers
  • Practice creation of product specs
  • Develop a good process of development cycle (scrum, etc). Good scheduling is the key
  • Improve the skillset of developers in testing
  • Train QA for better testing and use of good tools (selenium, etc)
  • Develop good infra tasks (cron, deploy, restart)
  • Prepare for contingencies
  • Measure performance continuously and assess

All these steps/processes have already been defined by different teams in different permutations and sequence. All of these have been defined by a predefined set of rules/agreement depending on the product type and the team involved. For rails, since applications built on rails are relatively young compared to the mature Java and the rampant PHP, some of the set of rules and practices for each item involved is still being discovered one by one.

For measuring Rails performance, there has been a handful of ideal ways. Some of them are:

Although we’ve pretty much made do with some of these things, but the one that I really like the most is Rubyrun gem. Usually, after some profiling, performance measuring etc, the hardest part is conveying the analysis of the results. But what I really love is that I can get the results without giving so much effort. I can immediately pinpoint some of the stuffs that I needed to see.

RubyRun is a gem that is very simple to install. You can download the gem from Rubysophic site, or simply a gem install in your console. You have the option to turn it on or off depending on your call to start your server. Run your application with RubyRun profiling on by:

1
2
    cd your-rails-app
    ruby -rubyrun script/server

I took a sample application for a test drive using RubyRun gem. This application is a big one, but it was running on my localhost alone therefore, there were limited requests. I was doing some random usage of the application according to the expected usage of an end user on a social networking site. After considerable amount of time, found below are snapshots of the beautiful outputs of RubyRun.

I got the following results:

  • http://coderkitty.sweetperceptions.com/assets/2008/11/15/throughput.jpeg
  • http://coderkitty.sweetperceptions.com/assets/2008/11/15/slowest_requests.jpeg
  • http://coderkitty.sweetperceptions.com/assets/2008/11/15/perf_breakdown.jpeg

The measurements were tantamount to what I have experienced. Best of it all, I don’t have to work on the reports themselves. The data were right in my face and ready for analysis. I can quickly work on straigthening out some code or refactoring the slow ones. smile I really love it.

Go ahead and try it out! This is really cool. Go pull your admin’s leg for once and give them the reports afterwards. wink

Recommend me on Working With Rails

If you found this post of any use, then please take the time to recommend me on Working with Rails.

Leave a Reply

Hi, I've been busy you know. wink If you don't know yet, this site and my blog codes are hosted in . I recently moved to Git and found that they have support for private Git repositories. Below are details of my last git push.

Maricris S. Nonato on 14 Feb
Commit: 48fe3652ffb644af13f4a5651f9d80474b09f622

Adding new ad image for Pledgie campaign - campaign image for coderkitty fundraising
  • while creating mockups, i even find myself thinking in partials.. hmm.. too much ROR 2010-03-11
  • RT @paulocoelho: 11/03 - Close the door,change the record,clean the house. Stop being who you were, become who you are. 2010-03-11
  • RT @makieduardo: "Keep me safe, O God... for in you I take refuge." (Psalm 16:1) 2010-03-11
  • @packetlog Philosophies of India? That wasn't in my list, but if you think its worth the read, then why not?! smile 2010-03-11
  • i'm on a voyage to read over 1101 books! smile 2010-03-10
  • @nightdreamer vampires? lol. i don't even like them as much as a commoner.. wink whoops! not to pull on any string there! tongue 2010-03-10
  • why is it that i find myself attracted more to classic novels?? 2010-03-10
  • @codinghorror lol. i'd love to see that happen tongue 2010-03-10
  • @gregmoreno had a look at that a long time ago. isn't it expensive though? or is it worth it? 2010-03-10
  • it took 3 yrs for Kindle to be introduced globally.. i wonder how long i have to wait for Nook sad 2010-03-09
  • Kill the zombie browser!!! 'Funeral' held for aging Web browser - CNN.com http://bit.ly/brlGYF.. 2010-03-08
  • @holtaway http://twitpic.com/17cws.. - adorable!!! 2010-03-08
  • http://twitpic.com/17cwo.. - Its hard to work when this is your setup.. 2010-03-08
  • tea + ambient music. puts my soul at ease 2010-03-08
  • 15 Quality Web-Based Applications to Create Mock-Ups and Wireframes | Spyre Studios http://bit.ly/azTHis.. 2010-03-07
  • 10 Completely Free Wireframe and Mockup Applications - Speckyboy Design Magazine http://bit.ly/9xhgFw.. 2010-03-07