Class: GroongaQueryLog::ServerVerifier::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/groonga-query-log/server-verifier.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOptions

Returns a new instance of Options.



329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# File 'lib/groonga-query-log/server-verifier.rb', line 329

def initialize
  @groonga1 = GroongaOptions.new
  @groonga2 = GroongaOptions.new
  @n_clients = 8
  @request_queue_size = nil
  @disable_cache = false
  @output_path = nil
  @output_opened = false
  @target_command_names = [
    "io_flush",
    "logical_count",
    "logical_range_filter",
    "logical_shard_list",
    "logical_select",
    "normalize",
    "object_exist",
    "select",
    "status",
  ]
  @care_order = true
  @verify_cache = false
  @ignored_drilldown_keys = []
  @stop_on_failure = false
  @rewrite_vector_equal = false
  @rewrite_vector_not_equal_empty_string = false
  @vector_accessors = []
  @rewrite_nullable_reference_number = false
  @nullable_reference_number_accessors = []
  @rewrite_not_or_regular_expression = false
  @rewrite_and_not_operator = false
  @verify_performance = false
  @performance_verifier_options = PerformanceVerifier::Options.new
  @debug_rewrite = false
  @omit_rate = 0.0
  @max_limit = -1
end

Instance Attribute Details

#care_orderObject

Returns the value of attribute care_order.



313
314
315
# File 'lib/groonga-query-log/server-verifier.rb', line 313

def care_order
  @care_order
end

#debug_rewrite=(value) ⇒ Object (writeonly)

Sets the attribute debug_rewrite

Parameters:

  • value

    the value to set the attribute debug_rewrite to.



326
327
328
# File 'lib/groonga-query-log/server-verifier.rb', line 326

def debug_rewrite=(value)
  @debug_rewrite = value
end

#disable_cache=(value) ⇒ Object (writeonly)

Sets the attribute disable_cache

Parameters:

  • value

    the value to set the attribute disable_cache to.



310
311
312
# File 'lib/groonga-query-log/server-verifier.rb', line 310

def disable_cache=(value)
  @disable_cache = value
end

#groonga1Object (readonly)

Returns the value of attribute groonga1.



306
307
308
# File 'lib/groonga-query-log/server-verifier.rb', line 306

def groonga1
  @groonga1
end

#groonga2Object (readonly)

Returns the value of attribute groonga2.



307
308
309
# File 'lib/groonga-query-log/server-verifier.rb', line 307

def groonga2
  @groonga2
end

#ignored_drilldown_keysObject

Returns the value of attribute ignored_drilldown_keys.



315
316
317
# File 'lib/groonga-query-log/server-verifier.rb', line 315

def ignored_drilldown_keys
  @ignored_drilldown_keys
end

#max_limitObject

Returns the value of attribute max_limit.



328
329
330
# File 'lib/groonga-query-log/server-verifier.rb', line 328

def max_limit
  @max_limit
end

#n_clientsObject

Returns the value of attribute n_clients.



308
309
310
# File 'lib/groonga-query-log/server-verifier.rb', line 308

def n_clients
  @n_clients
end

#nullable_reference_number_accessorsObject

Returns the value of attribute nullable_reference_number_accessors.



321
322
323
# File 'lib/groonga-query-log/server-verifier.rb', line 321

def nullable_reference_number_accessors
  @nullable_reference_number_accessors
end

#omit_rateObject



460
461
462
# File 'lib/groonga-query-log/server-verifier.rb', line 460

def omit_rate
  @omit_rate
end

#output_pathObject

Returns the value of attribute output_path.



312
313
314
# File 'lib/groonga-query-log/server-verifier.rb', line 312

def output_path
  @output_path
end

#performance_verifier_optionsObject (readonly)

Returns the value of attribute performance_verifier_options.



325
326
327
# File 'lib/groonga-query-log/server-verifier.rb', line 325

