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.



240
241
242
243
# File 'lib/groonga-query-log/command/check-crash.rb', line 240

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

Instance Method Details

#each(&block) ⇒ Object



245
246
247
248
249
250
251
252
253
254
255
# File 'lib/groonga-query-log/command/check-crash.rb', line 245

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