Class: Dexter::PgStatActivityParser
- Defined in:
- lib/dexter/pg_stat_activity_parser.rb
Constant Summary
Constants inherited from LogParser
LogParser::DETAIL_LINE, LogParser::LINE_SEPERATOR, LogParser::REGEX
Constants included from Logging
Instance Method Summary collapse
Methods inherited from LogParser
Methods included from Logging
Constructor Details
This class inherits a constructor from Dexter::LogParser
Instance Method Details
#perform ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/dexter/pg_stat_activity_parser.rb', line 3 def perform queries = {} loop do new_queries = {} @logfile.stat_activity.each do |row| new_queries[row["id"]] = row end # store queries after they complete queries.each do |id, row| unless new_queries[id] process_entry(row["query"], row["duration_ms"].to_f) end end queries = new_queries sleep(1) end end |