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.
-
#async ⇒ Object
Returns the value of attribute async.
-
#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.
-
#capture_job_arguments ⇒ Object
Returns the value of attribute capture_job_arguments.
-
#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_jobs ⇒ Object
Returns the value of attribute ignored_jobs.
-
#ignored_queries ⇒ Object
Returns the value of attribute ignored_queries.
-
#ignored_queues ⇒ Object
Returns the value of attribute ignored_queues.
-
#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.
-
#job_adapters ⇒ Object
Returns the value of attribute job_adapters.
-
#job_thresholds ⇒ Object
Returns the value of attribute job_thresholds.
-
#job_tracking_mode ⇒ Object
Returns the value of attribute job_tracking_mode.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#max_table_records ⇒ Object
Returns the value of attribute max_table_records.
-
#mount_dashboard ⇒ Object
Returns the value of attribute mount_dashboard.
-
#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.
-
#track_jobs ⇒ Object
Returns the value of attribute track_jobs.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#validate_configuration! ⇒ Object
Validate configuration settings.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/rails_pulse/configuration.rb', line 32 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 } @job_thresholds = { slow: 5_000, very_slow: 30_000, critical: 60_000 } @ignored_routes = [] @ignored_requests = [] @ignored_queries = [] @ignored_jobs = [] @ignored_queues = [] @track_assets = false @track_jobs = false @custom_asset_patterns = [] @mount_path = nil @full_retention_period = 30.days @archiving_enabled = true @max_table_records = { rails_pulse_operations: 100_000, rails_pulse_requests: 50_000, rails_pulse_job_runs: 50_000, rails_pulse_queries: 10_000, rails_pulse_routes: 1_000, rails_pulse_jobs: 1_000 } @connects_to = nil @authentication_enabled = Rails.env.production? @authentication_method = nil @authentication_redirect_path = "/" @tags = [ "ignored", "critical", "experimental" ] @job_tracking_mode = :universal @job_adapters = { sidekiq: { enabled: true, track_queue_depth: false }, solid_queue: { enabled: true, track_recurring: false }, good_job: { enabled: true, track_cron: false }, delayed_job: { enabled: true }, resque: { enabled: true } } @capture_job_arguments = false # Dashboard settings @mount_dashboard = true @logger = nil # Tracking mode settings @async = true 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 |
#async ⇒ Object
Returns the value of attribute async.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def async @async 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 |
#capture_job_arguments ⇒ Object
Returns the value of attribute capture_job_arguments.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def capture_job_arguments @capture_job_arguments 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_jobs ⇒ Object
Returns the value of attribute ignored_jobs.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def ignored_jobs @ignored_jobs 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_queues ⇒ Object
Returns the value of attribute ignored_queues.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def ignored_queues @ignored_queues 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
81 82 83 |
# File 'lib/rails_pulse/configuration.rb', line 81 def ignored_routes @ignored_routes end |
#job_adapters ⇒ Object
Returns the value of attribute job_adapters.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def job_adapters @job_adapters end |
#job_thresholds ⇒ Object
Returns the value of attribute job_thresholds.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def job_thresholds @job_thresholds end |
#job_tracking_mode ⇒ Object
Returns the value of attribute job_tracking_mode.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def job_tracking_mode @job_tracking_mode end |
#logger ⇒ Object
Returns the value of attribute logger.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def logger @logger 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_dashboard ⇒ Object
Returns the value of attribute mount_dashboard.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def mount_dashboard @mount_dashboard 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 |
#track_jobs ⇒ Object
Returns the value of attribute track_jobs.
3 4 5 |
# File 'lib/rails_pulse/configuration.rb', line 3 def track_jobs @track_jobs end |
Instance Method Details
#validate_configuration! ⇒ Object
Validate configuration settings
93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/rails_pulse/configuration.rb', line 93 def validate_configuration! validate_thresholds! validate_retention_settings! validate_patterns! validate_database_settings! validate_authentication_settings! validate_job_settings! validate_dashboard_settings! validate_tracking_settings! end |