Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add EnhancedQueryAnalyzer.slow_query_time = <time> or nil to log all …

…queries
  • Loading branch information...
commit 6c653e25e40284663f1bbf59f751be7881774a04 1 parent 1637d8c
@smtlaissezfaire authored
View
6 lib/enhanced_query_analyzer/logging.rb
@@ -11,6 +11,12 @@ def logging
@logging
end
+ def slow_query_time
+ @slow_query_time ||= nil
+ end
+
+ attr_writer :slow_query_time
+
def reset!
@logging = nil
@explain_logging = nil
View
9 spec/enhanced_query_analyzer/query_analyzer_spec.rb
@@ -33,4 +33,13 @@
EnhancedQueryAnalyzer.reset!
EnhancedQueryAnalyzer.explain_logging.should be_false
end
+
+ it "should have a nil slow_query_time" do
+ EnhancedQueryAnalyzer.slow_query_time.should be_nil
+ end
+
+ it "should be able to set the slow_query_time" do
+ EnhancedQueryAnalyzer.slow_query_time = 10
+ EnhancedQueryAnalyzer.slow_query_time.should == 10
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.