[Groonga-commit] groonga/groonga-query-log at bf9786c [master] verify-server: add --stop-on-failure option

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jun 18 14:20:28 JST 2018


Kouhei Sutou	2018-06-18 14:20:28 +0900 (Mon, 18 Jun 2018)

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

  Message:
    verify-server: add --stop-on-failure option

  Modified files:
    lib/groonga-query-log/command/verify-server.rb
    lib/groonga-query-log/server-verifier.rb

  Modified: lib/groonga-query-log/command/verify-server.rb (+6 -0)
===================================================================
--- lib/groonga-query-log/command/verify-server.rb    2018-06-18 11:48:24 +0900 (ba85ea6)
+++ lib/groonga-query-log/command/verify-server.rb    2018-06-18 14:20:28 +0900 (191b8fa)
@@ -148,6 +148,12 @@ module GroongaQueryLog
           @options.ignored_drilldown_keys << key
         end
 
+        parser.on("--[no-]stop-on-failure",
+                  "Stop execution on the first failure",
+                  "(#{@options.stop_on_failure})") do |boolean|
+          @options.stop_on_failure = boolean
+        end
+
         parser.separator("Debug options:")
         parser.separator("")
 

  Modified: lib/groonga-query-log/server-verifier.rb (+8 -0)
===================================================================
--- lib/groonga-query-log/server-verifier.rb    2018-06-18 11:48:24 +0900 (6158cbd)
+++ lib/groonga-query-log/server-verifier.rb    2018-06-18 14:20:28 +0900 (4cf5c4c)
@@ -49,6 +49,8 @@ module GroongaQueryLog
         n_commands = 0
         callback_per_n_commands = 100
         parser.parse(input) do |statistic|
+          break if !@same and****@optio*****_on_failure?
+
           command = statistic.command
           next if command.nil?
           next unless target_command?(command)
@@ -178,6 +180,7 @@ module GroongaQueryLog
       attr_accessor :care_order
       attr_writer :verify_cache
       attr_accessor :ignored_drilldown_keys
+      attr_writer :stop_on_failure
       def initialize
         @groonga1 = GroongaOptions.new
         @groonga2 = GroongaOptions.new
@@ -199,6 +202,7 @@ module GroongaQueryLog
         @care_order = true
         @verify_cache = false
         @ignored_drilldown_keys = []
+        @stop_on_failure = false
       end
 
       def request_queue_size
@@ -213,6 +217,10 @@ module GroongaQueryLog
         @verify_cache
       end
 
+      def stop_on_failure?
+        @stop_on_failure
+      end
+
       def target_command_name?(name)
         return false if name.nil?
 
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180618/4da1e1b4/attachment-0001.htm 



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