def performance_verifier_options
  @performance_verifier_options
end

#request_queue_sizeObject



366
367
368
# File 'lib/groonga-query-log/server-verifier.rb', line 366

def request_queue_size
  @request_queue_size || @n_clients * 3
end

#rewrite_and_not_operator=(value) ⇒ Object (writeonly)

Sets the attribute rewrite_and_not_operator

Parameters:

  • value

    the value to set the attribute rewrite_and_not_operator to.



323
324
325
# File 'lib/groonga-query-log/server-verifier.rb', line 323

def rewrite_and_not_operator=(value)
  @rewrite_and_not_operator = value
end

#rewrite_not_or_regular_expression=(value) ⇒ Object (writeonly)

Sets the attribute rewrite_not_or_regular_expression

Parameters:

  • value

    the value to set the attribute rewrite_not_or_regular_expression to.



322
323
324
# File 'lib/groonga-query-log/server-verifier.rb', line 322

def rewrite_not_or_regular_expression=(value)
  @rewrite_not_or_regular_expression = value
end

#rewrite_nullable_reference_number=(value) ⇒ Object (writeonly)

Sets the attribute rewrite_nullable_reference_number

Parameters:

  • value

    the value to set the attribute rewrite_nullable_reference_number to.



320
321
322
# File 'lib/groonga-query-log/server-verifier.rb', line 320

def rewrite_nullable_reference_number=(value)
  @rewrite_nullable_reference_number = value
end

#rewrite_vector_equal=(value) ⇒ Object (writeonly)

Sets the attribute rewrite_vector_equal

Parameters:

  • value

    the value to set the attribute rewrite_vector_equal to.



317
318
319
# File 'lib/groonga-query-log/server-verifier.rb', line 317

def rewrite_vector_equal=(value)
  @rewrite_vector_equal = value
end

#rewrite_vector_not_equal_empty_string=(value) ⇒ Object (writeonly)

Sets the attribute rewrite_vector_not_equal_empty_string

Parameters:

  • value

    the value to set the attribute rewrite_vector_not_equal_empty_string to.



318
319
320
# File 'lib/groonga-query-log/server-verifier.rb', line 318

def rewrite_vector_not_equal_empty_string=(value)
  @rewrite_vector_not_equal_empty_string = value
end

#stop_on_failure=(value) ⇒ Object (writeonly)

Sets the attribute stop_on_failure

Parameters:

  • value

    the value to set the attribute stop_on_failure to.



316
317
318
# File 'lib/groonga-query-log/server-verifier.rb', line 316

def stop_on_failure=(value)
  @stop_on_failure = value
end

#target_command_namesObject

Returns the value of attribute target_command_names.



311
312
313
# File 'lib/groonga-query-log/server-verifier.rb', line 311

def target_command_names
  @target_command_names
end

#vector_accessorsObject

Returns the value of attribute vector_accessors.



319
320
321
# File 'lib/groonga-query-log/server-verifier.rb', line 319

def vector_accessors
  @vector_accessors
end

#verify_cache=(value) ⇒ Object (writeonly)

Sets the attribute verify_cache

Parameters:

  • value

    the value to set the attribute verify_cache to.



314
315
316
# File 'lib/groonga-query-log/server-verifier.rb', line 314

def verify_cache=(value)
  @verify_cache = value
end

#verify_performance=(value) ⇒ Object (writeonly)

Sets the attribute verify_performance

Parameters:

  • value

    the value to set the attribute verify_performance to.



324
325
326
# File 'lib/groonga-query-log/server-verifier.rb', line 324

def verify_performance=(value)
  @verify_performance = value
end

Instance Method Details

#debug_rewrite?Boolean

Returns:

  • (Boolean)


456
457
458
# File 'lib/groonga-query-log/server-verifier.rb', line 456

def debug_rewrite?
  @debug_rewrite
end

#disable_cache?Boolean

