[Groonga-commit] droonga/droonga-engine at c32a133 [master] Report number of sending dump messages at first

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Apr 17 16:35:05 JST 2015


YUKI Hiroshi	2015-04-17 16:35:05 +0900 (Fri, 17 Apr 2015)

  New Revision: c32a13391cac4a6ebd53a3dcf383344fe9ecd2b2
  https://github.com/droonga/droonga-engine/commit/c32a13391cac4a6ebd53a3dcf383344fe9ecd2b2

  Message:
    Report number of sending dump messages at first

  Modified files:
    lib/droonga/plugins/dump.rb

  Modified: lib/droonga/plugins/dump.rb (+16 -0)
===================================================================
--- lib/droonga/plugins/dump.rb    2015-04-17 16:16:54 +0900 (218539c)
+++ lib/droonga/plugins/dump.rb    2015-04-17 16:35:05 +0900 (25d1283)
@@ -54,6 +54,7 @@ module Droonga
           on_start
 
           runner = Fiber.new do
+            forecast
             dump_schema
             dump_records
             dump_indexes
@@ -97,6 +98,21 @@ module Droonga
           "failed to dump"
         end
 
+        def forecast
+          n_tables  = 0
+          n_columns = 0
+          n_records = 0
+          each_table do |table|
+            n_tables += 1
+            n_columns += table.columns.size
+            unless index_only_table?(table)
+              n_records += table.size
+            end
+          end
+          n_dump_messages = n_tables + n_columns + n_records
+          forward("#{prefix}.forecast", "nMessages" => n_dump_messages)
+        end
+
         def dump_schema
           reference_tables = []
           each_table do |table|
-------------- next part --------------
HTML����������������������������...
Télécharger 



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