Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Readme updates

  • Loading branch information...
commit 7eed5aae9790e68edb3ff9d27cf144d599f1f8ae 1 parent 4c25577
Scott Taylor authored

Showing 1 changed file with 14 additions and 0 deletions. Show diff stats Hide diff stats

  1. +14 0 README.rdoc
14 README.rdoc
Source Rendered
@@ -30,6 +30,20 @@ You can also add the ability to dynamically run and log the explain of each quer
30 30
31 31 EnhancedQueryAnalyzer.explain_logging = true
32 32
  33 +== Finer grained control:
  34 +
  35 +If you'd like finer grained control over logging, provide a block to EnhancedQueryAnalyzer.log_if:
  36 +
  37 + EnhancedQueryAnalyzer.log_if { |query, time| <true | false> }
  38 +
  39 +For instance, if you'd only like to log queries over a second:
  40 +
  41 + EnhancedQueryAnalyzer.log_if { |_, time| time > 1000 }
  42 +
  43 +or only log select queries:
  44 +
  45 + EnhancedQueryAnalyzer.log_if { |query, time| query =~ /select/i }
  46 +
33 47 = Running Unit Tests
34 48
35 49 You'll need rspec and mysql. The database must be named 'query_analyzer_test'

0 comments on commit 7eed5aa

Please sign in to comment.
Something went wrong with that request. Please try again.