Class: GroongaQueryLog::Command::CheckPerformanceRegression::Threshold
- Inherits:
-
Object
- Object
- GroongaQueryLog::Command::CheckPerformanceRegression::Threshold
- Defined in:
- lib/groonga-query-log/command/check-performance-regression.rb
Instance Attribute Summary collapse
-
#operation_ratio ⇒ Object
Returns the value of attribute operation_ratio.
-
#operation_second ⇒ Object
Returns the value of attribute operation_second.
-
#query_ratio ⇒ Object
Returns the value of attribute query_ratio.
-
#query_second ⇒ Object
Returns the value of attribute query_second.
Instance Method Summary collapse
-
#initialize ⇒ Threshold
constructor
A new instance of Threshold.
- #slow_operation?(diff_sec, diff_ratio) ⇒ Boolean
- #slow_query?(diff_sec, diff_ratio) ⇒ Boolean
Constructor Details
#initialize ⇒ Threshold
Returns a new instance of Threshold.
194 195 196 197 198 199 |
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 194 def initialize @query_ratio = 0 @query_second = 0.2 @operation_ratio = 0.1 @operation_second = 0.1 end |
Instance Attribute Details
#operation_ratio ⇒ Object
Returns the value of attribute operation_ratio.
192 193 194 |
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 192 def operation_ratio @operation_ratio end |
#operation_second ⇒ Object
Returns the value of attribute operation_second.
193 194 195 |
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 193 def operation_second @operation_second end |
#query_ratio ⇒ Object
Returns the value of attribute query_ratio.
190 191 192 |
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 190 def query_ratio @query_ratio end |
#query_second ⇒ Object
Returns the value of attribute query_second.
191 192 193 |
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 191 def query_second @query_second end |
Instance Method Details
#slow_operation?(diff_sec, diff_ratio) ⇒ Boolean
207 208 209 210 211 |
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 207 def slow_operation?(diff_sec, diff_ratio) return false if diff_sec.zero? (diff_sec >= @operation_second) and (diff_ratio >= @operation_ratio) end |
#slow_query?(diff_sec, diff_ratio) ⇒ Boolean
201 202 203 204 205 |
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 201 def slow_query?(diff_sec, diff_ratio) return false if diff_sec.zero? (diff_sec >= @query_second) and (diff_ratio >= @query_ratio) end |