Sha256: 072f982079be0061010a008736ed06d465fb8061bc7fc27f8bb02ad4ccb53ac0

Contents?: true

Size: 792 Bytes

Versions: 5

Compression:

Stored size: 792 Bytes

Contents

def start_dike
  require 'dike'
  Thread.new do
    Dike.logfactory File.join(File.dirname(__FILE__), *%w[.. .. logs])
    loop do
      Dike.finger
      sleep(1)
    end
  end
end

class BleakHouseDiagnostic
  LOG_FILE = File.join(File.dirname(__FILE__), *%w[.. .. logs bleak.log])
  
  def self.install
    require 'snapshot'
    self.spin
  end
  
  def self.snapshot
    @count ||= 0
    filename = "/tmp/god-bleak-%s-%03i.dump" % [Process.pid,@count]
    STDERR.puts "** BleakHouse: working..."
    BleakHouse.ext_snapshot(filename, 3)
    STDERR.puts "** BleakHouse: complete\n** Bleakhouse: Run 'bleak #{filename}' to analyze."
    @count += 1
  end
  
  def self.spin(delay = 60)
    Thread.new do
      loop do
        sleep(delay)
        self.snapshot
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
firenxis-god-0.11.0 lib/god/diagnostics.rb
god-0.11.0 lib/god/diagnostics.rb
god-0.10.1 lib/god/diagnostics.rb
god-0.9.0 lib/god/diagnostics.rb
god-0.8.0 lib/god/diagnostics.rb