Class: Groonga::QueryLog::ServerVerifier::Options
- Inherits:
-
Object
- Object
- Groonga::QueryLog::ServerVerifier::Options
- Defined in:
- lib/groonga/query-log/server-verifier.rb
Instance Attribute Summary collapse
-
#disable_cache ⇒ Object
writeonly
Sets the attribute disable_cache.
-
#groonga1 ⇒ Object
readonly
Returns the value of attribute groonga1.
-
#groonga2 ⇒ Object
readonly
Returns the value of attribute groonga2.
-
#n_clients ⇒ Object
Returns the value of attribute n_clients.
-
#output_path ⇒ Object
Returns the value of attribute output_path.
- #request_queue_size ⇒ Object
-
#target_command_names ⇒ Object
Returns the value of attribute target_command_names.
Instance Method Summary collapse
- #create_output(&block) ⇒ Object
- #disable_cache? ⇒ Boolean
-
#initialize ⇒ Options
constructor
A new instance of Options.
- #target_command_name?(name) ⇒ Boolean
Constructor Details
#initialize ⇒ Options
Returns a new instance of Options.
144 145 146 147 148 149 150 151 152 |
# File 'lib/groonga/query-log/server-verifier.rb', line 144 def initialize @groonga1 = GroongaOptions.new @groonga2 = GroongaOptions.new @n_clients = 8 @request_queue_size = nil @disable_cache = false @output_path = nil @target_command_names = ["select"] end |
Instance Attribute Details
#disable_cache=(value) ⇒ Object (writeonly)
Sets the attribute disable_cache
141 142 143 |
# File 'lib/groonga/query-log/server-verifier.rb', line 141 def disable_cache=(value) @disable_cache = value end |
#groonga1 ⇒ Object (readonly)
Returns the value of attribute groonga1.
137 138 139 |
# File 'lib/groonga/query-log/server-verifier.rb', line 137 def groonga1 @groonga1 end |
#groonga2 ⇒ Object (readonly)
Returns the value of attribute groonga2.
138 139 140 |
# File 'lib/groonga/query-log/server-verifier.rb', line 138 def groonga2 @groonga2 end |
#n_clients ⇒ Object
Returns the value of attribute n_clients.
139 140 141 |
# File 'lib/groonga/query-log/server-verifier.rb', line 139 def n_clients @n_clients end |
#output_path ⇒ Object
Returns the value of attribute output_path.
143 144 145 |
# File 'lib/groonga/query-log/server-verifier.rb', line 143 def output_path @output_path end |
#request_queue_size ⇒ Object
154 155 156 |
# File 'lib/groonga/query-log/server-verifier.rb', line 154 def request_queue_size @request_queue_size || @n_clients * 3 end |
#target_command_names ⇒ Object
Returns the value of attribute target_command_names.
142 143 144 |
# File 'lib/groonga/query-log/server-verifier.rb', line 142 def target_command_names @target_command_names end |
Instance Method Details
#create_output(&block) ⇒ Object
170 171 172 173 174 175 176 177 |
# File 'lib/groonga/query-log/server-verifier.rb', line 170 def create_output(&block) if @output_path FileUtils.mkdir_p(File.dirname(@output_path)) File.open(@output_path, "w", &block) else yield($stdout) end end |
#disable_cache? ⇒ Boolean
158 159 160 |
# File 'lib/groonga/query-log/server-verifier.rb', line 158 def disable_cache? @disable_cache end |
#target_command_name?(name) ⇒ Boolean
162 163 164 165 166 167 168 |
# File 'lib/groonga/query-log/server-verifier.rb', line 162 def target_command_name?(name) @target_command_names.any? do |name_pattern| flags = 0 flags |= File::FNM_EXTGLOB if File.const_defined?(:FNM_EXTGLOB) File.fnmatch(name_pattern, name, flags) end end |