Class: GroongaQueryLog::PerformanceVerifier
- Inherits:
-
Object
- Object
- GroongaQueryLog::PerformanceVerifier
- Defined in:
- lib/groonga-query-log/performance-verifier.rb
Defined Under Namespace
Classes: Options
Instance Method Summary collapse
- #diff_ratio ⇒ Object
-
#initialize(command, old_responses, new_responses, options) ⇒ PerformanceVerifier
constructor
A new instance of PerformanceVerifier.
- #new_elapsed_time ⇒ Object
- #old_elapsed_time ⇒ Object
- #slow? ⇒ Boolean
Constructor Details
#initialize(command, old_responses, new_responses, options) ⇒ PerformanceVerifier
Returns a new instance of PerformanceVerifier.
29 30 31 32 33 34 35 36 |
# File 'lib/groonga-query-log/performance-verifier.rb', line 29 def initialize(command, old_responses, new_responses, ) @command = command @old_responses = old_responses @new_responses = new_responses @options = @threshold_diff = 0.1 @threshold_ratio = 1.1 end |
Instance Method Details
#diff_ratio ⇒ Object
58 59 60 |
# File 'lib/groonga-query-log/performance-verifier.rb', line 58 def diff_ratio compute_diff_ratio end |
#new_elapsed_time ⇒ Object
54 55 56 |
# File 'lib/groonga-query-log/performance-verifier.rb', line 54 def new_elapsed_time choose_target_elapsed_time(@new_responses) end |
#old_elapsed_time ⇒ Object
50 51 52 |
# File 'lib/groonga-query-log/performance-verifier.rb', line 50 def old_elapsed_time choose_target_elapsed_time(@old_responses) end |
#slow? ⇒ Boolean
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/groonga-query-log/performance-verifier.rb', line 38 def slow? if error?(@old_responses) or error?(@new_responses) return false end if (old_elapsed_time - new_elapsed_time).abs < @threshold_diff return false end diff_ratio > @threshold_ratio end |