Returns:

  • (Boolean)


370
371
372
# File 'lib/groonga-query-log/server-verifier.rb', line 370

def disable_cache?
  @disable_cache
end

#need_filter_rewrite?Boolean

Returns:

  • (Boolean)


427
428
429
430
431
432
433
# File 'lib/groonga-query-log/server-verifier.rb', line 427

def need_filter_rewrite?
  rewrite_vector_equal? or
    rewrite_vector_not_equal_empty_string? or
    rewrite_nullable_reference_number? or
    rewrite_not_or_regular_expression? or
    rewrite_and_not_operator?
end

#open_output(&block) ⇒ Object



412
413
414
415
416
417
418
419
420
421
422
423
424
425
# File 'lib/groonga-query-log/server-verifier.rb', line 412

def open_output(&block)
  if @output_path
    if @output_opened
      mode = "a"
    else
      FileUtils.mkdir_p(File.dirname(@output_path))
      mode = "w"
      @output_opened = true
    end
    File.open(@output_path, mode, &block)
  else
    yield($stdout)
  end
end

#rewrite_and_not_operator?Boolean

Returns:

  • (Boolean)


398
399
400
# File 'lib/groonga-query-log/server-verifier.rb', line 398

def rewrite_and_not_operator?
  @rewrite_and_not_operator
end

#rewrite_not_or_regular_expression?Boolean

Returns:

  • (Boolean)


394
395
396
# File 'lib/groonga-query-log/server-verifier.rb', line 394

def rewrite_not_or_regular_expression?
  @rewrite_not_or_regular_expression
end

#rewrite_nullable_reference_number?Boolean

Returns:

  • (Boolean)


390
391
392
# File 'lib/groonga-query-log/server-verifier.rb', line 390

def rewrite_nullable_reference_number?
  @rewrite_nullable_reference_number
end

#rewrite_vector_equal?Boolean

Returns:

  • (Boolean)


382
383
384
# File 'lib/groonga-query-log/server-verifier.rb', line 382

def rewrite_vector_equal?
  @rewrite_vector_equal
end

#rewrite_vector_not_equal_empty_string?Boolean

Returns:

  • (Boolean)


386
387
388
# File 'lib/groonga-query-log/server-verifier.rb', line 386

def rewrite_vector_not_equal_empty_string?
  @rewrite_vector_not_equal_empty_string
end

#stop_on_failure?Boolean

Returns:

  • (Boolean)


378
379
380
# File 'lib/groonga-query-log/server-verifier.rb', line 378

def stop_on_failure?
  @stop_on_failure
end

#target_command_name?(name) ⇒ Boolean

Returns:

  • (Boolean)


402
403
404
405
406
407
408
409
410
# File 'lib/groonga-query-log/server-verifier.rb', line 402

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

  @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

#to_filter_rewriter_optionsObject



435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/groonga-query-log/server-verifier.rb', line 435

def to_filter_rewriter_options
  {
    :rewrite_vector_equal => rewrite_vector_equal?,
    :rewrite_vector_not_equal_empty_string =>
      rewrite_vector_not_equal_empty_string?,
    :vector_accessors => vector_accessors,
    :rewrite_nullable_reference_number =>
      rewrite_nullable_reference_number?,
    :nullable_reference_number_accessors =>
      nullable_reference_number_accessors,
    :rewrite_not_or_regular_expression =>
      rewrite_not_or_regular_expression?,
    :rewrite_and_not_operator =>
      rewrite_and_not_operator?,
  }
end

#verify_cache?Boolean

Returns:

  • (Boolean)


374
375
376
# File 'lib/groonga-query-log/server-verifier.rb', line 374

def verify_cache?
  @verify_cache
end

#verify_performance?Boolean

Returns:

  • (Boolean)


452
453
454
# File 'lib/groonga-query-log/server-verifier.rb', line 452

def verify_performance?
  @verify_performance
end