Kouhei Sutou
null+****@clear*****
Mon Apr 2 14:34:57 JST 2018
Kouhei Sutou 2018-04-02 14:34:57 +0900 (Mon, 02 Apr 2018) New Revision: 81336d6f392571893581c78d1b25b6ef75c43b6b https://github.com/groonga/groonga-query-log/commit/81336d6f392571893581c78d1b25b6ef75c43b6b Message: check-crash: show running queries Modified files: lib/groonga-query-log/command/check-crash.rb Modified: lib/groonga-query-log/command/check-crash.rb (+11 -3) =================================================================== --- lib/groonga-query-log/command/check-crash.rb 2018-03-31 02:03:03 +0900 (8781b6e) +++ lib/groonga-query-log/command/check-crash.rb 2018-04-02 14:34:57 +0900 (fe92c0d) @@ -93,7 +93,6 @@ module GroongaQueryLog class Checker def initialize(log_paths) - @query_log_parser = Parser.new split_log_paths(log_paths) end @@ -118,12 +117,21 @@ module GroongaQueryLog last = process.last_time @flushed = nil @unflushed_statistics = [] - @query_log_parser.parse_paths(@query_log_paths) do |statistic| + query_log_parser = Parser.new + query_log_parser.parse_paths(@query_log_paths) do |statistic| next if statistic.start_time < start break if statistic.start_time > last - check_query_log_statistic(@query_log_parser.current_path, + check_query_log_statistic(query_log_parser.current_path, statistic) end + parsing_statistics = query_log_parser.parsing_statistics + unless parsing_statistics.empty? + puts("Running queries:") + parsing_statistics.each do |statistic| + puts("#{statistic.start_time.iso8601}:") + puts(statistic.command.to_command_format(pretty_preint: true)) + end + end unless @unflushed_statistics.empty? puts("Unflushed statistics in #{start.iso8601}/#{last.iso8601}") @unflushed_statistics.each do |statistic| -------------- next part -------------- HTML����������������������������... URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180402/783c6098/attachment.htm