Kouhei Sutou
null+****@clear*****
Thu Jan 25 14:07:45 JST 2018
Kouhei Sutou 2018-01-25 14:07:45 +0900 (Thu, 25 Jan 2018) New Revision: a592b8655727e38499d56fd83e6191e3f2bf6bd4 https://github.com/groonga/groonga-query-log/commit/a592b8655727e38499d56fd83e6191e3f2bf6bd4 Message: Use ISO 8601 format Modified files: lib/groonga-query-log/command/analyzer/reporter.rb lib/groonga-query-log/command/analyzer/reporter/csv.rb lib/groonga-query-log/command/check-crash.rb Modified: lib/groonga-query-log/command/analyzer/reporter.rb (+4 -2) =================================================================== --- lib/groonga-query-log/command/analyzer/reporter.rb 2018-01-15 16:35:15 +0900 (10e469e) +++ lib/groonga-query-log/command/analyzer/reporter.rb 2018-01-25 14:07:45 +0900 (6eab00e) @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2017 Kouhei Sutou <kou �� clear-code.com> +# Copyright (C) 2011-2018 Kouhei Sutou <kou �� clear-code.com> # Copyright (C) 2012 Haruka Yoshihara <yoshihara �� clear-code.com> # # This library is free software; you can redistribute it and/or @@ -15,6 +15,8 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +require "time" + module GroongaQueryLog module Command class Analyzer @@ -94,7 +96,7 @@ module GroongaQueryLog if time.nil? "NaN" else - time.strftime("%Y-%m-%d %H:%M:%S.%u") + time.iso8601(6) end end end Modified: lib/groonga-query-log/command/analyzer/reporter/csv.rb (+11 -3) =================================================================== --- lib/groonga-query-log/command/analyzer/reporter/csv.rb 2018-01-15 16:35:15 +0900 (8916aac) +++ lib/groonga-query-log/command/analyzer/reporter/csv.rb 2018-01-25 14:07:45 +0900 (31aedbb) @@ -15,7 +15,6 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "csv" -require "time" require "groonga-query-log/command/analyzer/reporter" @@ -46,8 +45,8 @@ module GroongaQueryLog def report_statistic(statistic) record = [ - statistic.start_time.iso8601, - statistic.last_time.iso8601, + format_time(statistic.start_time), + format_time(statistic.last_time), statistic.elapsed_in_seconds, statistic.return_code, statistic.slow?, @@ -63,6 +62,15 @@ module GroongaQueryLog def report_summary end + + private + def format_time(time) + if time.nil? + "" + else + super + end + end end end end Modified: lib/groonga-query-log/command/check-crash.rb (+1 -1) =================================================================== --- lib/groonga-query-log/command/check-crash.rb 2018-01-15 16:35:15 +0900 (5b2d3b4) +++ lib/groonga-query-log/command/check-crash.rb 2018-01-25 14:07:45 +0900 (7205895) @@ -124,7 +124,7 @@ module GroongaQueryLog # p [path, entry] case entry.log_level when :emergency, :alert, :critical, :error, :warning - p [entry.log_level, entry.message, entry.timestamp.iso8601] + # p [entry.log_level, entry.message, entry.timestamp.iso8601] end case entry.message -------------- next part -------------- HTML����������������������������... URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180125/11e4f970/attachment-0001.htm