Class: RailsVitals::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/rails_vitals/configuration.rb', line 18

def initialize
  @enabled                  = defined?(Rails) && !Rails.env.production?
  @store_size               = 200
  @store_enabled            = true
  @auth                     = :none
  @basic_auth_username      = nil
  @basic_auth_password      = nil
  @query_warn_threshold     = 10
  @query_critical_threshold = 25
  @db_time_warn_ms          = 100
  @db_time_critical_ms      = 500

  # MCP Server — disabled by default
  @mcp_enabled                 = false
  @mcp_auth_token              = nil
  @mcp_max_log_size            = 100
  @mcp_slow_query_threshold_ms = 100
end

Instance Attribute Details

#authObject

Returns the value of attribute auth.



3
4
5
# File 'lib/rails_vitals/configuration.rb', line 3

def auth
  @auth
end

#basic_auth_passwordObject

Returns the value of attribute basic_auth_password.



3
4
5
# File 'lib/rails_vitals/configuration.rb', line 3

def basic_auth_password
  @basic_auth_password
end

#basic_auth_usernameObject

Returns the value of attribute basic_auth_username.



3
4
5
# File 'lib/rails_vitals/configuration.rb', line 3

def basic_auth_username
  @basic_auth_username
end

#db_time_critical_msObject

Returns the value of attribute db_time_critical_ms.



3
4
5
# File 'lib/rails_vitals/configuration.rb', line 3

def db_time_critical_ms
  @db_time_critical_ms
end

#db_time_warn_msObject

Returns the value of attribute db_time_warn_ms.



3
4
5
# File 'lib/rails_vitals/configuration.rb', line 3

def db_time_warn_ms
  @db_time_warn_ms
end

#enabledObject

Returns the value of attribute enabled.



3
4
5
# File 'lib/rails_vitals/configuration.rb', line 3

def enabled
  @enabled
end

#mcp_auth_tokenObject

Returns the value of attribute mcp_auth_token.



3
4
5
# File 'lib/rails_vitals/configuration.rb', line 3

def mcp_auth_token
  @mcp_auth_token
end

#mcp_enabledObject

Returns the value of attribute mcp_enabled.



3
4
5
# File 'lib/rails_vitals/configuration.rb', line 3

def mcp_enabled
  @mcp_enabled
end

#mcp_max_log_sizeObject

Returns the value of attribute mcp_max_log_size.



3
4
5
# File 'lib/rails_vitals/configuration.rb', line 3

def mcp_max_log_size
  @mcp_max_log_size
end

#mcp_slow_query_threshold_msObject

Returns the value of attribute mcp_slow_query_threshold_ms.



3
4
5
# File 'lib/rails_vitals/configuration.rb', line 3

def mcp_slow_query_threshold_ms
  @mcp_slow_query_threshold_ms
end

#query_critical_thresholdObject

Returns the value of attribute query_critical_threshold.



3
4
5
# File 'lib/rails_vitals/configuration.rb', line 3

def query_critical_threshold
  @query_critical_threshold
end

#query_warn_thresholdObject

Returns the value of attribute query_warn_threshold.



3
4
5
# File 'lib/rails_vitals/configuration.rb', line 3

def query_warn_threshold
  @query_warn_threshold
end

#store_enabledObject

Returns the value of attribute store_enabled.



3
4
5
# File 'lib/rails_vitals/configuration.rb', line 3

def store_enabled
  @store_enabled
end

#store_sizeObject

Returns the value of attribute store_size.



3
4
5
# File 'lib/rails_vitals/configuration.rb', line 3

def store_size
  @store_size
end