Class: GroongaQueryLog::Command::CheckCrash::ProcessEnumerator

Inherits:
Object
  • Object
show all
Defined in:
lib/groonga-query-log/command/check-crash.rb

Instance Method Summary collapse

Constructor Details

#initialize(general_log_paths) ⇒ ProcessEnumerator

Returns a new instance of ProcessEnumerator.



297
298
299
300
# File 'lib/groonga-query-log/command/check-crash.rb', line 297

def initialize(general_log_paths)
  @general_log_paths = general_log_paths
  @running_processes = {}
end

Instance Method Details

#each(&block) ⇒ Object



302
303
304
305
306
307
308
309
310
311
312
# File 'lib/groonga-query-log/command/check-crash.rb', line 302

def each(&block)
  general_log_parser = GroongaLog::Parser.new
  general_log_parser.parse_paths(@general_log_paths) do |entry|
    check_general_log_entry(general_log_parser.current_path,
                            entry,
                            &block)
  end
  @running_processes.each_value do |process|
    yield(process)
  end
end