New maintenance release of Catalyst-Runtime.
Catalyst : Posted on Marcus Ramberg at March 15, 2007 01:36 PM
Catalyst : Posted on Marcus Ramberg at March 15, 2007 01:36 PM
Catalyst : Posted on Marcus Ramberg at March 08, 2007 12:58 PM
10:41 <@mst> marcus:
$obj->result_source
->resultset
->search($obj->ident_condition)
->update({ id => $new_id })
Catalyst : Posted by gphat at March 01, 2007 08:37 PM
Months ago I implemented DBIx::Class::Storage::Statistics with the intent of making some sort of profiling tool. I finally got off my ass and did it. DBIx::Class::QueryLog should be on CPAN this weekend.
At $work we are replacing a legacy system with one based on Catalyst. One of the deliverables for this year is a new order entry application. Since our customer service folks are used to working in a terminal based system speed is of great concern to us.
So I installed DBIx::Class::QueryLog as the debugobj as described in it’s documentation, dropped it in the stash and added some code to our wrapper.tmpl:
[% IF querylog %]
<div class="featurebox">
<h3>Query Log Report</h3>
[% SET total = querylog.time_elapsed | format('%0.6f') %]
<div>Total SQL Time: [% total | format('%0.6f') %] seconds</div>
[% SET qcount = querylog.count %]
<div>Total Queries: [% qcount %]</div>
[% IF qcount %]
<div>Avg Statement Time: [% (querylog.time_elapsed / qcount) | format('%0.6f') %] seconds.</div>
<div>
<table class="table1">
<thead>
<tr>
<th colspan="3">5 Slowest Queries</th>
</tr>
</thead>
<tbody>
<tr>
<th>Time</th>
<th>%</th>
<th>SQL</th>
</tr>
[% SET i = 0 %]
[% FOREACH q = querylog.get_sorted_queries %]
<tr class="[% IF loop.count % 2 %]odd[% END %]">
<th class="sub">[% q.time_elapsed | format('%0.6f') %]
<td>[% ((q.time_elapsed / total ) * 100 ) | format('%i') %]%</td>
<td>[% q.sql %]</td>
</th></tr>
[% IF i == 5 %]
[% LAST %]
[% END %]
[% SET i = i + 1 %]
[% END %]
</tbody>
</table>
</div>
[% END %]
</div>
[% END %]
The first run yielded this:

Well. That select from users could use an index on username, eh?

Weee! That one disappeared. What are all these role selections? We use Catalyst::Plugin::Authorization::Roles but this looks fishy. We might could use an index on the role name but there are only 6 rows in that table. A bit more investigation finds a loop in our Root controller that iterates over a set of roles calling check_user_roles() to try and find out where we should redirect the user. So lets swap that out for creating an array of roles and using grep…

Kick ass! We are down to two measly queries. We reduced the number of queries by about 75% and decreased the time spent executing SQL by about 75% as well. These queries were being executed on every page load.
UPDATE:Yeah, the average statement time was broken during that. Oops.
RubyOnRails : Posted by Robby Russell at February 26, 2007 05:01 PM
Okay, this is a little overdue… but better late than never! ;-)
We’ve had several new people start with PLANET ARGON over the past few months. Some of them are blogging about their experience of working with Ruby on Rails and being a part of our team. I wanted to quickly introduce you to a few of them and their blogs, which I hope that you consider subscribing to.
ChrisFor quite some time, we’ve been needing more design assistance, so late last year… we hired Chris Griffin, who moved here last year from Florida. He’s our new User Interface Designer and gets to work within the Rails environment everyday with the rest of us. It seems that Brian and Chris worked over the weekend to get his new blog up. Chris is self-proclaimed genius. I suggest that you keep an eye on his blog… because I’m sure it’s going to be a pretty active one. Chris joining our team marks a pivotal point in our teams evolution as we continue to place more emphasis in our Design and Development process on the User Experience.
GraemeOur newest hire is Graeme Nelson, who recently moved to Portland from Seattle. He just joined our Design and Development team and if you’ve been reading the Rails-related blogs, you might have seen his blog already. He’s been blogging a lot about using RSpec with Rails and other fun things. He’s been contracting with us since the start of the year and I’m really excited that he’s accepted a job offer and joined the team!
GaryLast… but not least is Gary Blessington. I believe that I first offered Gary a job with PLANET ARGON about 2 1/2 years ago when we were still focused on PHP/PostgreSQL…. but PHP apparently wasn’t enough of a catalyst. Gary and I previously worked together at Imark Communications several years ago, when I first started doing web development. He was the senior developer on the team and was an important mentor during my early days of developing in a professional environment. Late last year, he hung up his .NET tool belt to become our Design and Development Director. He started blogging earlier this year and is sharing his experience of switching from .NET to Ruby on Rails.
I’ll introduce the others as they start blogging and such. :-)