Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Readme updates

  • Loading branch information...
commit 7eed5aae9790e68edb3ff9d27cf144d599f1f8ae 1 parent 4c25577
Scott Taylor authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 README.rdoc
14 README.rdoc
View
@@ -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'
Please sign in to comment.
Something went wrong with that request. Please try again.