Class: QueryOwl::Configuration
- Inherits:
-
Object
- Object
- QueryOwl::Configuration
- Defined in:
- lib/query_owl/configuration.rb
Constant Summary collapse
- VALID_LOG_LEVELS =
%i[debug info warn].freeze
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#n_plus_one_threshold ⇒ Object
Returns the value of attribute n_plus_one_threshold.
-
#slow_query_threshold_ms ⇒ Object
Returns the value of attribute slow_query_threshold_ms.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 13 |
# File 'lib/query_owl/configuration.rb', line 8 def initialize @enabled = Rails.env.development? @slow_query_threshold_ms = 100 @n_plus_one_threshold = 2 @log_level = :warn end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
6 7 8 |
# File 'lib/query_owl/configuration.rb', line 6 def enabled @enabled end |
#log_level ⇒ Object
Returns the value of attribute log_level.
5 6 7 |
# File 'lib/query_owl/configuration.rb', line 5 def log_level @log_level end |
#n_plus_one_threshold ⇒ Object
Returns the value of attribute n_plus_one_threshold.
6 7 8 |
# File 'lib/query_owl/configuration.rb', line 6 def n_plus_one_threshold @n_plus_one_threshold end |
#slow_query_threshold_ms ⇒ Object
Returns the value of attribute slow_query_threshold_ms.
6 7 8 |
# File 'lib/query_owl/configuration.rb', line 6 def slow_query_threshold_ms @slow_query_threshold_ms end |