<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -31,11 +31,11 @@ module RequestLogAnalyzer::FileFormat
     RU = Proc.new { |request| &quot;#{request[:user]}&quot; }
 
     report do |analyze|
-      analyze.frequency :user, :title =&gt; &quot;Top 20 of users with most queries&quot;, :amount =&gt; 20
-      analyze.duration :query_time, :category =&gt; RU, :title =&gt; 'Total query duration per user'
-      analyze.duration :query_time, :category =&gt; RQ, :title =&gt; 'Top 50 queries by duration', :amount =&gt; 50
-      analyze.count :query, :category =&gt; RQ, :title =&gt; &quot;Top queries by total rows examined&quot;, :amount =&gt; 20
-      analyze.count :rows_sent, :category =&gt; RQ, :title =&gt; &quot;Top queries by rows sent&quot;, :amount =&gt; 20
+      analyze.frequency :user, :title =&gt; &quot;Users with most queries&quot;, :amount =&gt; 20
+      analyze.duration :query_time, :category =&gt; RU, :title =&gt; 'Query time per user'
+      analyze.duration :query_time, :category =&gt; RQ, :title =&gt; 'Query time', :amount =&gt; 50
+      analyze.count :category =&gt; RQ, :title =&gt; &quot;Rows examined&quot;, :amount =&gt; 20, :field =&gt; :rows_examined
+      analyze.count :category =&gt; RQ, :title =&gt; &quot;Rows sent&quot;, :amount =&gt; 20, :field =&gt; :rows_sent
     end
   
     class Request &lt; RequestLogAnalyzer::Request</diff>
      <filename>lib/request_log_analyzer/file_format/mysql.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,9 +7,9 @@ module RequestLogAnalyzer::Tracker
 
     def prepare
       raise &quot;No categorizer set up for category tracker #{self.inspect}&quot; unless options[:category]
+      raise &quot;No field to count has been set up #{self.inspect}&quot; unless options[:field]
       @categorizer = create_lambda(options[:category])
       @categories   = {}
-      
     end
 
     # Return the methods sorted by count
@@ -20,34 +20,39 @@ module RequestLogAnalyzer::Tracker
     # Get the duration information fron the request and store it in the different categories.
     # &lt;tt&gt;request&lt;/tt&gt; The request.
     def update(request)
-      return if request[options[:category]] == 0 || request[options[:category]].nil?
+      return if request[options[:field]] == 0 || request[options[:field]].nil?
 
       cat = @categorizer.call(request)
       if cat
         @categories[cat] ||= 0
-        @categories[cat] += request[options[:category]].to_i
+        @categories[cat] += request[options[:field]].to_i
       end
     end
 
     def report(output)
-      output.title(options[:title]) if options[:title]
-
       if @categories.empty?
         output &lt;&lt; &quot;None found.\n&quot;
       else
+        output.title('')
         sorted_categories = output.slice_results(sorted_by_count)
         
-        output.table({:title =&gt; &quot;Category&quot;, :align =&gt; :right}, {:align =&gt; :right, :title =&gt; &quot;Rows&quot;}) do |rows|
+        output.table( {:title =&gt; title, :align =&gt; :left,  :width =&gt; :rest },
+                      {:title =&gt; &quot;Count&quot;,         :align =&gt; :right, :width =&gt; 15    }) do |rows|
           sorted_categories.each do |(cat, count)|
-            rows &lt;&lt; [cat, count]
+            rows &lt;&lt; [cat, format_number(count)]
           end
         end
       end
     end
+    
+    # Format an int to a nice string with decimal seperation.
+    def format_number(number)
+      number.to_s.gsub(/(\d)(?=(\d\d\d)+(?!\d))/, &quot;\\1,&quot;)
+    end
 
     # Returns the title of this tracker for reports
     def title
-      options[:title]  || 'Count'
+      options[:title]  || 'Category'
     end
 
     # Returns all the categories and the tracked duration as a hash than can be exported to YAML</diff>
      <filename>lib/request_log_analyzer/tracker/count.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>aa1e2686d6f969453ed99a4420e62f8263bbca47</id>
    </parent>
  </parents>
  <author>
    <name>Bart ten Brinke</name>
    <email>info@retrosync.com</email>
  </author>
  <url>http://github.com/wvanbergen/request-log-analyzer/commit/59a3ddfc3a44cfd534e5f0d26f99c5d5ace85517</url>
  <id>59a3ddfc3a44cfd534e5f0d26f99c5d5ace85517</id>
  <committed-date>2009-11-12T14:13:00-08:00</committed-date>
  <authored-date>2009-11-12T14:13:00-08:00</authored-date>
  <message>Fixed categorization of mysql queries</message>
  <tree>9f360f9037e7d0a72bb773a1718b5fa81def9fcf</tree>
  <committer>
    <name>Bart ten Brinke</name>
    <email>info@retrosync.com</email>
  </committer>
</commit>
