lib/dexter/log_parser.rb in pgdexter-0.2.1 vs lib/dexter/log_parser.rb in pgdexter-0.3.0

- old
+ new

@@ -1,8 +1,8 @@ module Dexter class LogParser - REGEX = /duration: (\d+\.\d+) ms (statement|execute <unnamed>): (.+)/ + REGEX = /duration: (\d+\.\d+) ms (statement|execute <unnamed>|parse <unnamed>): (.+)/ LINE_SEPERATOR = ": ".freeze def initialize(logfile, collector) @logfile = logfile @collector = collector @@ -20,10 +20,10 @@ else active_line << line end end - if !active_line && m = REGEX.match(line.chomp) + if !active_line && (m = REGEX.match(line.chomp)) duration = m[1].to_f active_line = m[3] end end process_entry(active_line, duration) if active_line