Permalink
Browse files

Readme updates

  • Loading branch information...
1 parent 4c25577 commit 7eed5aae9790e68edb3ff9d27cf144d599f1f8ae @smtlaissezfaire committed Dec 29, 2009
Showing with 14 additions and 0 deletions.
  1. +14 −0 README.rdoc
View
14 README.rdoc
@@ -30,6 +30,20 @@ You can also add the ability to dynamically run and log the explain of each quer
EnhancedQueryAnalyzer.explain_logging = true
+== Finer grained control:
+
+If you'd like finer grained control over logging, provide a block to EnhancedQueryAnalyzer.log_if:
+
+ EnhancedQueryAnalyzer.log_if { |query, time| <true | false> }
+
+For instance, if you'd only like to log queries over a second:
+
+ EnhancedQueryAnalyzer.log_if { |_, time| time > 1000 }
+
+or only log select queries:
+
+ EnhancedQueryAnalyzer.log_if { |query, time| query =~ /select/i }
+
= Running Unit Tests
You'll need rspec and mysql. The database must be named 'query_analyzer_test'

0 comments on commit 7eed5aa

Please sign in to comment.