Method: Dexter::Processor#initialize
- Defined in:
- lib/dexter/processor.rb
#initialize(logfile, options) ⇒ Processor
Returns a new instance of Processor.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/dexter/processor.rb', line 5 def initialize(logfile, ) @logfile = logfile @collector = Collector.new(min_time: [:min_time], min_calls: [:min_calls]) @indexer = Indexer.new() @log_parser = if @logfile == :pg_stat_activity PgStatActivityParser.new(@indexer, @collector) elsif [:input_format] == "csv" CsvLogParser.new(logfile, @collector) elsif [:input_format] == "sql" SqlLogParser.new(logfile, @collector) else LogParser.new(logfile, @collector) end @starting_interval = 3 @interval = [:interval] @mutex = Mutex.new @last_checked_at = {} log "Started" end |