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
- DEFAULT_BACKTRACE_FILTER =
->(line) { line !~ %r{/gems/|/rubygems/|/ruby/gems/|lib/query_owl/} }
Instance Attribute Summary collapse
-
#backtrace_filter ⇒ Object
Returns the value of attribute backtrace_filter.
-
#backtrace_lines ⇒ Object
Returns the value of attribute backtrace_lines.
-
#dashboard_enabled ⇒ Object
Returns the value of attribute dashboard_enabled.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#event_store_size ⇒ Object
Returns the value of attribute event_store_size.
-
#log_file ⇒ Object
Returns the value of attribute log_file.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#n_plus_one_threshold ⇒ Object
Returns the value of attribute n_plus_one_threshold.
-
#raise_on_n_plus_one ⇒ Object
Returns the value of attribute raise_on_n_plus_one.
-
#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.
- #notifiers ⇒ Object
- #notifiers=(arr) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/query_owl/configuration.rb', line 18 def initialize @enabled = Rails.env.development? @slow_query_threshold_ms = 100 @n_plus_one_threshold = 2 @log_level = :warn @backtrace_lines = 5 @backtrace_filter = DEFAULT_BACKTRACE_FILTER @raise_on_n_plus_one = false @event_store_size = 100 @dashboard_enabled = Rails.env.development? @log_file = nil end |
Instance Attribute Details
#backtrace_filter ⇒ Object
Returns the value of attribute backtrace_filter.
6 7 8 |
# File 'lib/query_owl/configuration.rb', line 6 def backtrace_filter @backtrace_filter end |
#backtrace_lines ⇒ Object
Returns the value of attribute backtrace_lines.
7 8 9 |
# File 'lib/query_owl/configuration.rb', line 7 def backtrace_lines @backtrace_lines end |
#dashboard_enabled ⇒ Object
Returns the value of attribute dashboard_enabled.
7 8 9 |
# File 'lib/query_owl/configuration.rb', line 7 def dashboard_enabled @dashboard_enabled end |
#enabled ⇒ Object
Returns the value of attribute enabled.
7 8 9 |
# File 'lib/query_owl/configuration.rb', line 7 def enabled @enabled end |
#event_store_size ⇒ Object
Returns the value of attribute event_store_size.
7 8 9 |
# File 'lib/query_owl/configuration.rb', line 7 def event_store_size @event_store_size end |
#log_file ⇒ Object
Returns the value of attribute log_file.
7 8 9 |
# File 'lib/query_owl/configuration.rb', line 7 def log_file @log_file end |
#log_level ⇒ Object
Returns the value of attribute log_level.
6 7 8 |
# File 'lib/query_owl/configuration.rb', line 6 def log_level @log_level end |
#n_plus_one_threshold ⇒ Object
Returns the value of attribute n_plus_one_threshold.
7 8 9 |
# File 'lib/query_owl/configuration.rb', line 7 def n_plus_one_threshold @n_plus_one_threshold end |
#raise_on_n_plus_one ⇒ Object
Returns the value of attribute raise_on_n_plus_one.
7 8 9 |
# File 'lib/query_owl/configuration.rb', line 7 def raise_on_n_plus_one @raise_on_n_plus_one end |
#slow_query_threshold_ms ⇒ Object
Returns the value of attribute slow_query_threshold_ms.
7 8 9 |
# File 'lib/query_owl/configuration.rb', line 7 def slow_query_threshold_ms @slow_query_threshold_ms end |