Navigation Menu

Skip to content

Commit

Permalink
server-verifier: rename to "--verify-cache" from "--verify-cachehit-m…
Browse files Browse the repository at this point in the history
…ode"

It's for consistency. We're using "--#{verb}-#{object}" rule such as
"--care-order".
  • Loading branch information
kou committed Apr 21, 2017
1 parent d27814c commit 57fa22e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions lib/groonga/query-log/command/run-regression-test.rb
@@ -1,4 +1,4 @@
# Copyright (C) 2014-2015 Kouhei Sutou <kou@clear-code.com>
# Copyright (C) 2014-2017 Kouhei Sutou <kou@clear-code.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -409,7 +409,7 @@ def verify_server(test_log_path, query_log_path)
]
command_line << "--no-care-order" if @options[:care_order] == false
command_line << query_log_path.to_s
command_line << "--verify-cachehit-mode" if @new.use_persistent_cache? or @old.use_persistent_cache?
command_line << "--verify-cache" if @new.use_persistent_cache? or @old.use_persistent_cache?
verify_server = VerifyServer.new
verify_server.run(command_line)
end
Expand Down
12 changes: 5 additions & 7 deletions lib/groonga/query-log/command/verify-server.rb
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2015 Kouhei Sutou <kou@clear-code.com>
# Copyright (C) 2013-2017 Kouhei Sutou <kou@clear-code.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -135,10 +133,10 @@ def create_parser
@options.output_path = path
end

parser.on("--verify-cachehit-mode",
"Verify cachehit rate. After execute query, 'status' command execute.",
"[#{@options.verify_cachehit_mode}]") do
@options.verify_cachehit_mode = true
parser.on("--[no-]verify-cache",
"Verify cache for each query.",
"[#{@options.verify_cache?}]") do |verify_cache|
@options.verify_cache = verify_cache
end

parser.separator("Debug options:")
Expand Down
14 changes: 8 additions & 6 deletions lib/groonga/query-log/server-verifier.rb
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2015 Kouhei Sutou <kou@clear-code.com>
# Copyright (C) 2013-2017 Kouhei Sutou <kou@clear-code.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -110,7 +108,7 @@ def target_command?(command)

def verify_command(groonga1_client, groonga2_client, command)
if command.instance_of?(Groonga::Command::Status)
return unless @options.verify_cachehit_mode
return unless @options.verify_cache?
end
command["cache"] = "no" if @options.disable_cache?
command["output_type"] = :json
Expand Down Expand Up @@ -154,7 +152,7 @@ class Options
attr_accessor :target_command_names
attr_accessor :output_path
attr_accessor :care_order
attr_accessor :verify_cachehit_mode
attr_writer :verify_cache
def initialize
@groonga1 = GroongaOptions.new
@groonga2 = GroongaOptions.new
Expand All @@ -174,7 +172,7 @@ def initialize
"status",
]
@care_order = true
@verify_cahehit_mode = false
@verify_cache = false
end

def request_queue_size
Expand All @@ -185,6 +183,10 @@ def disable_cache?
@disable_cache
end

def verify_cache?
@verify_cache
end

def target_command_name?(name)
return false if name.nil?

Expand Down

0 comments on commit 57fa22e

Please sign in to comment.