Module: Scout::Realtime
- Defined in:
- lib/scout_realtime.rb,
lib/scout_realtime/main.rb,
lib/scout_realtime/runner.rb,
lib/scout_realtime/version.rb
Defined Under Namespace
Modules: Aggregator, MultiAggregator Classes: Cpu, Disk, Main, Memory, Metric, Network, Processes, Runner, WebApp
Constant Summary collapse
- VERSION =
"1.0.5"
- @@logger =
nil
Class Method Summary collapse
- .logger ⇒ Object
- .logger=(l) ⇒ Object
-
.port_occupied?(port, seconds = 1) ⇒ Boolean
this is here only because there’s no obvious other place to put it.
Class Method Details
.logger ⇒ Object
35 36 37 |
# File 'lib/scout_realtime.rb', line 35 def self.logger; @@logger; end |
.logger=(l) ⇒ Object
39 40 41 |
# File 'lib/scout_realtime.rb', line 39 def self.logger=(l) @@logger=(l); end |
.port_occupied?(port, seconds = 1) ⇒ Boolean
this is here only because there’s no obvious other place to put it
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/scout_realtime.rb', line 44 def self.port_occupied?(port, seconds=1) Timeout::timeout(seconds) do begin TCPSocket.new("127.0.0.1", port).close true rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Errno::EADDRINUSE, Errno::EADDRNOTAVAIL false end end rescue Timeout::Error false end |