lib/dexter/processor.rb in pgdexter-0.4.3 vs lib/dexter/processor.rb in pgdexter-0.5.0
- old
+ new
@@ -9,16 +9,10 @@
@indexer = Indexer.new(options)
@log_parser =
if @logfile == :pg_stat_activity
PgStatActivityParser.new(@indexer, @collector)
- elsif @logfile == :log_table
- if options[:input_format] == "csv"
- CsvLogTableParser.new(@indexer, @collector)
- else
- StderrLogTableParser.new(@indexer, @collector)
- end
elsif options[:input_format] == "csv"
CsvLogParser.new(logfile, @collector)
elsif options[:input_format] == "json"
JsonLogParser.new(logfile, @collector)
elsif options[:input_format] == "sql"
@@ -27,19 +21,18 @@
StderrLogParser.new(logfile, @collector)
end
@starting_interval = 3
@interval = options[:interval]
- @log_parser.once = options[:once]
@mutex = Mutex.new
@last_checked_at = {}
log "Started"
end
def perform
- if [STDIN, :pg_stat_activity, :log_table].include?(@logfile) && !@log_parser.once
+ if [STDIN].include?(@logfile)
Thread.abort_on_exception = true
Thread.new do
sleep(@starting_interval)
loop do
begin