Kouhei Sutou
null+****@clear*****
Thu Oct 3 14:14:05 JST 2013
Kouhei Sutou 2013-10-03 14:14:05 +0900 (Thu, 03 Oct 2013) New Revision: 3e7c28aa83208d05664154c39ec12fe0fb889620 https://github.com/groonga/groonga-query-log/commit/3e7c28aa83208d05664154c39ec12fe0fb889620 Message: memory-leak-detector: add --force-disable-cache option I don't like the option name because it is "--no-force-disable-cache" when an user disables the feature. It is a double negation name... Modified files: lib/groonga/query-log/command/detect-memory-leak.rb lib/groonga/query-log/memory-leak-detector.rb Modified: lib/groonga/query-log/command/detect-memory-leak.rb (+6 -0) =================================================================== --- lib/groonga/query-log/command/detect-memory-leak.rb 2013-09-30 16:55:54 +0900 (6906acd) +++ lib/groonga/query-log/command/detect-memory-leak.rb 2013-10-03 14:14:05 +0900 (269871c) @@ -77,6 +77,12 @@ module Groonga "[#{@options.n_tries}]") do |n| @options.n_tries = n end + + parser.on("--[no-]force-disable-cache", + "Force disable cache of select command by cache=no parameter", + "[#{@options.force_disable_cache?}]") do |boolean| + @options.force_disable_cache = boolean + end end end end Modified: lib/groonga/query-log/memory-leak-detector.rb (+7 -1) =================================================================== --- lib/groonga/query-log/memory-leak-detector.rb 2013-09-30 16:55:54 +0900 (fcb63cd) +++ lib/groonga/query-log/memory-leak-detector.rb 2013-10-03 14:14:05 +0900 (3a6096f) @@ -54,7 +54,7 @@ module Groonga end def check_command(client, command) - command["cache"] = "no" + command["cache"] = "no" if****@optio*****_disable_cache? current_n_allocations = nil @options.n_tries.times do |i| client.execute(command) @@ -89,12 +89,18 @@ module Groonga attr_accessor :protocol attr_accessor :pid attr_accessor :n_tries + attr_writer :force_disable_cache def initialize @host = "127.0.0.1" @port = 10041 @protocol = :gqtp @pid = guess_groonga_server_pid @n_tries = 10 + @force_disable_cache = true + end + + def force_disable_cache? + @force_disable_cache end def create_client(&block) -------------- next part -------------- HTML����������������������������...Download