Sha256: 3bb527552ef9133dd10c06e40c518a84caaa8215380706cb10b6f35bc0b23caf
Contents?: true
Size: 587 Bytes
Versions: 26
Compression:
Stored size: 587 Bytes
Contents
module Marty::Diagnostic::Node def self.my_ip begin Socket.ip_address_list.detect{|intf| intf.ipv4_private?}.ip_address rescue => e e.message end end def self.get_target_connections target Marty::Diagnostic::Database.current_connections.select{|conn| conn['application_name'].include?(target) }.map{|conn| conn['client_addr'] == '127.0.0.1' ? my_ip : conn['client_addr'] || '127.0.0.1' } end def self.get_nodes nodes = get_target_connections('Passenger').uniq.compact nodes.empty? ? [my_ip] : nodes end end
Version data entries
26 entries across 26 versions & 1 rubygems