[Groonga-commit] droonga/droonga-engine at c63a1f0 [master] Report count of processed messages per 100 messages

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Apr 10 17:56:47 JST 2015


YUKI Hiroshi	2015-04-10 17:56:47 +0900 (Fri, 10 Apr 2015)

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

  Message:
    Report count of processed messages per 100 messages

  Modified files:
    lib/droonga/plugins/system/absorb_data.rb

  Modified: lib/droonga/plugins/system/absorb_data.rb (+10 -1)
===================================================================
--- lib/droonga/plugins/system/absorb_data.rb    2015-04-10 17:06:12 +0900 (5038249)
+++ lib/droonga/plugins/system/absorb_data.rb    2015-04-10 17:56:47 +0900 (97fe6e9)
@@ -55,13 +55,17 @@ module Droonga
             serf = Serf.new(my_node_name)
             serf.set_tag("absorbing", true)
 
+            count = 0
             dumper_error_message = dumper.run do |message|
               @messenger.forward(message,
                                  "to"   => my_node_name,
                                  "type" => message["type"])
-              forward("#{prefix}.progress")
+              count += 1
+              report_progress(count)
             end
 
+            forward("#{prefix}.progress", "count" => count)
+
             serf.set_tag("absorbing", true)
 
             if dumper_error_message
@@ -84,6 +88,11 @@ module Droonga
             }
           end
 
+          def report_progress(count)
+            return unless (count % 100).zero?
+            forward("#{prefix}.progress", "count" => count)
+          end
+
           def myself
             @myself ||= NodeName.parse(my_node_name)
           end
-------------- next part --------------
HTML����������������������������...
다운로드 



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