<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -10,7 +10,7 @@ class RailsRequests &lt; Scout::Plugin
   
   def build_report
     patch_elif
-    
+
     log_path = option(:log)
     unless log_path and not log_path.empty?
       @file_found = false
@@ -18,6 +18,17 @@ class RailsRequests &lt; Scout::Plugin
     end
     max_length = option(:max_request_length).to_f
 
+    # process the ignored_actions option -- this is a regex provided by users; matching URIs don't get counted as slow
+    ignored_actions=nil
+    if option(:ignored_actions) &amp;&amp; option(:ignored_actions).strip != ''
+      begin
+        ignored_actions = Regexp.new(option(:ignored_actions))
+        puts ignored_actions.inspect
+      rescue
+        error(&quot;Argument error&quot;,&quot;Could not understand the regular expression for excluding slow actions: #{option(:ignored_actions)}. #{$!.message}&quot;)
+      end
+    end
+
     report_data        = { :slow_request_rate     =&gt; 0,
                            :request_rate          =&gt; 0,
                            :average_request_length =&gt; nil }
@@ -44,9 +55,12 @@ class RailsRequests &lt; Scout::Plugin
           request_count += 1
           total_request_time          += last_completed.first.to_f
           if max_length &gt; 0 and last_completed.first &gt; max_length
-            slow_request_count += 1
-            slow_requests                    += &quot;#{last_completed.last}\n&quot;
-            slow_requests                    += &quot;#{last_completed[1]}\n\n&quot;
+            # only test for ignored_actions if we actually have an ignored_actions regex
+            if ignored_actions.nil? || (ignored_actions.is_a?(Regexp) &amp;&amp; !ignored_actions.match(last_completed.last))
+              slow_request_count += 1
+              slow_requests                    += &quot;#{last_completed.last}\n&quot;
+              slow_requests                    += &quot;#{last_completed[1]}\n\n&quot;
+            end
           end
         end # request should be analyzed
       end</diff>
      <filename>rails_requests/rails_requests.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,12 +4,16 @@ options:
     notes: &quot;The full path to the Ruby on Rails log file you wish to analyze (ex: /var/www/apps/APP_NAME/current/log/production.log).&quot;
   max_request_length:
     name: Max Request Length (sec)
-    notes: If any request length is larger than this amount, an alert is generated
+    notes: If any request length is larger than this amount, an alert is generated (see Advanced for more options)
     default: 3
   rla_run_time:
     name: Request Log Analyzer Run Time (HH:MM)
     notes: It's best to schedule these summaries about fifteen minutes before any logrotate cron job you have set would kick in.
     default: '23:45'
+  ignored_actions:
+    name: Ignored Actions
+    notes: Takes a regex. Any URIs matching this regex will NOT count as slow requests, and you will NOT be notified if they exceed Max Request Length. Matching actions will still be included in daily summaries.
+    advanced: true
 
 metadata:
   request_rate:</diff>
      <filename>rails_requests/rails_requests.yml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>656ca351a9931d5252f8aa8624084801ef14dcac</id>
    </parent>
  </parents>
  <author>
    <name>Andre Lewis</name>
    <email>andre@highgroove.com</email>
  </author>
  <url>http://github.com/highgroove/scout-plugins/commit/e475aa762c5897de65d8277b41f5fd8408c3bdd0</url>
  <id>e475aa762c5897de65d8277b41f5fd8408c3bdd0</id>
  <committed-date>2009-10-27T10:52:19-07:00</committed-date>
  <authored-date>2009-10-27T10:52:19-07:00</authored-date>
  <message>ignore actions matching a regex you provide in options</message>
  <tree>5b9ab1c285c1608346c855c9732c9f47ac46852b</tree>
  <committer>
    <name>Andre Lewis</name>
    <email>andre@highgroove.com</email>
  </committer>
</commit>
