Class: Dbwatcher::Services::SystemInfo::RuntimeInfoCollector
- Inherits:
-
Object
- Object
- Dbwatcher::Services::SystemInfo::RuntimeInfoCollector
- Includes:
- Logging
- Defined in:
- lib/dbwatcher/services/system_info/runtime_info_collector.rb
Overview
Runtime information collector service
Collects runtime-specific information including Ruby version, Rails version, loaded gems, environment variables, and application configuration.
This class is necessarily complex due to the comprehensive runtime information it needs to collect across different Ruby and Rails environments. rubocop:disable Metrics/ClassLength
Class Method Summary collapse
-
.call ⇒ Hash
Class method to create instance and call.
Instance Method Summary collapse
-
#call ⇒ Hash
Collect runtime information.
Methods included from Logging
#debug_enabled?, #log_debug, #log_error, #log_info, #log_warn
Class Method Details
.call ⇒ Hash
Class method to create instance and call
28 29 30 |
# File 'lib/dbwatcher/services/system_info/runtime_info_collector.rb', line 28 def self.call new.call end |
Instance Method Details
#call ⇒ Hash
Collect runtime information
rubocop:disable Metrics/MethodLength
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/dbwatcher/services/system_info/runtime_info_collector.rb', line 36 def call log_info "#{self.class.name}: Collecting runtime information" { ruby_version: collect_ruby_version, ruby_engine: collect_ruby_engine, ruby_patchlevel: collect_ruby_patchlevel, rails_version: collect_rails_version, rails_env: collect_rails_env, environment: collect_environment, pid: Process.pid, gem_count: collect_gem_count, loaded_gems: collect_loaded_gems, load_path: collect_load_path_info, environment_variables: collect_environment_variables, application_config: collect_application_config } rescue StandardError => e log_error "Runtime info collection failed: #{e.}" { error: e. } end |