Kouhei Sutou
null+****@clear*****
Sat Sep 10 11:19:43 JST 2016
Kouhei Sutou 2016-09-10 11:19:43 +0900 (Sat, 10 Sep 2016) New Revision: c5a5e67881461accd04132399eb2a778c44bac90 https://github.com/groonga/groonga-query-log/commit/c5a5e67881461accd04132399eb2a778c44bac90 Message: Accept file content return request GitHub: fix #2 Reported by Kentaro Hayashi. Thanks!!! Modified files: lib/groonga/query-log/server-verifier.rb test/test-parser.rb Modified: lib/groonga/query-log/server-verifier.rb (+3 -1) =================================================================== --- lib/groonga/query-log/server-verifier.rb 2016-09-10 11:01:15 +0900 (1a16af0) +++ lib/groonga/query-log/server-verifier.rb 2016-09-10 11:19:43 +0900 (d593a24) @@ -48,7 +48,9 @@ module Groonga Thread.new do parser = Parser.new parser.parse(input) do |statistic| - next unless target_command?(statistic.command) + command = statistic.command + next if command.nil? + next unless target_command?(command) @queue.push(statistic) end @options.n_clients.times do Modified: test/test-parser.rb (+8 -0) =================================================================== --- test/test-parser.rb 2016-09-10 11:01:15 +0900 (281392c) +++ test/test-parser.rb 2016-09-10 11:19:43 +0900 (112f6f7) @@ -37,6 +37,14 @@ class ParserTest < Test::Unit::TestCase assert_instance_of(Groonga::Command::Load, parsed_command) end + def test_no_command_name_path + statistics = parse(<<-LOG) +2012-12-13 11:15:20.628105|0x7fff148c8a50|>/ +2012-12-13 11:15:21.645119|0x7fff148c8a50|<000000017041150 rc=0 + LOG + assert_equal([nil], statistics.collect(&:command)) + end + private def parse(log) statistics = [] -------------- next part -------------- HTML����������������������������...下载