[Groonga-commit] groonga/groonga-query-log at 588b24a [master] Add timestamp

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Dec 13 09:41:30 JST 2017


Kouhei Sutou	2017-12-13 09:41:30 +0900 (Wed, 13 Dec 2017)

  New Revision: 588b24af9f6e96036d208aa97e5b47a9f7d98dbe
  https://github.com/groonga/groonga-query-log/commit/588b24af9f6e96036d208aa97e5b47a9f7d98dbe

  Message:
    Add timestamp

  Modified files:
    lib/groonga-query-log/command/load-analyzer.rb

  Modified: lib/groonga-query-log/command/load-analyzer.rb (+17 -2)
===================================================================
--- lib/groonga-query-log/command/load-analyzer.rb    2017-12-12 17:22:56 +0900 (8db69c9)
+++ lib/groonga-query-log/command/load-analyzer.rb    2017-12-13 09:41:30 +0900 (be3f130)
@@ -60,6 +60,7 @@ module GroongaQueryLog
 
         begin
           open_output do |output|
+            report_header(output)
             parse(log_paths) do |statistic|
               report_statistic(output, statistic)
             end
@@ -136,9 +137,9 @@ module GroongaQueryLog
         end
         return if select_operation.nil?
 
-        return if @pending_entry[1] != select_command[:table]
+        return if @pending_entry[2] != select_command[:table]
 
-        @pending_entry[5] = select_operation[:n_records]
+        @pending_entry[6] = select_operation[:n_records]
         report_entry(output, @pending_entry)
         @pending_entry = nil
       end
@@ -159,6 +160,7 @@ module GroongaQueryLog
           total = nil
         end
         entry = [
+          statistic.last_time.iso8601,
           statistic.elapsed_in_seconds,
           load_command.table,
           n_loaded_records,
@@ -177,6 +179,19 @@ module GroongaQueryLog
         end
       end
 
+      def report_header(output)
+        header = [
+          "timestamp",
+          "elapsed",
+          "table",
+          "n_loaded_records",
+          "n_record_errors",
+          "n_column_errors",
+          "n_total_records",
+        ]
+        output.puts(header.join(","))
+      end
+
       def report_entry(output, entry)
         output.puts(entry.join(","))
       end
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20171213/c125f64e/attachment-0001.htm 



More information about the Groonga-commit mailing list
Back to archive index