Class: QueryOwl::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/query_owl/configuration.rb

Constant Summary collapse

VALID_LOG_LEVELS =
%i[debug info warn].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

#enabledObject

Returns the value of attribute enabled.



6
7
8
# File 'lib/query_owl/configuration.rb', line 6

def enabled
  @enabled
end

#log_levelObject

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_thresholdObject

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_msObject

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