Class: RailsPulse::Configuration
- Inherits:
-
Object
- Object
- RailsPulse::Configuration
- Defined in:
- lib/rails_pulse/configuration.rb
Instance Attribute Summary collapse
-
#archiving_enabled ⇒ Object
Returns the value of attribute archiving_enabled.
-
#authentication_enabled ⇒ Object
Returns the value of attribute authentication_enabled.
-
#authentication_method ⇒ Object
Returns the value of attribute authentication_method.
-
#authentication_redirect_path ⇒ Object
Returns the value of attribute authentication_redirect_path.
-
#connects_to ⇒ Object
Returns the value of attribute connects_to.
-
#custom_asset_patterns ⇒ Object
Returns the value of attribute custom_asset_patterns.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#full_retention_period ⇒ Object
Returns the value of attribute full_retention_period.
-
#ignored_queries ⇒ Object
Returns the value of attribute ignored_queries.
-
#ignored_requests ⇒ Object
Returns the value of attribute ignored_requests.
-
#ignored_routes ⇒ Object
Get all routes to ignore, including asset patterns if track_assets is false.
-
#max_table_records ⇒ Object
Returns the value of attribute max_table_records.
-
#mount_path ⇒ Object
Returns the value of attribute mount_path.
-
#query_thresholds ⇒ Object
Returns the value of attribute query_thresholds.
-
#request_thresholds ⇒ Object
Returns the value of attribute request_thresholds.
-
#route_thresholds ⇒ Object
Returns the value of attribute route_thresholds.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#track_assets ⇒ Object
Returns the value of attribute track_assets.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#revalidate! ⇒ Object
Revalidate configuration after changes.
-
#validate_configuration! ⇒ Object
Validate configuration settings.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/rails_pulse/configuration.rb', line 22 def initialize @enabled = true @route_thresholds = { slow: 500, very_slow: 1500, critical: 3000 } @request_thresholds = { slow: 700, very_slow: 2000, critical: 4000 } @query_thresholds = { slow: 100, very_slow: 500, critical: 1000 } @ignored_routes = [] @ignored_requests = [] @ignored_queries = [] @track_assets = false @custom_asset_patterns = [] @mount_path = nil @full_retention_period = 2.weeks @archiving_enabled = true @max_table_records = { rails_pulse_requests: 10000, rails_pulse_operations: 50000, rails_pulse_routes: 1000, rails_pulse_queries: 500 } @connects_to = nil @authentication_enabled = Rails.env.production? @authentication_method = nil @authentication_redirect_path = "/" @tags = [ "ignored", "critical", "experimental" ] validate_configuration! end |
Instance Attribute Details
#archiving_enabled ⇒ Object
Returns the value of attribute archiving_enabled.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def archiving_enabled @archiving_enabled end |
#authentication_enabled ⇒ Object
Returns the value of attribute authentication_enabled.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def authentication_enabled @authentication_enabled end |
#authentication_method ⇒ Object
Returns the value of attribute authentication_method.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def authentication_method @authentication_method end |
#authentication_redirect_path ⇒ Object
Returns the value of attribute authentication_redirect_path.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def authentication_redirect_path @authentication_redirect_path end |
#connects_to ⇒ Object
Returns the value of attribute connects_to.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def connects_to @connects_to end |
#custom_asset_patterns ⇒ Object
Returns the value of attribute custom_asset_patterns.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def custom_asset_patterns @custom_asset_patterns end |
#enabled ⇒ Object
Returns the value of attribute enabled.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def enabled @enabled end |
#full_retention_period ⇒ Object
Returns the value of attribute full_retention_period.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def full_retention_period @full_retention_period end |
#ignored_queries ⇒ Object
Returns the value of attribute ignored_queries.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def ignored_queries @ignored_queries end |
#ignored_requests ⇒ Object
Returns the value of attribute ignored_requests.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def ignored_requests @ignored_requests end |
#ignored_routes ⇒ Object
Get all routes to ignore, including asset patterns if track_assets is false
51 52 53 |
# File 'lib/rails_pulse/configuration.rb', line 51 def ignored_routes @ignored_routes end |
#max_table_records ⇒ Object
Returns the value of attribute max_table_records.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def max_table_records @max_table_records end |
#mount_path ⇒ Object
Returns the value of attribute mount_path.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def mount_path @mount_path end |
#query_thresholds ⇒ Object
Returns the value of attribute query_thresholds.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def query_thresholds @query_thresholds end |
#request_thresholds ⇒ Object
Returns the value of attribute request_thresholds.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def request_thresholds @request_thresholds end |
#route_thresholds ⇒ Object
Returns the value of attribute route_thresholds.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def route_thresholds @route_thresholds end |
#tags ⇒ Object
Returns the value of attribute tags.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def @tags end |
#track_assets ⇒ Object
Returns the value of attribute track_assets.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def track_assets @track_assets end |
Instance Method Details
#revalidate! ⇒ Object
Revalidate configuration after changes
73 74 75 |
# File 'lib/rails_pulse/configuration.rb', line 73 def revalidate! validate_configuration! end |
#validate_configuration! ⇒ Object
Validate configuration settings
63 64 65 66 67 68 69 70 |
# File 'lib/rails_pulse/configuration.rb', line 63 def validate_configuration! validate_thresholds! validate_retention_settings! validate_patterns! validate_database_settings! validate_authentication_settings! end |