Class: Dbwatcher::Services::SystemInfo::MachineInfoCollector
- Inherits:
-
Object
- Object
- Dbwatcher::Services::SystemInfo::MachineInfoCollector
- Includes:
- Logging
- Defined in:
- lib/dbwatcher/services/system_info/machine_info_collector.rb
Overview
Machine information collector service
Collects system-level information about the machine including CPU, memory, disk usage, and process information.
This class is necessarily complex due to the comprehensive machine information it needs to collect across different operating systems. rubocop:disable Metrics/ClassLength
Class Method Summary collapse
-
.call ⇒ Hash
Class method to create instance and call.
Instance Method Summary collapse
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
30 31 32 |
# File 'lib/dbwatcher/services/system_info/machine_info_collector.rb', line 30 def self.call new.call end |
Instance Method Details
#call ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/dbwatcher/services/system_info/machine_info_collector.rb', line 34 def call log_info "#{self.class.name}: Collecting machine information" { hostname: collect_hostname, os: collect_os_info, cpu: collect_cpu_info, memory: collect_memory_info, disk: collect_disk_info, process: collect_process_info, load: collect_load_info, uptime: collect_uptime } rescue StandardError => e log_error "Machine info collection failed: #{e.}" { error: e. } end |