Sha256: b96599fc8b0d5b109c772d9b8e050231c9a02e53561d36a07c1feec33f08fed8

Contents?: true

Size: 694 Bytes

Versions: 1

Compression:

Stored size: 694 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])
  
  class << self
    attr_accessor :logger
  end
  
  def self.install
    require 'bleak_house'
    self.logger = BleakHouse::Logger.new
    File.delete(LOG_FILE) rescue nil
  end
  
  def self.snapshot
    self.logger.snapshot(LOG_FILE, "timer", false) if self.logger
  end
  
  def self.spin(delay = 1)
    Thread.new do
      loop do
        self.snapshot
        sleep(delay)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
god-0.7.0 lib/god/diagnostics.rb